| | |
| | | { |
| | | InitializeComponent(); |
| | | this.Text = "曲线视图"; |
| | | this.WindowState = FormWindowState.Maximized; |
| | | |
| | | |
| | | this.pumpVariableSpeedInfoCtrl1.SetEvent += (id, qh, qe, qp) => |
| | | this.pumpVariableSpeedChart.SetQeVisible(false); |
| | | 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.SetEquipPt(_design_pt); |
| | | ResetSectPointGrid(); |
| | | }; |
| | | |
| | | this.pumpVariableSpeedChart.OnCalcQueryPoint += (id, pt) => |
| | | { |
| | | this.pumpVariableSpeedInfoCtrl1.SetQueryInfo(id, pt); |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private Yw.Geometry.Point2d _design_pt; |
| | | |
| | | |
| | |
| | | |
| | | 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); |
| | | |
| | | return string.Empty; |
| | | } |
| | | |
| | | |
| | | |
| | | private void ResetSectPointGrid() |
| | | { |
| | | var vm_list = this.pumpVariableSpeedChart.GetVmList(); |
| | | this.pumpVariableSpeedInfoCtrl1.SetSectPoint(vm_list); |
| | | } |
| | | |
| | | |
| | | private void AddBySpeed() |
| | | { |
| | | var list = this.pumpVariableSpeedInfoCtrl1.GetList(); |
| | |
| | | } |
| | | 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; |
| | |
| | | |
| | | } |
| | | |
| | | private void AddByHz() |
| | | private void AddByHz() |
| | | { |
| | | |
| | | var list = this.pumpVariableSpeedInfoCtrl1.GetList(); |
| | |
| | | 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; |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | private void AddByPoint() |
| | | private void AddByPoint() |
| | | { |
| | | var list = this.pumpVariableSpeedInfoCtrl1.GetList(); |
| | | if (list == null || list.Count < 1) |
| | |
| | | } |
| | | 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; |