From d672ca82c49f01dae2c5c955202b5857ef680a71 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期五, 03 一月 2025 22:16:48 +0800 Subject: [PATCH] 创建方案 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs | 47 +++++++---------------------------------------- 1 files changed, 7 insertions(+), 40 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 ca67a33..734815c 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 @@ -1069,43 +1069,36 @@ { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { - visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { - visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingMinLevel.HasValue) { - visual.UpdatePropStatus(nameof(visual.MinLevel), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.MinLevel = matching.MatchingMinLevel.Value; result = true; } if (matching.MatchingMaxLevel.HasValue) { - visual.UpdatePropStatus(nameof(visual.MaxLevel), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.MaxLevel = matching.MatchingMaxLevel.Value; result = true; } if (matching.MatchingDN.HasValue) { - visual.UpdatePropStatus(nameof(visual.DN), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.DN = matching.MatchingDN.Value; result = true; } if (matching.MatchingMinVol.HasValue) { - visual.UpdatePropStatus(nameof(visual.MinVol), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.MinVol = matching.MatchingMinVol.Value; result = true; } if (matching.MatchingOverFlow.HasValue) { - visual.UpdatePropStatus(nameof(visual.OverFlow), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.OverFlow = matching.MatchingOverFlow.Value; result = true; } @@ -1140,6 +1133,11 @@ result = true; } } + } + else + { + hydroInfo.Curves?.RemoveAll(x => x.Code == visual.VolCurve); + visual.VolCurve = string.Empty; } } return result; @@ -1656,43 +1654,36 @@ { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { - visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.ModelType}"); visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { - visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.DbId}"); visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingCaliber.HasValue) { - visual.UpdatePropStatus(nameof(visual.Caliber), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.Caliber}"); visual.Caliber = matching.MatchingCaliber.Value; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { - visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.Material}"); visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingMinorLoss.HasValue) { - visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.MinorLoss}"); visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } if (matching.MatchingCoefficient.HasValue) { - visual.UpdatePropStatus(nameof(visual.Coefficient), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.Coefficient}"); visual.Coefficient = matching.MatchingCoefficient.Value; result = true; } if (matching.MatchingLowerLimit.HasValue) { - visual.UpdatePropStatus(nameof(visual.LowerLimit), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師鏁版嵁:{visual.LowerLimit}"); visual.LowerLimit = matching.MatchingLowerLimit.Value; result = true; } @@ -2095,49 +2086,41 @@ { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { - visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.ModelType}"); visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { - visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.DbId}"); visual.DbId = matching.MatchingDbId; result = true; } if (matching.MatchingRatedQ.HasValue) { - visual.UpdatePropStatus(nameof(visual.RatedQ), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.RatedQ}"); visual.RatedQ = matching.MatchingRatedQ.Value; result = true; } if (matching.MatchingRatedH.HasValue) { - visual.UpdatePropStatus(nameof(visual.RatedH), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.RatedH}"); visual.RatedH = matching.MatchingRatedH.Value; result = true; } if (matching.MatchingRatedP.HasValue) { - visual.UpdatePropStatus(nameof(visual.RatedP), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.RatedP}"); visual.RatedP = matching.MatchingRatedP.Value; result = true; } if (matching.MatchingRatedN.HasValue) { - visual.UpdatePropStatus(nameof(visual.RatedN), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.RatedN}"); visual.RatedN = matching.MatchingRatedN.Value; result = true; } if (matching.MatchingRatedHz.HasValue) { - visual.UpdatePropStatus(nameof(visual.RatedHz), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.RatedHz}"); visual.RatedHz = matching.MatchingRatedHz.Value; result = true; } if (matching.MatchingCurrentHz.HasValue) { - visual.UpdatePropStatus(nameof(visual.SpeedRatio), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇锛屽師濮嬫暟鎹�:{visual.SpeedRatio}"); visual.SpeedRatio = matching.MatchingCurrentHz.Value / visual.RatedHz; result = true; } @@ -2162,7 +2145,6 @@ hydroInfo.Curves = new List<Yw.Model.HydroCurveInfo>(); } hydroInfo.Curves.Add(curveqh); - visual.UpdatePropStatus(nameof(visual.CurveQH), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.CurveQH = curveqh.Code; result = true; } @@ -2194,7 +2176,6 @@ hydroInfo.Curves = new List<Yw.Model.HydroCurveInfo>(); } hydroInfo.Curves.Add(curveqp); - visual.UpdatePropStatus(nameof(visual.CurveQP), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.CurveQP = curveqp.Code; result = true; } @@ -2226,7 +2207,6 @@ hydroInfo.Curves = new List<Yw.Model.HydroCurveInfo>(); } hydroInfo.Curves.Add(curveqe); - visual.UpdatePropStatus(nameof(visual.CurveQE), ePropStatus.Matching, $"閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.CurveQE = curveqe.Code; result = true; } @@ -2293,37 +2273,31 @@ { if (!string.IsNullOrEmpty(matching.MatchingModelType)) { - visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ModelType = matching.MatchingModelType; result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { - visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.DbId = matching.MatchingDbId; result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { - visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.Material = matching.MatchingMaterial; result = true; } if (matching.MatchingDiameter.HasValue) { - visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.Diameter = matching.MatchingDiameter.Value; result = true; } if (matching.MatchingMinorLoss.HasValue) { - visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.MinorLoss = matching.MatchingMinorLoss.Value; result = true; } if (matching.MatchingValveType.HasValue) { - visual.UpdatePropStatus(nameof(visual.ValveType), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ValveType = HydroValveTypeEnumHelper.GetValveTypeCode(matching.MatchingValveType.Value); result = true; } @@ -2333,7 +2307,6 @@ { if (!string.IsNullOrEmpty(matching.MatchingValveSetting)) { - visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ValveSetting = matching.MatchingValveSetting; result = true; } @@ -2343,7 +2316,6 @@ { if (!string.IsNullOrEmpty(matching.MatchingValveSetting)) { - visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ValveSetting = matching.MatchingValveSetting; result = true; } @@ -2353,7 +2325,6 @@ { if (!string.IsNullOrEmpty(matching.MatchingValveSetting)) { - visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ValveSetting = matching.MatchingValveSetting; result = true; } @@ -2363,7 +2334,6 @@ { if (!string.IsNullOrEmpty(matching.MatchingValveSetting)) { - visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); visual.ValveSetting = matching.MatchingValveSetting; result = true; } @@ -2399,6 +2369,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; } @@ -2436,6 +2407,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; } @@ -2602,31 +2574,26 @@ if (!string.IsNullOrEmpty(matching.MatchingModelType)) { visual.ModelType = matching.MatchingModelType; - visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); result = true; } if (!string.IsNullOrEmpty(matching.MatchingDbId)) { visual.DbId = matching.MatchingDbId; - visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); result = true; } if (!string.IsNullOrEmpty(matching.MatchingMaterial)) { visual.Material = matching.MatchingMaterial; - visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); result = true; } if (matching.MatchingDiameter.HasValue) { visual.Diameter = matching.MatchingDiameter.Value; - visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); result = true; } if (matching.MatchingMinorLoss.HasValue) { visual.MinorLoss = matching.MatchingMinorLoss.Value; - visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Matching, "閫氳繃鍩虹鏁版嵁鍖归厤淇"); result = true; } -- Gitblit v1.9.3