| | |
| | | { |
| | | InitializeComponent(); |
| | | this.PageTitle.Caption = "阀门损失系数曲线"; |
| | | |
| | | this.xhsValveMainPhartListCtrl1.FocusedChangedEvent += XhsValveMainPhartListCtrl1_FocusedChangedEvent; |
| | | } |
| | | |
| | | private long _valve_main_id; |
| | | private Vmo.AssetsValveCoefficientVmo _xhs_phart_diagram_ex_std_dto = null; |
| | | private readonly BLL.AssetsValveCoefficient _bll = new(); |
| | | private Vmo.AssetsValveFactorVmo _xhs_phart_diagram_ex_std_dto = null; |
| | | private readonly BLL.AssetsValveFactor _bll = new(); |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | |
| | | _valve_main_id = valve_main_id; |
| | | if (_valve_main_id < 1) |
| | | { |
| | | this.xhsValveMainPhartListCtrl1.Clear(); |
| | | return; |
| | | } |
| | | //this.xhsValveMainPhartListCtrl1.SetBindingData(valve_main_id); |
| | | var chart = await new BLL.AssetsValveCoefficient().GetByMainID(valve_main_id); |
| | | var chart = await new BLL.AssetsValveFactor().GetByMainID(valve_main_id); |
| | | if (chart.Count > 0) |
| | | { |
| | | _xhs_phart_diagram_ex_std_dto = chart.First(); |
| | |
| | | } |
| | | |
| | | //选择曲线变换事件 |
| | | private void XhsValveMainPhartListCtrl1_FocusedChangedEvent(Vmo.AssetsValveCoefficientVmo obj) |
| | | private void XhsValveMainPhartListCtrl1_FocusedChangedEvent(Vmo.AssetsValveFactorVmo obj) |
| | | { |
| | | _xhs_phart_diagram_ex_std_dto = obj; |
| | | this.xtrPerform2dChart1.SetBindingData(obj.MinorLossCurve); |
| | |
| | | //初始化图表数据 |
| | | private void InitChart(Vmo.PhartDiagramRelationExtensionsVmo dto) |
| | | { |
| | | if (dto == null) |
| | | { |
| | | return; |
| | | } |
| | | var diagram = dto.Diagram; |
| | | if (diagram == null) |
| | | { |
| | | return; |
| | | } |
| | | var graph_list = diagram.GraphList; |
| | | if (graph_list == null || !graph_list.Any()) |
| | | { |
| | | return; |
| | | } |
| | | /* if (dto == null) |
| | | { |
| | | return; |
| | | } |
| | | var diagram = dto.Diagram; |
| | | if (diagram == null) |
| | | { |
| | | return; |
| | | } |
| | | var graph_list = diagram.GraphList; |
| | | if (graph_list == null || !graph_list.Any()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var graph_ql = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveOL); |
| | | if (graph_ql == null) |
| | | { |
| | | return; |
| | | } |
| | | var graph_ql = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.OL); |
| | | if (graph_ql == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | List<Yw.Geometry.Point2d> points_ql = null; |
| | | points_ql = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 12, null); |
| | | List<Yw.Geometry.Point2d> points_ql = null; |
| | | points_ql = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 12, null); |
| | | |
| | | var cubic_spline_ql = new Yw.Geometry.CubicSpline2d(points_ql); |
| | | var cubic_spline_ql = new Yw.Geometry.CubicSpline2d(points_ql); |
| | | |
| | | var disp_paras = diagram.DispParas; |
| | | var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras); |
| | | this.xtrPerform2dChart1.SetBindingData(cubic_spline_ql.ToDbString(), disp_paras, is_calc_disp_paras); |
| | | var disp_paras = diagram.DispParas; |
| | | var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras); |
| | | this.xtrPerform2dChart1.SetBindingData(cubic_spline_ql.ToDbString(), disp_paras, is_calc_disp_paras);*/ |
| | | } |
| | | |
| | | //清空图表数据 |
| | |
| | | XtraMessageBox.Show("ValveMain is null!"); |
| | | return false; |
| | | } |
| | | var model = new Vmo.AssetsValveCoefficientVmo(); |
| | | var model = new Vmo.AssetsValveFactorVmo(); |
| | | model.MainID = _valve_main_id; |
| | | model.OpenLossCurve = pt_list_json; |
| | | this.xtrPerform2dChart1.SetBindingData(pt_list_json); |