| | |
| | | using HStation.CAL; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using Swashbuckle.AspNetCore.SwaggerGen; |
| | | using System.Linq; |
| | | using System.Windows.Input; |
| | | using Yw.WinFrmUI.Q3d; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public class AssetsMatchingHelper |
| | | { |
| | |
| | | { |
| | | input.MatchingValveSetting = valve.ValveSetting; |
| | | } |
| | | input.MatchingValveType = (Yw.WinFrmUI. eValveType)(int )valve.ValveType; |
| | | if (input.CurveDbId == null) |
| | | 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) |
| | | /* var list = Task.Run(async () => |
| | | await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(HStation.Assets.DataType.ValveMain, valve.ID)).Result; |
| | | if (list != null && list.Count > 0) |
| | | { |
| | | input.MatchingCurveQL = new List<HydroCurvePointViewModel>(); |
| | | foreach (var item in curve) |
| | | 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.Add(new HydroCurvePointViewModel(item.X, item.Y)); |
| | | 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) |
| | | else if (valve.ValveType == HStation.Assets.eValveType.TCV) |
| | | { |
| | | input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y)); |
| | | input.MatchingCurveOL = new List<HydroCurvePointViewModel>(); |
| | | foreach (var item in curve) |
| | | { |
| | | input.MatchingCurveOL.Add(new HydroCurvePointViewModel(item.X, item.Y)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | return true; |
| | |
| | | } |
| | | if (input.MinorLoss <= 0) |
| | | { |
| | | input.MatchingMinorLoss = sprinkler.MinorLoss; |
| | | input.MatchingMinorLoss = sprinkler.FlowMinorLoss; |
| | | } |
| | | |
| | | return true; |
| | |
| | | if (input.StartDiameter < 0) |
| | | { |
| | | input.MatchingStartDiameter = translation.StartDiameter; |
| | | } |
| | | if (input.Diameter < 0) |
| | | { |
| | | input.MatchingDiameter = translation.Diameter; |
| | | } |
| | | |
| | | return true; |