Shuxia Ning
2024-10-09 eccc597eb5b29ce1a9982ebf31f0e1272d3db14f
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/02-valve-main/XhsValveMainPhartPanel.cs
@@ -56,29 +56,21 @@
                return;
            }
            var graph_qh = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.PumpQH);
            var graph_qe = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.PumpQE);
            var graph_qp = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.PumpQP);
            if (graph_qh == null)
            var graph_ql = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveQL);
            if (graph_ql == null)
            {
                return;
            }
            List<Yw.Geometry.Point2d> points_qh = null, points_qe = null, points_qp = null;
            points_qh = PhartPerformCurveHelper.GetFeatPointList(graph_qh.GraphType, graph_qh.GeometryInfo, 12, null);
            if (graph_qe != null)
                points_qe = PhartPerformCurveHelper.GetFeatPointList(graph_qe.GraphType, graph_qe.GeometryInfo, 12, null);
            if (graph_qp != null)
                points_qp = PhartPerformCurveHelper.GetFeatPointList(graph_qp.GraphType, graph_qp.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_qh = new Yw.Geometry.CubicSpline2d(points_qh);
            var cubic_spline_qe = new Yw.Geometry.CubicSpline2d(points_qe);
            var cubic_spline_qp = new Yw.Geometry.CubicSpline2d(points_qp);
            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_qh, cubic_spline_qe, cubic_spline_qp, disp_paras, is_calc_disp_paras);
            this.xtrPerform2dChart1.SetBindingData(cubic_spline_ql, disp_paras, is_calc_disp_paras);
        }
        //清空图表数据
@@ -181,34 +173,25 @@
            List<Yw.Geometry.Point2d> points_ql = null;
            points_ql = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 12, null);
            ql = new Yw.Geometry.CubicSpline2d(  points_ql);
            //var dlg = new Yw.WinFrmUI.Phart.XtrPerform2dEditDlg();
            //dlg.SetBindingData(ql, qe, qp);
            //dlg.ReloadDataEvent += async (new_qh, new_qe, new_qp) =>
            //{
            //    var new_points_qh = new_qh.GetPointList();
            //    var new_points_qe = new_qe.GetPointList();
            //    var new_points_qp = new_qp.GetPointList();
            //    graph_ql.GeometryInfo = new Yw.Pump.CurveQH(Yw.Pump.eFeatType.Cubic, new_points_qh).ToDbString();
            //    graph_qe.GeometryInfo = new Yw.Pump.CurveQE(Yw.Pump.eFeatType.Cubic, new_points_qe).ToDbString();
            //    graph_qp.GeometryInfo = new Yw.Pump.CurveQP(Yw.Pump.eFeatType.Cubic, new_points_qp).ToDbString();
            //    _xhs_phart_diagram_ex_std_dto.Diagram.GraphList = new List<Vmo.PhartGraph>()
            //    {
            //        graph_ql,
            //        graph_qe,
            //        graph_qp,
            //    };
            //    var bol = await _bll_ex.Update(_xhs_phart_diagram_ex_std_dto);
            //    if (bol)
            //    {
            //        InitChart(_xhs_phart_diagram_ex_std_dto);
            //    }
            //    return bol;
            //};
            //dlg.ShowDialog();
            var dlg = new Yw.WinFrmUI.Phart.ValvePerform2dEditDlg();
            dlg.SetBindingData(ql);
            dlg.ReloadDataEvent += async (new_ql) =>
            {
                graph_ql.GeometryInfo = new_ql.ToDbString();
                _xhs_phart_diagram_ex_std_dto.Diagram.GraphList = new List<Vmo.PhartGraph>()
                {
                    graph_ql
                };
                var bol = await _bll_ex.Update(_xhs_phart_diagram_ex_std_dto);
                if (bol)
                {
                    InitChart(_xhs_phart_diagram_ex_std_dto);
                }
                return bol;
            };
            dlg.ShowDialog();
        }
        //别名