duheng
2025-01-13 1b7957fac12e80698971513b30e65772c4c5c038
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs
@@ -419,33 +419,28 @@
            }
            if (input.CurveDbId == null)
            {
                /*    var list = Task.Run(async () =>
                        await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(HStation.Assets.DataType.ValveMain, valve.ID)).Result;
                    if (list != null && list.Count > 0)
                    {
                        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));
                            }
                        }
                        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));
                            }
                        }
                    }*/
            }
                var list = Task.Run(async () =>
                    await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(HStation.Assets.DataType.ValveMain, valve.ID)).Result;
                if (list != null && list.Count > 0)
                {
                    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>();
                    /*   foreach (var item in curve)
                       {
                           input.MatchingCurveQL.Add(new HydroCurvePointViewModel(item.X, item.Y));
                       }*/
            return true;
                    input.MatchingCurveOL = new List<HydroCurvePointViewModel>();
                    foreach (var item in curve)
                    {
                        input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y));
                    }
                }
                return true;
            }
            return false;
        }
        //管道匹配