Shuxia Ning
2024-12-02 a2f11a5e60bb577fb793949191793a59953e236b
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpSerialParallelChartDlg.cs
@@ -8,6 +8,7 @@
        {
            InitializeComponent();
            this.Text = "曲线视图";
            this.WindowState = FormWindowState.Maximized;
            this.pumpSerialParallelInfoCtrl1.SetEvent += (id, qh, qe, qp) =>
            {
@@ -18,26 +19,24 @@
            this.pumpSerialParallelInfoCtrl1.SetInfoEvent += (id, name, color) =>
            {
                this.pumpSerialParallelChart.SetInfo(id, name, color);
                this.pumpSerialParallelChart.Set(id, name, color);
            };
            this.pumpSerialParallelInfoCtrl1.SetDesignPointEvent += (q, h) =>
            {
                _design_pt = new Point2d(q, h);
                this.pumpSerialParallelChart.SetDesignPt(new Point2d(q, h));
                this.pumpSerialParallelChart.SetDesignPoint(new Point2d(q, h));
            };
            this.pumpSerialParallelChart.OnCalcQueryPoint += (id, pt) =>
            this.pumpSerialParallelChart.QueryPointChangedEvent += (id, pt) =>
            {
                this.pumpSerialParallelInfoCtrl1.SetQueryInfo(id, pt);
            };
        }
        private string _serial_parallel_id= "serial_parallel";
        private string _serial_parallel_id = "serial_parallel";
        private Yw.Geometry.Point2d _design_pt;
        private bool _is_parallel;
        /// <summary>
        /// 设置
@@ -47,7 +46,7 @@
        /// <param name="is_parallel"></param>
        /// <returns></returns>
        public string SetBindingData(
            List<Yw.WinFrmUI.Phart.PumpSerialParallelViewModel> list,
            List<Yw.WinFrmUI.Phart.PumpParallelViewModel> list,
            Yw.Geometry.Point2d design_pt,
            bool is_parallel = true)
        {
@@ -91,7 +90,7 @@
                return "无法计算串并联曲线!";
            }
            var qh = vm_serial_parallel.Qh;
            var qh = vm_serial_parallel.CurveQH;
            var min_h = qh.GetPointY(qh.MinX);
            var max_h = qh.GetPointY(qh.MaxX);
            if (design_pt != null)
@@ -155,15 +154,15 @@
            var vm_sp = new Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel();
            vm_sp.Id = _serial_parallel_id;
            vm_sp.Name = line_name;
            vm_sp.Qh = new Yw.Geometry.CubicSpline2d(calc_pt_qh_list);
            vm_sp.Qe = new Yw.Geometry.CubicSpline2d(calc_pt_qe_list);
            vm_sp.Qp = new Yw.Geometry.CubicSpline2d(calc_pt_qp_list);
            vm_sp.QhCalc = vm_sp.Qh;
            vm_sp.QeCalc = vm_sp.Qe;
            vm_sp.QpCalc = vm_sp.Qp;
            vm_sp.CurveQH = new Yw.Geometry.CubicSpline2d(calc_pt_qh_list);
            vm_sp.CurveQE = new Yw.Geometry.CubicSpline2d(calc_pt_qe_list);
            vm_sp.CurveQP = new Yw.Geometry.CubicSpline2d(calc_pt_qp_list);
            vm_sp.QhCalc = vm_sp.CurveQH;
            vm_sp.QeCalc = vm_sp.CurveQE;
            vm_sp.QpCalc = vm_sp.CurveQP;
            vm_sp.Color = Color.Black;
            vm_sp.IsBp = true;
            vm_sp.IsSerialParallel = true;
            vm_sp.IsDefault = true;
            return vm_sp;
        }