lixiaojun
2024-11-16 366e8053d77db67dee65a31e3510d14901f14e11
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpVariableSpeedChartDlg.cs
@@ -11,47 +11,52 @@
            InitializeComponent();
            this.Text = "曲线视图";
            this.WindowState = FormWindowState.Maximized;
            this.pumpVariableSpeedInfoCtrl1.SetEvent += (id, qh, qe, qp) =>
            this.pumpVariableSpeedInfoCtrl1.SetEvent += (id, hz, ex_ratio, qh, qe, qp) =>
            {
                this.pumpVariableSpeedChart.Set(id, qh, qe, qp);
                var list = this.pumpVariableSpeedInfoCtrl1.GetList();
                this.pumpVariableSpeedChart.Set(id,hz,ex_ratio, qh, qe, qp);
                ResetSectPointGrid();
            };
            this.pumpVariableSpeedInfoCtrl1.SetInfoEvent += (id, name, color) =>
            this.pumpVariableSpeedInfoCtrl1.SetInfoEvent += (id,  color) =>
            {
                this.pumpVariableSpeedChart.SetInfo(id, name, color);
                this.pumpVariableSpeedChart.SetInfo(id,  color);
                ResetSectPointGrid();
            };
            this.pumpVariableSpeedChart.AddBySpeedEvent += () =>
            {
                AddBySpeed();
                ResetSectPointGrid();
            };
            this.pumpVariableSpeedChart.AddByHzEvent += () =>
            {
                AddByHz();
                ResetSectPointGrid();
            };
            this.pumpVariableSpeedChart.AddByPointEvent += () =>
            {
                AddByPoint();
                ResetSectPointGrid();
            };
            this.pumpVariableSpeedInfoCtrl1.SetDesignPointEvent += (q, h) =>
            {
                _design_pt = new Point2d(q, h);
                this.pumpVariableSpeedChart.SetDesignPt(new Point2d(q, h));
                this.pumpVariableSpeedChart.SetDesignPt(q,h);
                ResetSectPointGrid();
            };
            this.pumpVariableSpeedChart.OnCalcQueryPoint += (id, pt) =>
            {
                this.pumpVariableSpeedInfoCtrl1.SetQueryInfo(id, pt);
            };
        }
        private Yw.Geometry.Point2d _design_pt;
@@ -81,7 +86,13 @@
            return string.Empty;
        }
        private void ResetSectPointGrid()
        {
            var vm_list = this.pumpVariableSpeedChart.GetList();
            this.pumpVariableSpeedInfoCtrl1.SetSectPoint(vm_list);
        }
        private void AddBySpeed()
        {
            var list = this.pumpVariableSpeedInfoCtrl1.GetList();
@@ -102,7 +113,7 @@
                }
                var vm = new PumpVariableSpeedInfoViewModel(vm_def);
                vm.Id = Guid.NewGuid().ToString();
                vm.Name =this.pumpVariableSpeedChart.LineNameShowHz?hz.ToString():speed.ToString();
                vm.Name = this.pumpVariableSpeedChart.LineNameShowHz ? hz.ToString() : speed.ToString();
                vm.Color = GetRandomColor(index);
                vm.CurrentHz = hz;
                vm.CurrentSpeed = speed;
@@ -117,7 +128,7 @@
        }
        private void  AddByHz()
        private void AddByHz()
        {
            var list = this.pumpVariableSpeedInfoCtrl1.GetList();
@@ -151,7 +162,7 @@
            dlg.ShowDialog();
        }
        private void  AddByPoint()
        private void AddByPoint()
        {
            var list = this.pumpVariableSpeedInfoCtrl1.GetList();
            if (list == null || list.Count < 1)