duheng
2024-12-05 6d4874f6d9c271c67d72a62f08985c71f7f8bfac
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpVariableSpeedChartDlg.cs
@@ -1,4 +1,5 @@
using Yw.Geometry;
using DevExpress.Spreadsheet;
using Yw.Geometry;
using Yw.WinFrmUI.Phart;
namespace HStation.WinFrmUI.PhartRelation
@@ -11,6 +12,7 @@
            this.Text = "曲线视图";
            this.WindowState = FormWindowState.Maximized;
            this.pumpVariableSpeedChart.SetQeVisible(false);
            this.pumpVariableSpeedInfoCtrl1.SetEvent += (id, hz, ex_ratio, qh, qe, qp) =>
            {
                this.pumpVariableSpeedChart.Set(id, hz, ex_ratio, qh, qe, qp);
@@ -44,7 +46,7 @@
            this.pumpVariableSpeedInfoCtrl1.SetDesignPointEvent += (q, h) =>
            {
                _design_pt = new Point2d(q, h);
                this.pumpVariableSpeedChart.SetDesignPt(q, h);
                this.pumpVariableSpeedChart.SetEquipPt(_design_pt);
                ResetSectPointGrid();
            };
@@ -68,27 +70,28 @@
        /// <returns></returns>
        public string SetBindingData(
            Yw.WinFrmUI.Phart.PumpVariableSpeedViewModel vm,
            Yw.Geometry.Point2d design_pt,double temp_head)
            Yw.Geometry.Point2d design_pt)
        {
            _design_pt = design_pt;
            var vm_list = new List<Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel>();
            var vm_info = new Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel(vm);
            vm_info.IsDefault = true;
            vm_info.Name = $"{vm.CurrentSpeed}({vm.CurrentHz}hz)";
            vm_info.Color = GetRandomColor(0);
            vm_info.Calc();
            vm_list.Add(vm_info);
            this.pumpVariableSpeedInfoCtrl1.SetBindingData(vm_list, _design_pt);
            this.pumpVariableSpeedChart.Add(vm_list, _design_pt, temp_head);
            this.pumpVariableSpeedChart.Add(vm_list, _design_pt);
            return string.Empty;
        }
        private void ResetSectPointGrid()
        {
            var vm_list = this.pumpVariableSpeedChart.GetList();
            var vm_list = this.pumpVariableSpeedChart.GetVmList();
            this.pumpVariableSpeedInfoCtrl1.SetSectPoint(vm_list);
        }
@@ -113,7 +116,7 @@
                }
                var vm = new PumpVariableSpeedInfoViewModel(vm_def);
                vm.Id = Guid.NewGuid().ToString();
                vm.Name = this.pumpVariableSpeedChart.LineNameShowHz ? hz.ToString() : speed.ToString();
                vm.Name = $"{speed}({hz}hz)";
                vm.Color = GetRandomColor(index);
                vm.CurrentHz = hz;
                vm.CurrentSpeed = speed;
@@ -148,7 +151,7 @@
                var speed = Math.Round(hz / 50 * vm_def.RatedSpeed);
                var vm = new PumpVariableSpeedInfoViewModel(vm_def);
                vm.Id = Guid.NewGuid().ToString();
                vm.Name = this.pumpVariableSpeedChart.LineNameShowHz ? hz.ToString() : speed.ToString();
                vm.Name = $"{speed}({hz}hz)";
                vm.Color = GetRandomColor(index);
                vm.CurrentHz = hz;
                vm.CurrentSpeed = speed;
@@ -185,7 +188,7 @@
                }
                var vm = new PumpVariableSpeedInfoViewModel(vm_def);
                vm.Id = Guid.NewGuid().ToString();
                vm.Name = this.pumpVariableSpeedChart.LineNameShowHz ? hz.ToString() : speed.ToString();
                vm.Name = $"{speed}({hz}hz)";
                vm.Color = GetRandomColor(index);
                vm.CurrentHz = hz;
                vm.CurrentSpeed = speed;