From bee0b4fc0f1126dd10fb9d7be931121266f97f6e Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 14 一月 2025 19:03:27 +0800 Subject: [PATCH] 修复报错 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs | 48 +++++++++++++++++------------------------------- 1 files changed, 17 insertions(+), 31 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 d790851..0baaaf4 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,11 +1,4 @@ -锘縰sing HStation.CAL; -using HStation.WinFrmUI.PhartRelation; -using Swashbuckle.AspNetCore.SwaggerGen; -using System.Linq; -using System.Windows.Input; -using Yw.WinFrmUI.Q3d; - -namespace HStation.WinFrmUI +锘縩amespace HStation.WinFrmUI { public class AssetsMatchingHelper { @@ -118,7 +111,7 @@ } } - //鍠峰ご鍖归厤 + //鍐峰嵈濉斿尮閰� foreach (var item in assetsAutoMatchingView.Coolings) { if (Matching(item, allCoolingMain)) @@ -424,7 +417,6 @@ { input.MatchingValveSetting = valve.ValveSetting; } - input.MatchingValveType = (Yw.WinFrmUI.eValveType)(int)valve.ValveType; if (input.CurveDbId == null) { var list = Task.Run(async () => @@ -434,26 +426,21 @@ var def = list.OrderByDescending(x => x.Importance).First(); input.MatchingCurveDbId = def.ID.ToString(); var curve = def.Diagram.GraphList[0].GetFeatPointList(); - if (valve.ValveType == HStation.Assets.eValveType.GPV) + 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.MatchingCurveQL = new List<HydroCurvePointViewModel>(); - foreach (var item in curve) - { - input.MatchingCurveQL.Add(new HydroCurvePointViewModel(item.X, item.Y)); - } - } - else if (valve.ValveType == HStation.Assets.eValveType.TCV) - { - input.MatchingCurveOL = new List<HydroCurvePointViewModel>(); - foreach (var item in curve) - { - input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y)); - } + input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y)); } } + return true; } - - return true; + return false; } //绠¢亾鍖归厤 @@ -1781,7 +1768,10 @@ { input.MatchingBendingAngle = elbow.Angle; } - input.MatchingElbowType = (Yw.WinFrmUI.eElbowType)(int)elbow.ElbowType; + if (elbow.ElbowType != null) + { + input.MatchingElbowType = (Yw.WinFrmUI.eElbowType)(int)elbow.ElbowType; + } if (input.Material == null || input.Material == string.Empty) { input.MatchingMaterial = elbow.Material; @@ -1977,10 +1967,6 @@ if (input.StartDiameter < 0) { input.MatchingStartDiameter = translation.StartDiameter; - } - if (input.Diameter < 0) - { - input.MatchingDiameter = translation.Diameter; } return true; -- Gitblit v1.9.3