From 0a1bf56909464e938a68c29b26ab88ff51380fad Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期三, 08 一月 2025 13:56:17 +0800 Subject: [PATCH] 能效分析水力图表 装置点显示文字 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs | 1093 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 922 insertions(+), 171 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs index d9cedf2..4a86348 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs @@ -1,8 +1,4 @@ -锘縰sing DevExpress.XtraSpreadsheet.Model.CopyOperation; -using System.Windows.Media.Imaging; -using Yw.DAL.Basic; -using Yw.EPAnet; -using Yw.Hydro; +锘縰sing Yw.Hydro; using Yw.Model; namespace Yw.WinFrmUI @@ -67,6 +63,12 @@ #region 娑堢伀鏍� vm.Hydrants = hydroInfo.Hydrants?.Select(x => Create(x, hydroInfo)).ToList(); + + #endregion + + #region 鍐峰嵈濉� + + vm.Coolings = hydroInfo.Coolings?.Select(x => Create(x, hydroInfo)).ToList(); #endregion @@ -347,6 +349,38 @@ return default; } return new HydroHydrantMatchingViewModel(visualViewModel); + } + + #endregion + + #region 鍐峰嵈濉� + + /// <summary> + /// 鍒涘缓鍐峰嵈濉旇嚜鍔ㄥ尮閰峍iewModel + /// </summary> + public static HydroCoolingMatchingViewModel Create(HydroCoolingInfo visualInfo, HydroModelInfo hydroInfo) + { + if (visualInfo == null) + { + return default; + } + if (hydroInfo == null) + { + return default; + } + return new HydroCoolingMatchingViewModel(visualInfo, hydroInfo); + } + + /// <summary> + /// 鍒涘缓鍐峰嵈濉旇嚜鍔ㄥ尮閰峍iewModel + /// </summary> + public static HydroCoolingMatchingViewModel Create(HydroCoolingViewModel visualViewModel) + { + if (visualViewModel == null) + { + return default; + } + return new HydroCoolingMatchingViewModel(visualViewModel); } #endregion @@ -794,6 +828,25 @@ #endregion + #region 娑堢伀鏍� + + if (hydroInfo.Coolings != null && hydroInfo.Coolings.Count > 0) + { + if (matchingInfo.Coolings != null && matchingInfo.Coolings.Count > 0) + { + hydroInfo.Coolings.ForEach(x => + { + var matching = matchingInfo.Coolings.Find(t => t.Code == x.Code); + if (Apply(hydroInfo, x, matching)) + { + result = true; + } + }); + } + } + + #endregion + #region 姘磋〃 if (hydroInfo.Meters != null && hydroInfo.Meters.Count > 0) @@ -889,6 +942,25 @@ #endregion + #region 姘存车 + + if (hydroInfo.Pumps != null && hydroInfo.Pumps.Count > 0) + { + if (matchingInfo.Pumps != null && matchingInfo.Pumps.Count > 0) + { + hydroInfo.Pumps.ForEach(x => + { + var matching = matchingInfo.Pumps.Find(t => t.Code == x.Code); + if (Apply(hydroInfo, x, matching)) + { + result = true; + } + }); + } + } + + #endregion + #region 闃�闂� if (hydroInfo.Valves != null && hydroInfo.Valves.Count > 0) @@ -954,9 +1026,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroTankViewModel visualViewModel, HydroTankMatchingViewModel matching) + public static bool Apply + ( + HydroTankViewModel visualViewModel, + HydroTankMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -964,7 +1042,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroTankInfo visual, HydroTankMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroTankInfo visual, + HydroTankMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -978,51 +1063,86 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.MinLevel = matching.MinLevel; - visual.MaxLevel = matching.MaxLevel; - visual.DN = matching.DN; - visual.MinVol = matching.MinVol; - visual.OverFlow = matching.OverFlow; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.MinLevel = matching.MinLevel; + //visual.MaxLevel = matching.MaxLevel; + //visual.DN = matching.DN; + //visual.MinVol = matching.MinVol; + //visual.OverFlow = matching.OverFlow; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingMinLevel.HasValue) { + if (visual.MinLevel != matching.MatchingMinLevel.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinLevel), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinLevel = matching.MatchingMinLevel.Value; result = true; } if (matching.MatchingMaxLevel.HasValue) { + if (visual.MaxLevel != matching.MatchingMaxLevel.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MaxLevel), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MaxLevel = matching.MatchingMaxLevel.Value; result = true; } if (matching.MatchingDN.HasValue) { + if (visual.DN != matching.MatchingDN.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DN), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DN = matching.MatchingDN.Value; result = true; } if (matching.MatchingMinVol.HasValue) { + if (visual.MinVol != matching.MatchingMinVol.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinVol), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinVol = matching.MatchingMinVol.Value; result = true; } if (matching.MatchingOverFlow.HasValue) { + if (visual.OverFlow != matching.MatchingOverFlow.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.OverFlow), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.OverFlow = matching.MatchingOverFlow.Value; result = true; } @@ -1038,7 +1158,7 @@ curvevol.ModelType = string.Empty; curvevol.DbLocked = false; curvevol.DbId = matching.MatchingCurveDbId; - curvevol.CurveType = Yw.WinFrmUI.HydroCurve.TankVol; + curvevol.CurveType = Yw.WinFrmUI.HydroCurveType.CurveVol; curvevol.CurveData = matching.MatchingVolCurve?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -1046,6 +1166,7 @@ } hydroInfo.Curves.Add(curvevol); visual.VolCurve = curvevol.Code; + changeHelper?.Append(curvevol, eChangeType.Add); result = true; } else @@ -1054,7 +1175,22 @@ { curvevol.DbId = matching.MatchingCurveDbId; curvevol.CurveData = matching.MatchingVolCurve?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); + changeHelper?.Append(curvevol, eChangeType.Update); result = true; + } + } + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.VolCurve), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇"); + } + else + { + if (!string.IsNullOrEmpty(visual.VolCurve)) + { + var volCurve = hydroInfo?.Curves?.Find(x => x.Code == visual.VolCurve); + if (volCurve != null) + { + hydroInfo.Curves?.RemoveAll(x => x.Code == visual.VolCurve); + visual.VolCurve = string.Empty; + changeHelper?.Append(volCurve, eChangeType.Remove); } } } @@ -1069,9 +1205,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroBluntheadViewModel visualViewModel, HydroBluntheadMatchingViewModel matching) + public static bool Apply + ( + HydroBluntheadViewModel visualViewModel, + HydroBluntheadMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1079,7 +1221,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroBluntheadInfo visual, HydroBluntheadMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroBluntheadInfo visual, + HydroBluntheadMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1093,39 +1242,64 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Caliber = matching.Caliber; - visual.Material = matching.Material; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Caliber = matching.Caliber; + //visual.Material = matching.Material; + //visual.MinorLoss = matching.MinorLoss; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } @@ -1140,9 +1314,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroElbowViewModel visualViewModel, HydroElbowMatchingViewModel matching) + public static bool Apply + ( + HydroElbowViewModel visualViewModel, + HydroElbowMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1150,7 +1330,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroElbowInfo visual, HydroElbowMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroElbowInfo visual, + HydroElbowMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1164,55 +1351,91 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Caliber = matching.Caliber; - visual.Material = matching.Material; - visual.MinorLoss = matching.MinorLoss; - visual.BendingAngle = matching.BendingAngle; - if (matching.ElbowType.HasValue) - { - visual.ElbowType = HydroElbowTypeEnumHelper.GetElbowTypeName(matching.ElbowType.Value); - } + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Caliber = matching.Caliber; + //visual.Material = matching.Material; + //visual.MinorLoss = matching.MinorLoss; + //visual.BendingAngle = matching.BendingAngle; + //if (matching.ElbowType.HasValue) + //{ + // visual.ElbowType = HydroElbowTypeEnumHelper.GetElbowTypeName(matching.ElbowType.Value); + //} bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } if (matching.MatchingBendingAngle.HasValue) { + if (visual.BendingAngle != matching.MatchingBendingAngle.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.BendingAngle), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.BendingAngle = matching.MatchingBendingAngle.Value; result = true; } if (matching.MatchingElbowType.HasValue) { - visual.ElbowType = HydroElbowTypeEnumHelper.GetElbowTypeName(matching.MatchingElbowType.Value); + var elbowType = HydroElbowTypeEnumHelper.GetElbowTypeName(matching.MatchingElbowType.Value); + if (visual.ElbowType != elbowType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ElbowType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.ElbowType = elbowType; result = true; } } @@ -1226,9 +1449,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroThreelinkViewModel visualViewModel, HydroThreelinkMatchingViewModel matching) + public static bool Apply + ( + HydroThreelinkViewModel visualViewModel, + HydroThreelinkMatchingViewModel matching, + HydroChangeHelper changeHelper, + HydroPropStatusHelper propStatusHelper + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1236,7 +1465,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroThreelinkInfo visual, HydroThreelinkMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroThreelinkInfo visual, + HydroThreelinkMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1250,51 +1486,86 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Caliber = matching.Caliber; - visual.Material = matching.Material; - visual.MinorLoss = matching.MinorLoss; - visual.RunningThroughLoss = matching.RunningThroughLoss; - visual.BranchThroughLoss = matching.BranchThroughLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Caliber = matching.Caliber; + //visual.Material = matching.Material; + //visual.MinorLoss = matching.MinorLoss; + //visual.RunningThroughLoss = matching.RunningThroughLoss; + //visual.BranchThroughLoss = matching.BranchThroughLoss; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } if (matching.MatchingRunningThroughLoss.HasValue) { + if (visual.RunningThroughLoss != matching.MatchingRunningThroughLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.RunningThroughLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.RunningThroughLoss = matching.MatchingRunningThroughLoss.Value; result = true; } if (matching.MatchingBranchThroughLoss.HasValue) { + if (visual.BranchThroughLoss != matching.MatchingBranchThroughLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.BranchThroughLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.BranchThroughLoss = matching.MatchingBranchThroughLoss.Value; result = true; } @@ -1309,9 +1580,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroFourlinkViewModel visualViewModel, HydroFourlinkMatchingViewModel matching) + public static bool Apply + ( + HydroFourlinkViewModel visualViewModel, + HydroFourlinkMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1319,7 +1596,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroFourlinkInfo visual, HydroFourlinkMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroFourlinkInfo visual, + HydroFourlinkMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1333,39 +1617,64 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Caliber = matching.Caliber; - visual.Material = matching.Material; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Caliber = matching.Caliber; + //visual.Material = matching.Material; + //visual.MinorLoss = matching.MinorLoss; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } @@ -1380,9 +1689,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroNozzleViewModel visualViewModel, HydroNozzleMatchingViewModel matching) + public static bool Apply + ( + HydroNozzleViewModel visualViewModel, + HydroNozzleMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1390,7 +1705,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroNozzleInfo visual, HydroNozzleMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroNozzleInfo visual, + HydroNozzleMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1404,45 +1726,75 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Material = matching.Material; - visual.Caliber = matching.Caliber; - visual.MinorLoss = matching.MinorLoss; - visual.Coefficient = matching.Coefficient; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Material = matching.Material; + //visual.Caliber = matching.Caliber; + //visual.MinorLoss = matching.MinorLoss; + //visual.Coefficient = matching.Coefficient; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } if (matching.MatchingCoefficient.HasValue) { + if (visual.Coefficient != matching.MatchingCoefficient.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Coefficient), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Coefficient = matching.MatchingCoefficient.Value; result = true; } @@ -1457,9 +1809,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroHydrantViewModel visualViewModel, HydroHydrantMatchingViewModel matching) + public static bool Apply + ( + HydroHydrantViewModel visualViewModel, + HydroHydrantMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1467,7 +1825,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroHydrantInfo visual, HydroHydrantMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroHydrantInfo visual, + HydroHydrantMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1481,46 +1846,207 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Material = matching.Material; - visual.Caliber = matching.Caliber; - visual.MinorLoss = matching.MinorLoss; - visual.Coefficient = matching.Coefficient; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Material = matching.Material; + //visual.Caliber = matching.Caliber; + // visual.MinorLoss = matching.MinorLoss; + // visual.Coefficient = matching.Coefficient; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } if (matching.MatchingCoefficient.HasValue) { + if (visual.Coefficient != matching.MatchingCoefficient.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Coefficient), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Coefficient = matching.MatchingCoefficient.Value; + result = true; + } + } + return result; + } + + #endregion + + #region 鍐峰嵈濉� + + /// <summary> + /// 搴旂敤 + /// </summary> + public static bool Apply + ( + HydroCoolingViewModel visualViewModel, + HydroCoolingMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) + { + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); + visualViewModel.UpdateProperty(); + return bol; + } + + /// <summary> + /// 搴旂敤 + /// </summary> + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroCoolingInfo visual, + HydroCoolingMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) + { + if (hydroInfo == null) + { + return false; + } + if (visual == null) + { + return false; + } + if (matching == null) + { + return false; + } + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Material = matching.Material; + //visual.Caliber = matching.Caliber; + //visual.MinorLoss = matching.MinorLoss; + //visual.Coefficient = matching.Coefficient; + //visual.LowerLimit = matching.LowerLimit; + + bool result = false; + if (!visual.DbLocked) + { + if (!string.IsNullOrEmpty(matching.MatchingModelType)) + { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.ModelType = matching.MatchingModelType; + result = true; + } + if (!string.IsNullOrEmpty(matching.MatchingDbId)) + { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.DbId = matching.MatchingDbId; + result = true; + } + if (matching.MatchingCaliber.HasValue) + { + if (visual.Caliber != matching.MatchingCaliber.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Caliber), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.Caliber = matching.MatchingCaliber.Value; + result = true; + } + if (!string.IsNullOrEmpty(matching.MatchingMaterial)) + { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.Material = matching.MatchingMaterial; + result = true; + } + if (matching.MatchingMinorLoss.HasValue) + { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.MinorLoss = matching.MatchingMinorLoss.Value; + result = true; + } + if (matching.MatchingCoefficient.HasValue) + { + if (visual.Coefficient != matching.MatchingCoefficient.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Coefficient), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.Coefficient = matching.MatchingCoefficient.Value; + result = true; + } + if (matching.MatchingLowerLimit.HasValue) + { + if (visual.LowerLimit != matching.MatchingLowerLimit.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.LowerLimit), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.LowerLimit = matching.MatchingLowerLimit.Value; result = true; } } @@ -1534,9 +2060,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroMeterViewModel visualViewModel, HydroMeterMatchingViewModel matching) + public static bool Apply + ( + HydroMeterViewModel visualViewModel, + HydroMeterMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1544,7 +2076,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroMeterInfo visual, HydroMeterMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroMeterInfo visual, + HydroMeterMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1558,27 +2097,42 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.MinorLoss = matching.MinorLoss; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } @@ -1593,9 +2147,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroFlowmeterViewModel visualViewModel, HydroFlowmeterMatchingViewModel matching) + public static bool Apply + ( + HydroFlowmeterViewModel visualViewModel, + HydroFlowmeterMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1603,7 +2163,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroFlowmeterInfo visual, HydroFlowmeterMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroFlowmeterInfo visual, + HydroFlowmeterMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1617,27 +2184,42 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + // visual.ModelType = matching.ModelType; + // visual.MinorLoss = matching.MinorLoss; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } @@ -1652,9 +2234,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroPressmeterViewModel visualViewModel, HydroPressmeterMatchingViewModel matching) + public static bool Apply + ( + HydroPressmeterViewModel visualViewModel, + HydroPressmeterMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1662,7 +2250,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPressmeterInfo visual, HydroPressmeterMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroPressmeterInfo visual, + HydroPressmeterMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1676,27 +2271,42 @@ { return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.MinorLoss = matching.MinorLoss; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } @@ -1711,9 +2321,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroPipeViewModel visualViewModel, HydroPipeMatchingViewModel matching) + public static bool Apply + ( + HydroPipeViewModel visualViewModel, + HydroPipeMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1721,7 +2337,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPipeInfo visual, HydroPipeMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroPipeInfo visual, + HydroPipeMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1736,14 +2359,14 @@ return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Material = matching.Material; - visual.Diameter = matching.Diameter; - visual.Roughness = matching.Roughness; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Material = matching.Material; + //visual.Diameter = matching.Diameter; + //visual.Roughness = matching.Roughness; + //visual.MinorLoss = matching.MinorLoss; bool result = false; @@ -1751,31 +2374,61 @@ { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingDiameter.HasValue) { + if (visual.Diameter != matching.MatchingDiameter.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Diameter), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Diameter = matching.MatchingDiameter.Value; result = true; } if (matching.MatchingRoughness.HasValue) { + if (visual.Roughness != matching.MatchingRoughness.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Roughness), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Roughness = matching.MatchingRoughness.Value; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } @@ -1790,9 +2443,15 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(HydroTranslationViewModel visualViewModel, HydroTranslationMatchingViewModel matching) + public static bool Apply + ( + HydroTranslationViewModel visualViewModel, + HydroTranslationMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { - var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); + var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); visualViewModel.UpdateProperty(); return bol; } @@ -1800,7 +2459,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroTranslationInfo visual, HydroTranslationMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroTranslationInfo visual, + HydroTranslationMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1815,16 +2481,16 @@ return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.Material = matching.Material; - visual.Diameter = matching.Diameter; - visual.StartDiameter = matching.StartDiameter; - visual.EndDiameter = matching.EndDiameter; - visual.Roughness = matching.Roughness; - visual.MinorLoss = matching.MinorLoss; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.Material = matching.Material; + //visual.Diameter = matching.Diameter; + //visual.StartDiameter = matching.StartDiameter; + //visual.EndDiameter = matching.EndDiameter; + //visual.Roughness = matching.Roughness; + //visual.MinorLoss = matching.MinorLoss; bool result = false; @@ -1832,42 +2498,82 @@ { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { + if (visual.Material != matching.MatchingMaterial) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Material), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingDiameter.HasValue) { + if (visual.Diameter != matching.MatchingDiameter.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Diameter), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Diameter = matching.MatchingDiameter.Value; - result = true; - } - if (matching.MatchingStartDiameter.HasValue) - { - visual.StartDiameter = matching.MatchingStartDiameter.Value; - result = true; - } - if (matching.MatchingEndDiameter.HasValue) - { - visual.EndDiameter = matching.MatchingEndDiameter.Value; result = true; } if (matching.MatchingRoughness.HasValue) { + if (visual.Roughness != matching.MatchingRoughness.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.Roughness), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.Roughness = matching.MatchingRoughness.Value; result = true; } if (matching.MatchingMinorLoss.HasValue) { + if (visual.MinorLoss != matching.MatchingMinorLoss.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinorLoss), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.MinorLoss = matching.MatchingMinorLoss.Value; + result = true; + } + if (matching.MatchingStartDiameter.HasValue) + { + if (visual.StartDiameter != matching.MatchingStartDiameter.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.StartDiameter), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.StartDiameter = matching.MatchingStartDiameter.Value; + result = true; + } + if (matching.MatchingEndDiameter.HasValue) + { + if (visual.EndDiameter != matching.MatchingEndDiameter.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.EndDiameter), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.EndDiameter = matching.MatchingEndDiameter.Value; result = true; } } @@ -1891,7 +2597,14 @@ /// <summary> /// 搴旂敤 /// </summary> - public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPumpInfo visual, HydroPumpMatchingViewModel matching) + public static bool Apply + ( + Yw.Model.HydroModelInfo hydroInfo, + Yw.Model.HydroPumpInfo visual, + HydroPumpMatchingViewModel matching, + HydroChangeHelper changeHelper = null, + HydroPropStatusHelper propStatusHelper = null + ) { if (hydroInfo == null) { @@ -1906,58 +2619,99 @@ return false; } - visual.Name = matching.Name; - visual.DbLocked = matching.DbLocked; - visual.DbId = matching.DbId; - visual.ModelType = matching.ModelType; - visual.RatedQ = matching.RatedQ; - visual.RatedH = matching.RatedH; - visual.RatedP = matching.RatedP; - visual.RatedN = matching.RatedN; - visual.RatedHz = matching.RatedHz; - visual.SpeedRatio = matching.CurrentHz / visual.RatedHz; + //visual.Name = matching.Name; + //visual.DbLocked = matching.DbLocked; + //visual.DbId = matching.DbId; + //visual.ModelType = matching.ModelType; + //visual.RatedQ = matching.RatedQ; + //visual.RatedH = matching.RatedH; + //visual.RatedP = matching.RatedP; + //visual.RatedN = matching.RatedN; + //visual.RatedHz = matching.RatedHz; + //visual.SpeedRatio = matching.CurrentHz / visual.RatedHz; bool result = false; if (!visual.DbLocked) { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { + if (visual.ModelType != matching.MatchingModelType) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { + if (visual.DbId != matching.MatchingDbId) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingRatedQ.HasValue) { + if (visual.RatedQ != matching.MatchingRatedQ.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.RatedQ), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.RatedQ = matching.MatchingRatedQ.Value; result = true; } if (matching.MatchingRatedH.HasValue) { + if (visual.RatedH != matching.MatchingRatedH.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.RatedH), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.RatedH = matching.MatchingRatedH.Value; result = true; } if (matching.MatchingRatedP.HasValue) { + if (visual.RatedP != matching.MatchingRatedP.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.RatedP), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.RatedP = matching.MatchingRatedP.Value; result = true; } if (matching.MatchingRatedN.HasValue) { + if (visual.RatedN != matching.MatchingRatedN.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.RatedN), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.RatedN = matching.MatchingRatedN.Value; result = true; } if (matching.MatchingRatedHz.HasValue) { + if (visual.RatedHz != matching.MatchingRatedHz.Value) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.RatedHz), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } visual.RatedHz = matching.MatchingRatedHz.Value; result = true; } if (matching.MatchingCurrentHz.HasValue) { - visual.SpeedRatio = matching.MatchingCurrentHz.Value / visual.RatedHz; + var speedRatio = matching.MatchingCurrentHz.Value / visual.RatedHz; + if (visual.SpeedRatio != speedRatio) + { + changeHelper?.Append(visual, eChangeType.Update); + propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.SpeedRatio), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇敼"); + } + visual.SpeedRatio = speedRatio; result = true; } @@ -1974,7 +2728,7 @@ curveqh.ModelType = string.Empty; curveqh.DbLocked = false; curveqh.DbId = matching.MatchingCurveDbId; - curveqh.CurveType = Yw.WinFrmUI.HydroCurve.PumpQH; + curveqh.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQH; curveqh.CurveData = matching.MatchingCurveQH?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -2005,7 +2759,7 @@ curveqp.ModelType = string.Empty; curveqp.DbLocked = false; curveqp.DbId = matching.MatchingCurveDbId; - curveqp.CurveType = Yw.WinFrmUI.HydroCurve.PumpQP; + curveqp.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQP; curveqp.CurveData = matching.MatchingCurveQP?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -2036,7 +2790,7 @@ curveqe.ModelType = string.Empty; curveqe.DbLocked = false; curveqe.DbId = matching.MatchingCurveDbId; - curveqe.CurveType = Yw.WinFrmUI.HydroCurve.PumpQE; + curveqe.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQE; curveqe.CurveData = matching.MatchingCurveQE?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -2190,7 +2944,7 @@ curveol.ModelType = visual.ModelType; curveol.DbLocked = false; curveol.DbId = matching.MatchingCurveDbId; - curveol.CurveType = Yw.WinFrmUI.HydroCurve.ValveOL; + curveol.CurveType = Yw.WinFrmUI.HydroCurveType.CurveOL; curveol.CurveData = matching.MatchingCurveOL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -2205,6 +2959,7 @@ if (!curveol.DbLocked) { curveol.DbId = matching.MatchingCurveDbId; + curveol.CurveType = Yw.WinFrmUI.HydroCurveType.CurveOL; curveol.CurveData = matching.MatchingCurveOL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); result = true; } @@ -2216,7 +2971,7 @@ { if (!string.IsNullOrEmpty(matching.MatchingCurveDbId)) { - //闃�闂ㄥ紑搴︽崯澶辩郴鏁版洸绾� + //姘村ご鎹熷け鏇茬嚎 var curveql = hydroInfo.Curves?.Find(x => x.Code == visual.ValveSetting); if (curveql == null) { @@ -2227,7 +2982,7 @@ curveql.ModelType = visual.ModelType; curveql.DbLocked = false; curveql.DbId = matching.MatchingCurveDbId; - curveql.CurveType = Yw.WinFrmUI.HydroCurve.ValveOL; + curveql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL; curveql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -2242,6 +2997,7 @@ if (!curveql.DbLocked) { curveql.DbId = matching.MatchingCurveDbId; + curveql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL; curveql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); result = true; } @@ -2339,7 +3095,7 @@ curvevql.ModelType = string.Empty; curvevql.DbLocked = false; curvevql.DbId = matching.MatchingCurveDbId; - curvevql.CurveType = Yw.WinFrmUI.HydroCurve.ExchangerQL; + curvevql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL; curvevql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { @@ -2408,31 +3164,26 @@ if (!string.IsNullOrEmpty(matching.MatchingModelType)) { visual.ModelType = matching.MatchingModelType; - visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Normal, "鍖归厤淇"); result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { visual.DbId = matching.MatchingDbId; - visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Normal, "鍖归厤淇"); result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { visual.Material = matching.MatchingMaterial; - visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Normal, "鍖归厤淇"); result = true; } if (matching.MatchingDiameter.HasValue) { visual.Diameter = matching.MatchingDiameter.Value; - visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Normal, "鍖归厤淇"); result = true; } if (matching.MatchingMinorLoss.HasValue) { visual.MinorLoss = matching.MatchingMinorLoss.Value; - visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Normal, "鍖归厤淇"); result = true; } @@ -2448,7 +3199,7 @@ curvevql.ModelType = string.Empty; curvevql.DbLocked = false; curvevql.DbId = matching.MatchingCurveDbId; - curvevql.CurveType = Yw.WinFrmUI.HydroCurve.CompressorQL; + curvevql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL; curvevql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); if (hydroInfo.Curves == null) { -- Gitblit v1.9.3