Shuxia Ning
2024-12-02 8f88c4e1bc1d6c1b2e7c4754e70eec8c27aa90fd
WinFrmUI/Yw.WinFrmUI.Phart.Core/v3/02-pump/01-single/02-operation/PumpOperationChart.cs
@@ -138,8 +138,7 @@
            _axis_y_eff.GridLines.Visible = false;
            _axis_y_power.Visibility = DefaultBoolean.False;
            _axis_y_power.GridLines.Visible = false;
            _query_flow_line.Visible = false;
            _anno_txt_query_info.Visible = false;
@@ -156,112 +155,64 @@
            if (e is not DXCustomPaintEventArgs dxArgs)
                return;
            if (_operation_vm == null)
                return;
                return;
            if (_equip_line != null && _equip_sect_pt != null && _equip_visible)
            {
                var dis_min_h = _coordinate.DispMinH();
                var equip_pt_list = _equip_line.GetPointList().ToList();
                var pt_f_list = new List<PointF>();
                foreach (var pt in equip_pt_list)
                {
                    var dg_pt = _diagram.DiagramToPoint(pt.X, pt.Y, _axis_x_flow, _axis_y_head).Point;
                    pt_f_list.Add(new PointF(dg_pt.X, dg_pt.Y));
                }
                using Pen pen = new(Color.Black, 2);
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                var c_pt_qh = _diagram.DiagramToPoint(_equip_sect_pt.X, _equip_sect_pt.Y, _axis_x_flow, _axis_y_head);
                dxArgs.Cache.DrawLine(pen, new Point((int)c_pt_qh.Point.X, (int)c_pt_qh.Point.Y - 10), new Point((int)c_pt_qh.Point.X, (int)c_pt_qh.Point.Y + 10));
                if (_qe_visible)
                {
                    var y_qe = _operation_vm.CurrentCurveQE.GetPointY(_equip_sect_pt.X);
                    var c_pt_qe = _diagram.DiagramToPoint(_equip_sect_pt.X, y_qe, _axis_x_flow, _axis_y_eff);
                    dxArgs.Cache.DrawLine(pen, new Point((int)c_pt_qe.Point.X, (int)c_pt_qe.Point.Y - 10), new Point((int)c_pt_qe.Point.X, (int)c_pt_qe.Point.Y + 10));
                }
                if (_qp_visible)
                {
                    var y_qp = _operation_vm.CurrentCurveQP.GetPointY(_equip_sect_pt.X);
                    var c_pt_qp = _diagram.DiagramToPoint(_equip_sect_pt.X, y_qp, _axis_x_flow, _axis_y_power);
                    dxArgs.Cache.DrawLine(pen, new Point((int)c_pt_qp.Point.X, (int)c_pt_qp.Point.Y - 10), new Point((int)c_pt_qp.Point.X, (int)c_pt_qp.Point.Y + 10));
                }
                var pts = _equip_line.GetPointList().Select(x => new PointF((float)x.X, (float)x.Y)).ToArray();
                var g_pts = new List<PointF>();
                foreach (var pt in pts)
                {
                    var x = pt.X;
                    var y = pt.Y;
                    var c_pt = _diagram.DiagramToPoint(x, y, _axis_x_flow, _axis_y_head);
                    g_pts.Add(new PointF(c_pt.Point.X, c_pt.Point.Y));
                }
                using var path = new System.Drawing.Drawing2D.GraphicsPath();
                path.AddCurve(g_pts.ToArray());
                path.AddCurve(pt_f_list.ToArray());
                dxArgs.Cache.DrawPath(pen, path);
            }
            try
            {
                var dis_min_h = _coordinate.DispMinH();
                var equip_paras = EquipCurveHelper.CalcEquipCurve(_operation_vm.QhCalc, _operation_vm.WorkPoint, dis_min_h, out Yw.Geometry.Point2d sect_pt);
                if (equip_paras != null && equip_paras.IsValid())
                DrawEquipPoint(dxArgs.Cache, pen, _equip_sect_pt, _operation_vm.CurveQE, _operation_vm.CurveQP);
                if (_current_equip_sect_pt != null)
                {
                    using Pen pen = new(Color.Black, 2);
                    pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                    var c_pt_qh = _diagram.DiagramToPoint(sect_pt.X, sect_pt.Y, _axis_x_flow, _axis_y_head);
                    dxArgs.Cache.DrawLine(pen, new Point((int)c_pt_qh.Point.X, (int)c_pt_qh.Point.Y - 10), new Point((int)c_pt_qh.Point.X, (int)c_pt_qh.Point.Y + 10));
                    if (_qe_visible)
                    {
                        var y_qe = _operation_vm.QeCalc.GetPointY(sect_pt.X);
                        var c_pt_qe = _diagram.DiagramToPoint(sect_pt.X, y_qe, _axis_x_flow, _axis_y_eff);
                        dxArgs.Cache.DrawLine(pen, new Point((int)c_pt_qe.Point.X, (int)c_pt_qe.Point.Y - 10), new Point((int)c_pt_qe.Point.X, (int)c_pt_qe.Point.Y + 10));
                    }
                    if (_qp_visible)
                    {
                        var y_qp = _operation_vm.QpCalc.GetPointY(sect_pt.X);
                        var c_pt_qp = _diagram.DiagramToPoint(sect_pt.X, y_qp, _axis_x_flow, _axis_y_power);
                        dxArgs.Cache.DrawLine(pen, new Point((int)c_pt_qp.Point.X, (int)c_pt_qp.Point.Y - 10), new Point((int)c_pt_qp.Point.X, (int)c_pt_qp.Point.Y + 10));
                    }
                    // 创建GraphicsPath对象,并添加样条线
                    var pts = equip_paras.GetPointList().Select(x => new PointF((float)x.X, (float)x.Y)).ToArray();
                    using var path = new System.Drawing.Drawing2D.GraphicsPath();
                    var g_pts = new List<PointF>();
                    foreach (var pt in pts)
                    {
                        var x = pt.X;
                        var y = pt.Y;
                        var c_pt = _diagram.DiagramToPoint(x, y, _axis_x_flow, _axis_y_head);
                        g_pts.Add(new PointF(c_pt.Point.X, c_pt.Point.Y));
                    }
                    path.AddCurve(g_pts.ToArray());
                    dxArgs.Cache.DrawPath(pen, path);
                    DrawEquipPoint(dxArgs.Cache, pen, _current_equip_sect_pt, _operation_vm.CurrentCurveQE, _operation_vm.CurrentCurveQP);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void DrawEquip(GraphicsCache cache, Yw.Geometry.CubicSpline2d qh, Yw.Geometry.CubicSpline2d qe, Yw.Geometry.CubicSpline2d qp,Yw.Geometry.Point2d sect_pt)
        private void DrawEquipPoint(GraphicsCache cache,Pen pen, Yw.Geometry.Point2d qh_sect_pt, Yw.Geometry.CubicSpline2d qe, Yw.Geometry.CubicSpline2d qp)
        {
            using Pen pen = new(Color.Black, 2);
            pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
            if (qh_sect_pt == null)
                return;
            var offset_size = 10;
            var qh_x = qh_sect_pt.X;
            var qh_pt = _diagram.DiagramToPoint(qh_sect_pt.X, qh_sect_pt.Y, _axis_x_flow, _axis_y_head);
            var dg_pt = _diagram.DiagramToPoint(sect_pt.X, sect_pt.Y, _axis_x_flow, _axis_y_head);
            cache.DrawLine(pen, new Point((int)dg_pt.Point.X, (int)dg_pt.Point.Y - 10), new Point((int)dg_pt.Point.X, (int)dg_pt.Point.Y + 10));
            if (_qe_visible)
            var qh_pt_x = qh_pt.Point.X;
            var qh_pt_y = qh_pt.Point.Y;
            cache.DrawLine(pen, new Point(qh_pt_x, qh_pt_y - offset_size), new Point(qh_pt_x, qh_pt_y + offset_size));
            if (qe != null && _qe_visible)
            {
                var y_qe = _operation_vm.QeCalc.GetPointY(sect_pt.X);
                var c_pt_qe = _diagram.DiagramToPoint(sect_pt.X, y_qe, _axis_x_flow, _axis_y_eff);
                cache.DrawLine(pen, new Point((int)c_pt_qe.Point.X, (int)c_pt_qe.Point.Y - 10), new Point((int)c_pt_qe.Point.X, (int)c_pt_qe.Point.Y + 10));
                var qe_y = qe.GetPointY(qh_x);
                var qe_pt = _diagram.DiagramToPoint(qh_x, qe_y, _axis_x_flow, _axis_y_eff);
                var qe_pt_x = qe_pt.Point.X;
                var qe_pt_y = qe_pt.Point.Y;
                cache.DrawLine(pen, new Point(qe_pt_x, qe_pt_y - offset_size), new Point(qe_pt_x, qe_pt_y + offset_size));
            }
            if (_qp_visible)
            if (qp != null && _qp_visible)
            {
                var y_qp = _operation_vm.QpCalc.GetPointY(sect_pt.X);
                var c_pt_qp = _diagram.DiagramToPoint(sect_pt.X, y_qp, _axis_x_flow, _axis_y_power);
                cache.DrawLine(pen, new Point((int)c_pt_qp.Point.X, (int)c_pt_qp.Point.Y - 10), new Point((int)c_pt_qp.Point.X, (int)c_pt_qp.Point.Y + 10));
                var qp_y = qe.GetPointY(qh_x);
                var qp_pt = _diagram.DiagramToPoint(qh_x, qp_y, _axis_x_flow, _axis_y_power);
                var qp_pt_x = qp_pt.Point.X;
                var qp_pt_y = qp_pt.Point.Y;
                cache.DrawLine(pen, new Point(qp_pt_x, qp_pt_y - offset_size), new Point(qp_pt_x, qp_pt_y + offset_size));
            }
        }
        /// <summary>
@@ -270,8 +221,7 @@
        public void InitialChartData()
        {
            _initial_data = false;
            _coordinate = null;
            _coordinate = null;
            UpdateChart(false);
        }
@@ -295,8 +245,10 @@
        /// </summary> 
        public void SetDesignPoint(double x, double y, double? start_head = null)
        {
            _equip_pt = new Geometry.Point2d(x, y);
            _equip_line = null;
            _equip_sect_pt = null;
            _current_equip_sect_pt = null;
            if (_operation_vm == null)
            {
                this.DesignPointChangedEvent?.Invoke(null);
@@ -304,53 +256,84 @@
            }
            start_head ??= _coordinate.DispMinH();
            var equip_line = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurrentCurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d sect_pt);
            if (equip_line == null || sect_pt == null)
            var equip_line_reated = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d sect_pt_rated);
            if (equip_line_reated == null || sect_pt_rated == null)
                return;
            _equip_line = equip_line;
            _equip_sect_pt = sect_pt;
            _equip_line = equip_line_reated;
            _equip_sect_pt = sect_pt_rated;
            double flow_rated = 0, head_rated = 0;
            double? eff_rated = null, power_rated = null;
            flow_rated = sect_pt_rated.X;
            head_rated = _operation_vm.CurveQH.GetPointY(flow_rated);
            if (_operation_vm.CurveQP != null)
            {
                power_rated = _operation_vm.CurveQP.GetPointY(flow_rated);
                eff_rated = PumpCalcHelper.CalculateE(flow_rated, head_rated, power_rated.Value);
            }
            else if (_operation_vm.CurveQE != null)
            {
                eff_rated = _operation_vm.CurveQE.GetPointY(flow_rated);
                power_rated = PumpCalcHelper.CalculateP(flow_rated, head_rated, eff_rated.Value);
            }
            var design_pt_list = new List<PumpDesignPointViewModel>();
            double flow = 0, head = 0;
            double? eff = null, power = null;
            flow = sect_pt.X;
            head = _operation_vm.CurrentCurveQH.GetPointY(flow);
            var design_pt_rated = new PumpDesignPointViewModel();
            design_pt_rated.Id = _operation_vm.Id + "额定";
            design_pt_rated.Name = _operation_vm.Name+"(额定)";
            design_pt_rated.Q = flow_rated;
            design_pt_rated.H = head_rated;
            design_pt_rated.E = eff_rated;
            design_pt_rated.P = power_rated;
            design_pt_rated.Hz = _operation_vm.RatedHz;
            design_pt_rated.N = _operation_vm.RatedN;
            design_pt_list.Add(design_pt_rated);
            if (_operation_vm.CurrentCurveQP != null)
            if (_operation_vm.CurrentStatus)
            {
                power = _operation_vm.CurrentCurveQP.GetPointY(flow);
                eff = PumpCalcHelper.CalculateE(flow, head, power.Value);
            }
            else if (_operation_vm.CurrentCurveQE != null)
            {
                eff = _operation_vm.CurrentCurveQE.GetPointY(flow);
                power = PumpCalcHelper.CalculateP(flow, head, eff.Value);
            }
                var equip_line = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurrentCurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d sect_pt);
                if (equip_line == null || sect_pt == null)
                    return;
                double flow = 0, head = 0;
                double? eff = null, power = null;
                flow = sect_pt.X;
                head = _operation_vm.CurrentCurveQH.GetPointY(flow);
                if (_operation_vm.CurrentCurveQP != null)
                {
                    power = _operation_vm.CurrentCurveQP.GetPointY(flow);
                    eff = PumpCalcHelper.CalculateE(flow, head, power.Value);
                }
                else if (_operation_vm.CurrentCurveQE != null)
                {
                    eff = _operation_vm.CurrentCurveQE.GetPointY(flow);
                    power = PumpCalcHelper.CalculateP(flow, head, eff.Value);
                }
            var design_pt = new PumpDesignPointViewModel();
            design_pt.Id = vm.Id;
            design_pt.Q = flow;
            design_pt.H = head;
            design_pt.E = eff;
            design_pt.P = power;
            design_pt.Hz = vm.CurrentHz;
            design_pt.N = vm.CurrentN;
            design_pt_list.Add(design_pt);
                var design_pt = new PumpDesignPointViewModel();
                design_pt.Id = _operation_vm.Id;
                design_pt.Name = _operation_vm.Name;
                design_pt.Q = flow;
                design_pt.H = head;
                design_pt.E = eff;
                design_pt.P = power;
                design_pt.Hz = _operation_vm.CurrentHz;
                design_pt.N = _operation_vm.CurrentN;
                design_pt_list.Add(design_pt);
            }
            this.DesignPointChangedEvent?.Invoke(design_pt_list);
            UpdateChart(true);
        }
        /// <summary>
        /// 删除曲线
        /// </summary> 
        public void Clear()
        {
            _vm_list = new List<PumpParallelViewModel>();
        {
            _initial_data = false;
            UpdateChart(true);
        }
@@ -377,8 +360,7 @@
            UpdateChart(true);
            _initial_data = false;
        }
        /// <summary>
        /// 更新图表
