From e3ca589482a056449963e7bbbd77824ded3928bc Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期五, 07 二月 2025 10:49:36 +0800 Subject: [PATCH] 过渡件匹配修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs index f64a335..e720371 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs @@ -1,4 +1,8 @@ -锘縩amespace HStation.WinFrmUI +锘縰sing DevExpress.CodeParser; +using System.Text.Json; +using Yw.Ahart; + +namespace HStation.WinFrmUI { public class AssetsMatchingHelper { @@ -413,11 +417,6 @@ { input.MatchingMinorLoss = valve.MinorLoss; } - if (input.ValveSetting == null) - { - input.MatchingValveSetting = valve.ValveSetting; - } - input.MatchingValveType = eValveType.TCV; if (input.CurveDbId == null) { var list = Task.Run(async () => @@ -426,17 +425,38 @@ { var def = list.OrderByDescending(x => x.Importance).First(); input.MatchingCurveDbId = def.ID.ToString(); - var curve = def.Diagram.GraphList[0].GetFeatPointList(); - input.MatchingCurveQL = new List<HydroCurvePointViewModel>(); + //var curve = def.Diagram.GraphList[0].GetFeatPointList(); + //var curve1 = def.Diagram.GraphList[1].GetFeatPointList(); + //input.MatchingCurveQL = new List<HydroCurvePointViewModel>(); /* foreach (var item in curve) { input.MatchingCurveQL.Add(new HydroCurvePointViewModel(item.X, item.Y)); }*/ input.MatchingCurveOL = new List<HydroCurvePointViewModel>(); - foreach (var item in curve) + input.MatchingCurvesQL = new List<HydroFactorCurveViewModel>(); + for (int i = 0; i < def.Diagram.GraphList.Count; i++) { - input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y)); + var curve = def.Diagram.GraphList[i].GetFeatPointList(); + if (def.Diagram.GraphList[i].GraphType == 11) + { + var opening = Yw.WinFrmUI.PhartGraphHelper.GetGraphParas<Yw.WinFrmUI.Phart.QLGraphParasViewModel>((Yw.Ahart.eCurveType)def.Diagram.GraphList[i].GraphType, def.Diagram.GraphList[i].GraphParas); + var model = new HydroFactorCurveViewModel(); + model.CurveFactor = opening.Opening ?? 0; + model.CurveData = new List<HydroCurvePointViewModel>(); + foreach (var item in curve) + { + model.CurveData.Add(new HydroCurvePointViewModel(item.X, item.Y)); + } + input.MatchingCurvesQL.Add(model); + } + else if (def.Diagram.GraphList[i].GraphType == 12) + { + foreach (var item in curve) + { + input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y)); + } + } } } return true; @@ -2033,6 +2053,7 @@ { input.MatchingStartDiameter = translation.StartDiameter; } + input.MatchingTranslationType = (Yw.WinFrmUI.eTranslationType)(int)translation.TranslationType; return true; } -- Gitblit v1.9.3