lixiaojun
2024-12-23 b9c79f595e5ad4684d731f968bf120ff8c52dbd8
WinFrmUI/Yw.WinFrmUI.Hydro.Core/12-monitor/00-core/HydroMonitorValueExtensions.cs
@@ -9,9 +9,9 @@
        /// <summary>
        /// 更新监测值列表
        /// </summary>
        public static void UpdateMonitorValue(this List<HydroMonitorValueViewModel> allMonitorValueList, string monitorInfo)
        public static void UpdateMonitorValue(this List<HydroMonitorValueViewModel> all, string monitorInfo)
        {
            if (allMonitorValueList == null || allMonitorValueList.Count < 1)
            if (all == null || all.Count < 1)
            {
                return;
            }
@@ -20,19 +20,19 @@
                return;
            }
            var allWorkingMonitorList = JsonHelper.Json2Object<List<HydroWorkingMonitorViewModel>>(monitorInfo);
            if (allWorkingMonitorList == null || allWorkingMonitorList.Count < 1)
            {
                return;
            }
            allMonitorValueList.UpdateMonitorValue(allWorkingMonitorList);
            all.UpdateMonitorValue(allWorkingMonitorList);
        }
        /// <summary>
        /// 更新监测值列表
        /// </summary>
        public static void UpdateMonitorValue(this List<HydroMonitorValueViewModel> allMonitorValueList, List<HydroWorkingMonitorViewModel> allWorkingMonitorList)
        public static void UpdateMonitorValue
            (
                this List<HydroMonitorValueViewModel> all,
                List<HydroWorkingMonitorViewModel> allWorkingMonitorList
            )
        {
            if (allMonitorValueList == null || allMonitorValueList.Count < 1)
            if (all == null || all.Count < 1)
            {
                return;
            }
@@ -40,12 +40,12 @@
            {
                return;
            }
            foreach (var monitorValue in allMonitorValueList)
            foreach (var monitorValue in all)
            {
                var workingMonitor = allWorkingMonitorList.Find(x => x.Relation == monitorValue.Vmo.Relation && x.PropName == monitorValue.Vmo.PropName);
                if (workingMonitor != null)
                {
                    monitorValue.PropValue = workingMonitor.PropValue;
                    monitorValue.UpdatePropValue(workingMonitor.PropValue);
                }
            }
        }