Shuxia Ning
2024-12-19 b0c978129ba55cf81e8470b6c9326745a5dbc7d1
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump-main/XhsPumpMainPhartPanel.cs
@@ -8,48 +8,7 @@
            this.PageTitle.Caption = "泵型号曲线";
            this.xhsPumpMainPhartListCtrl1.FocusedChangedEvent += XhsPumpMainPhartListCtrl1_FocusedChangedEvent;
            //this.pumpPerformInfoCtrl1.SetDesignPointEvent += (q, h) =>
            //{
            //    _design_pt = new Yw.Geometry.Point2d(q, h);
            //    this.xtrPerform2dChart1.SetEquipPt(_design_pt);
            //};
            this.xtrPerform2dChart1.OnCalcQueryPoint += (gropu_pt) =>
            {
                var vm_list = new List<PumpPointItmeViewModel>();
                vm_list.Add(new PumpPointItmeViewModel()
                {
                    Group = "查询点",
                    Name = "流量",
                    Value = $"{gropu_pt.Q:N1}",
                    Unit = "m³/h"
                });
                vm_list.Add(new PumpPointItmeViewModel()
                {
                    Group = "查询点",
                    Name = "扬程",
                    Value = $"{gropu_pt.H:N1}",
                    Unit = "m"
                });
                vm_list.Add(new PumpPointItmeViewModel()
                {
                    Group = "查询点",
                    Name = "效率",
                    Value = $"{gropu_pt.E:N1}",
                    Unit = "%"
                });
                vm_list.Add(new PumpPointItmeViewModel()
                {
                    Group = "查询点",
                    Name = "功率",
                    Value = $"{gropu_pt.P:N1}",
                    Unit = "kW"
                });
               // this.pumpPerformInfoCtrl1.SetBindingData(vm_list);
            };
        }
        private long _pump_main_id;
@@ -162,14 +121,15 @@
            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.pumpPerformInfoCtrl1.SetDesignPoint(_design_pt);
            // this.pumpViewChartCtrl1.SetBindingData(cubic_spline_qh, cubic_spline_qe, cubic_spline_qp, disp_paras, is_calc_disp_paras);
            this.pumpViewChartCtrl1.SetBindingData(pump_main.RatedSpeed, dto);
            // this.pumpPerformInfoCtrl1.SetDesignPoint(_design_pt);
        }
        //清空图表数据
        private void ClearChart()
        {
            this.xtrPerform2dChart1.InitialChartData();
           // this.xtrPerform2dChart1.InitialChartData();
        }
        #endregion 图表
@@ -242,6 +202,11 @@
                        Name = other_name+"-QH",
                        GeometryStyle=  HStation.PhartRelation.eGeometryStyle.FeatCurve,
                        GraphType= HStation.PhartRelation.eGraphType.QH,
                        GraphParas=new HStation.Model.QHGraphParasModel()
                        {
                            Hz=50,
                            N=_pump_main.RatedSpeed
                        }.ToJson(),
                        GeometryInfo=qh.ToDbString()
                    },
                    new ()
@@ -249,6 +214,11 @@
                        Name = other_name+"-QE",
                        GeometryStyle= HStation.PhartRelation.eGeometryStyle.FeatCurve,
                        GraphType= HStation.PhartRelation.eGraphType.QE,
                        GraphParas=new HStation.Model.QEGraphParasModel()
                        {
                            Hz=50,
                            N=_pump_main.RatedSpeed
                        }.ToJson(),
                        GeometryInfo=qe.ToDbString()
                    },
                    new ()
@@ -256,6 +226,11 @@
                        Name = other_name+"-QP",
                        GeometryStyle=  HStation.PhartRelation.eGeometryStyle.FeatCurve,
                        GraphType= HStation.PhartRelation.eGraphType.QP,
                        GraphParas=new HStation.Model.QPGraphParasModel()
                        {
                            Hz=50,
                            N=_pump_main.RatedSpeed
                        }.ToJson(),
                        GeometryInfo=qp.ToDbString()
                    },
                }
@@ -305,11 +280,11 @@
            Yw.Pump.CurveQE qe = null;
            Yw.Pump.CurveQP qp = null;
            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);
            points_qh = PhartPerformCurveHelper.GetFeatPointList((HStation.PhartRelation.eGraphType)graph_qh.GraphType, graph_qh.GeometryInfo, 12, null);
            qh = new Yw.Pump.CurveQH(Yw.Ahart.eFeatType.Cubic, points_qh);
            if (graph_qe != null)
            {
                points_qe = PhartPerformCurveHelper.GetFeatPointList(graph_qe.GraphType, graph_qe.GeometryInfo, 12, null);
                points_qe = PhartPerformCurveHelper.GetFeatPointList((HStation.PhartRelation.eGraphType)graph_qe.GraphType, graph_qe.GeometryInfo, 12, null);
                qe = new Yw.Pump.CurveQE(Yw.Ahart.eFeatType.Cubic, points_qe);
            }
            if (graph_qp != null)
@@ -336,7 +311,7 @@
                    graph_qe,
                    graph_qp,
                };
                var bol = await _bll.Update(_xhs_phart_diagram_ex_std_dto);
                var bol = await _bll.UpdateEx(_xhs_phart_diagram_ex_std_dto);
                if (bol)
                {
                    InitChart(_pump_main, _xhs_phart_diagram_ex_std_dto);
@@ -358,7 +333,7 @@
            dlg.VerifyValueChanged += async (value) =>
            {
                _xhs_phart_diagram_ex_std_dto.OtherName = value;
                var bol = await _bll.Update(_xhs_phart_diagram_ex_std_dto);
                var bol = await _bll.UpdateEx(_xhs_phart_diagram_ex_std_dto);
                if (!bol)
                {
                    XtraMessageBox.Show("更新失败!");
@@ -380,7 +355,7 @@
            dlg.VerifyValueChanged += async (value) =>
            {
                _xhs_phart_diagram_ex_std_dto.Importance = value;
                var bol = await _bll.Update(_xhs_phart_diagram_ex_std_dto);
                var bol = await _bll.UpdateEx(_xhs_phart_diagram_ex_std_dto);
                if (!bol)
                {
                    XtraMessageBox.Show("更新失败!");