| | |
| | | namespace HStation.WinFrmUI |
| | | using DevExpress.CodeParser; |
| | | using System.Text.Json; |
| | | using Yw.Ahart; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public class AssetsMatchingHelper |
| | | { |
| | |
| | | { |
| | | var def = list.OrderByDescending(x => x.Importance).First(); |
| | | input.MatchingCurveDbId = def.ID.ToString(); |
| | | var curve = def.Diagram.GraphList[0].GetFeatPointList(); |
| | | //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.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; |
| | | 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; |