@@ -443,10 +425,10 @@
            double _scaleMinH = 1, _scaleMaxH = 1; 
            {
                var qh_pt_list = _operation_vm.Qh.GetPointList();
                if (_operation_vm.RunStatus)
                var qh_pt_list = _operation_vm.CurveQH.GetPointList();
                if (_operation_vm.CurrentStatus)
                { 
                    qh_pt_list.AddRange(_operation_vm.QhCalc.GetPointList());
                    qh_pt_list.AddRange(_operation_vm.CurrentCurveQH.GetPointList());
                }
                var xxx = qh_pt_list.Select(x => x.X);
@@ -456,36 +438,33 @@
                _max_flow = Math.Max(_max_flow, xxx.Max());
                _min_head = Math.Min(_min_head, yyy.Min());
                _max_head = Math.Max(_max_head, yyy.Max());
                _max_head = Math.Max(_max_head, yyy.Max());
            }
            if (_operation_vm.Qe != null)
            if (_operation_vm.CurveQE != null)
            {
                var yyy = _operation_vm.Qe.GetPointList().Select(x => x.Y).ToList();
                if (_operation_vm.RunStatus)
                var yyy = _operation_vm.CurveQE.GetPointList().Select(x => x.Y).ToList();
                if (_operation_vm.CurrentStatus)
                {
                    yyy.AddRange(_operation_vm.QeCalc.GetPointList().Select(x => x.Y));
                    yyy.AddRange(_operation_vm.CurrentCurveQE.GetPointList().Select(x => x.Y));
                }
                _min_eff = Math.Min(_min_eff, yyy.Min());
                _max_eff = Math.Max(_max_eff, yyy.Max());
            }
            if (_operation_vm.Qp != null)
            if (_operation_vm.CurveQP != null)
            {
                var yyy = _operation_vm.Qp.GetPointList().Select(x => x.Y).ToList();
                if (_operation_vm.RunStatus)
                var yyy = _operation_vm.CurveQP.GetPointList().Select(x => x.Y).ToList();
                if (_operation_vm.CurrentStatus)
                {
                    yyy.AddRange(_operation_vm.QpCalc.GetPointList().Select(x => x.Y));
                    yyy.AddRange(_operation_vm.CurrentCurveQP.GetPointList().Select(x => x.Y));
                }
                _min_power = Math.Min(_min_power, yyy.Min());
                _max_power = Math.Max(_max_power, yyy.Max());
            }
            _coordinate = PumpCoordinate.CalcCoordinate(_min_flow,
                                                                         _max_flow,
@@ -638,7 +617,7 @@
            if (_operation_vm!=null)
            {
                CreateRatedLineSeries(_operation_vm);
                if (_operation_vm.RunStatus)
                if (_operation_vm.CurrentStatus)
                {
                    CreateWorkingLineSeries(_operation_vm);
                }
@@ -662,7 +641,7 @@
        /// <summary>
        /// 计算工作点
        /// </summary> 
        public void CalcWorkPointByQ(double? work_flow = null)
        public void CalcWorkPointByQ(double? x_flow = null)
        {
            if (!_line_visible)
            {
@@ -680,33 +659,33 @@
            if (_operation_vm == null)
                return;
            Yw.Geometry.CubicSpline2d qh=null, qe = null, qp = null;
            Yw.Geometry.CubicSpline2d qh = null, qe = null, qp = null;
            if (_operation_vm.RunStatus)
            if (_operation_vm.CurrentStatus)
            {
                work_flow ??= _operation_vm.WorkPoint?.X ?? _operation_vm.QhCalc.MaxX / 3 * 2;
                if (work_flow < _operation_vm.QhCalc.MinX || work_flow > _operation_vm.QhCalc.MaxX)
                x_flow ??= _current_equip_sect_pt?.X ?? _operation_vm.CurrentCurveQH.MaxX / 3 * 2;
                if (x_flow < _operation_vm.CurrentCurveQH.MinX || x_flow > _operation_vm.CurrentCurveQH.MaxX)
                    return;
                qh = _operation_vm.QhCalc;
                qe = _operation_vm.QeCalc;
                qp = _operation_vm.QpCalc;
                qh = _operation_vm.CurrentCurveQH;
                qe = _operation_vm.CurrentCurveQE;
                qp = _operation_vm.CurrentCurveQP;
            }
            else
            {
                work_flow ??= _operation_vm.WorkPoint?.X ?? _operation_vm.Qh.MaxX / 3 * 2;
                if (work_flow < _operation_vm.Qh.MinX || work_flow > _operation_vm.Qh.MaxX)
                x_flow ??= _equip_sect_pt?.X ?? _operation_vm.CurveQH.MaxX / 3 * 2;
                if (x_flow < _operation_vm.CurveQH.MinX || x_flow > _operation_vm.CurveQH.MaxX)
                    return;
                qh = _operation_vm.Qh;
                qe = _operation_vm.Qe;
                qp = _operation_vm.Qp;
                qh = _operation_vm.CurveQH;
                qe = _operation_vm.CurveQE;
                qp = _operation_vm.CurveQP;
            }
            _anno_txt_query_info.Visible = true;
            var work_pt = new PumpQueryPointViewModel();
            work_pt.Q = work_flow.Value;
            work_pt.H = qh.GetPointY(work_flow.Value);
            work_pt.Q = x_flow.Value;
            work_pt.H = qh.GetPointY(x_flow.Value);
            var work_info_str_builder = new StringBuilder();
            work_info_str_builder.AppendLine($"流量:{work_pt.Q.ToString("N1")} ");
@@ -733,9 +712,10 @@
            _anno_txt_query_info.Text = work_info_str_builder.ToString();
            _anno_txt_query_info.AutoSize = true;
            _query_flow_line.AxisValue = work_flow;
            _query_flow_line.Title.Text = work_flow.Value.ToString("N1");
            _query_flow_line.AxisValue = x_flow;
            _query_flow_line.Title.Text = x_flow.Value.ToString("N1");
        }
        /// <summary>
        /// 创建额定线系列
@@ -757,7 +737,7 @@
            series_qh_view.LineStyle.Thickness = 2;
            series_qh_view.LineStyle.DashStyle = DashStyle.Dash;
            series_qh_view.LineStyle.LineJoin = System.Drawing.Drawing2D.LineJoin.MiterClipped;
            series_qh_view.Color = vm.Color;
            series_qh_view.Color = Perform2dChartDisplay.CurveColorQH;
            series_qh_view.EnableAntialiasing = DefaultBoolean.True;
            series_qh.SeriesPointsSorting = SortingMode.None;
@@ -765,7 +745,7 @@
            series_qh.View = series_qh_view;
            series_qh.Visible = true;
            var pt_qh_list = vm.Qh.GetPointList(12);
            var pt_qh_list = vm.CurveQH.GetPointList(12);
            for (int i = 0; i < pt_qh_list.Count; i++)
            {
                series_qh.Points.Add(new SeriesPoint(pt_qh_list[i].X, new double[] { pt_qh_list[i].Y }));
@@ -787,7 +767,7 @@
            txt_qh.AutoHeight = true;
            txt_qh.AutoWidth = true;
            txt_qh.BackColor = System.Drawing.Color.Transparent;
            txt_qh.Border.Color = vm.Color;
            txt_qh.Border.Color = Perform2dChartDisplay.CurveColorQH;
            txt_qh.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.Line;
            txt_qh.DXFont = Perform2dChartDisplay.AnnoFontQH;
            txt_qh.Name = _tag_qh + vm.Id.ToString();
@@ -799,14 +779,14 @@
            txt_qh.RuntimeMoving = true;
            txt_qh.RuntimeResizing = false;
            txt_qh.RuntimeRotation = false;
            txt_qh.Text = $"{vm.RatedSpeed}(50hz)";
            txt_qh.TextColor = vm.Color;
            txt_qh.Text = vm.Name;
            txt_qh.TextColor = Perform2dChartDisplay.CurveColorQH;
            txt_qh.ShapePosition = position_qh;
            txt_qh.Visible = _line_name_visible;
            this.chartControl1.AnnotationRepository.Add(txt_qh);
            this.chartControl1.Series.Add(series_qh);
            if (vm.Qe != null)
            if (vm.CurveQE != null)
            {
                var series_qe = new DevExpress.XtraCharts.Series();
                series_qe.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
@@ -820,7 +800,7 @@
                series_qe_view.LineStyle.Thickness = 2;
                series_qe_view.LineStyle.DashStyle = DashStyle.Dash;
                series_qe_view.LineStyle.LineJoin = System.Drawing.Drawing2D.LineJoin.MiterClipped;
                series_qe_view.Color = vm.Color;
                series_qe_view.Color = Perform2dChartDisplay.CurveColorQE;
                series_qe_view.AxisY = _axis_y_eff;
                series_qe_view.Pane = _default_pane;
                series_qe_view.EnableAntialiasing = DefaultBoolean.True;
@@ -831,7 +811,7 @@
                series_qe.Visible = _qe_visible;
                var pt_qe_list = vm.Qe.GetPointList(12);
                var pt_qe_list = vm.CurveQE.GetPointList(12);
                for (int i = 0; i < pt_qe_list.Count; i++)
                {
                    series_qe.Points.Add(new SeriesPoint(pt_qe_list[i].X, new double[] { pt_qe_list[i].Y }));
@@ -840,7 +820,7 @@
                this.chartControl1.Series.Add(series_qe);
            }
            if (vm.Qp != null)
            if (vm.CurveQP != null)
            {
                var series_qp = new DevExpress.XtraCharts.Series();
                series_qp.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
@@ -854,7 +834,7 @@
                series_qp_view.LineStyle.Thickness = 2;
                series_qp_view.LineStyle.DashStyle = DashStyle.Dash;
                series_qp_view.LineStyle.LineJoin = System.Drawing.Drawing2D.LineJoin.MiterClipped;
                series_qp_view.Color = vm.Color;
                series_qp_view.Color = Perform2dChartDisplay.CurveColorQP;
                series_qp_view.AxisY = _axis_y_power;
                series_qp_view.Pane = _bottom_pane;
                series_qp_view.EnableAntialiasing = DefaultBoolean.True;
@@ -864,7 +844,7 @@
                series_qp.View = series_qp_view;
                series_qp.Visible = _qp_visible;
                var pt_qp_list = vm.Qp.GetPointList(12);
                var pt_qp_list = vm.CurveQP.GetPointList(12);
                for (int i = 0; i < pt_qp_list.Count; i++)
                {
                    series_qp.Points.Add(new SeriesPoint(pt_qp_list[i].X, new double[] { pt_qp_list[i].Y }));
@@ -892,7 +872,7 @@
            var series_qh_view = new DevExpress.XtraCharts.SplineSeriesView();
            series_qh_view.LineStyle.Thickness = 2;
            series_qh_view.Color = vm.Color;
            series_qh_view.Color = Perform2dChartDisplay.CurveColorQH;
            series_qh_view.EnableAntialiasing = DefaultBoolean.True;
            series_qh_view.LineTensionPercent = 50;
@@ -901,7 +881,7 @@
            series_qh.View = series_qh_view;
            series_qh.Visible = true;
            var pt_qh_list = vm.QhCalc.GetPointList(12);
            var pt_qh_list = vm.CurrentCurveQH.GetPointList(12);
            for (int i = 0; i < pt_qh_list.Count; i++)
            {
                series_qh.Points.Add(new SeriesPoint(pt_qh_list[i].X, new double[] { pt_qh_list[i].Y }));
@@ -923,7 +903,7 @@
            txt_qh.AutoHeight = true;
            txt_qh.AutoWidth = true;
            txt_qh.BackColor = System.Drawing.Color.Transparent;
            txt_qh.Border.Color = vm.Color;
            txt_qh.Border.Color = Perform2dChartDisplay.CurveColorQH;
            txt_qh.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.Line;
            txt_qh.DXFont = Perform2dChartDisplay.AnnoFontQH;
            txt_qh.Name = _tag_qh + vm.Id.ToString();
@@ -936,13 +916,13 @@
            txt_qh.RuntimeResizing = false;
            txt_qh.RuntimeRotation = false;
            txt_qh.Text = vm.Name;
            txt_qh.TextColor = vm.Color;
            txt_qh.TextColor = Perform2dChartDisplay.CurveColorQH;
            txt_qh.ShapePosition = position_qh;
            txt_qh.Visible = _line_name_visible;
            this.chartControl1.AnnotationRepository.Add(txt_qh);
            this.chartControl1.Series.Add(series_qh);
            if (vm.QeCalc != null)
            if (vm.CurrentCurveQE != null)
            {
                var series_qe = new DevExpress.XtraCharts.Series();
                series_qe.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
@@ -954,7 +934,7 @@
                var series_qe_view = new DevExpress.XtraCharts.SplineSeriesView();
                series_qe_view.LineStyle.Thickness = 2;
                series_qe_view.Color = vm.Color;
                series_qe_view.Color = Perform2dChartDisplay.CurveColorQE;
                series_qe_view.AxisY = _axis_y_eff;
                series_qe_view.Pane = _default_pane;
                series_qe_view.EnableAntialiasing = DefaultBoolean.True;
@@ -965,7 +945,7 @@
                series_qe.View = series_qe_view;
                series_qe.Visible = _qe_visible;
                var pt_qe_list = vm.QeCalc.GetPointList(12);
                var pt_qe_list = vm.CurrentCurveQE.GetPointList(12);
                for (int i = 0; i < pt_qe_list.Count; i++)
                {
                    series_qe.Points.Add(new SeriesPoint(pt_qe_list[i].X, new double[] { pt_qe_list[i].Y }));
@@ -974,7 +954,7 @@
                this.chartControl1.Series.Add(series_qe);
            }
            if (vm.QpCalc != null)
            if (vm.CurrentCurveQP != null)
            {
                var series_qp = new DevExpress.XtraCharts.Series();
                series_qp.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
@@ -986,7 +966,7 @@
                var series_qp_view = new DevExpress.XtraCharts.SplineSeriesView();
                series_qp_view.LineStyle.Thickness = 2;
                series_qp_view.Color = vm.Color;
                series_qp_view.Color = Perform2dChartDisplay.CurveColorQP;
                series_qp_view.AxisY = _axis_y_power;
                series_qp_view.Pane = _bottom_pane;
                series_qp_view.EnableAntialiasing = DefaultBoolean.True;
@@ -997,7 +977,7 @@
                series_qp.View = series_qp_view;
                series_qp.Visible = _qp_visible;
                var pt_qp_list = vm.QpCalc.GetPointList(12);
                var pt_qp_list = vm.CurrentCurveQP.GetPointList(12);
                for (int i = 0; i < pt_qp_list.Count; i++)
                {
                    series_qp.Points.Add(new SeriesPoint(pt_qp_list[i].X, new double[] { pt_qp_list[i].Y }));
@@ -1253,7 +1233,7 @@
            {
                _coordinate = rhs;
                CalcChartAxis();
                this.OnCurveCoordinateChanged?.Invoke(_coordinate);
                this.CoordinateChangedEvent?.Invoke(_coordinate);
            };
            dlg.ShowDialog();
        }