文件名从 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.cs 修改 |
| | |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class SimulationSingleWorkingPumpCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | public partial class SimulationPumpSingleWorkingChartCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | | public SimulationSingleWorkingPumpCtrl() |
| | | public SimulationPumpSingleWorkingChartCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | this.pumpWorkingViewChart1.RunPointSelectedEvent += PumpWorkingViewChart1_RunPointSelectedEvent; |
| | | } |
| | | |
| | | private HydroWorkingVmo _working = null; |
| | |
| | | _hydroInfo = hydroInfo; |
| | | _allCalcuResultVisualDict = allCalcuResultVisualDict; |
| | | var vm = CreateViewModel(); |
| | | this.pumpWorkingViewChart1.SetBindingData(vm); |
| | | SetBindingData(vm); |
| | | } |
| | | |
| | | public void SetBindingData(PumpWorkingViewViewModel vm) |
| | | { |
| | | this.pumpWorkingViewChart1.SetBindingData(vm); |
| | | if (vm != null && vm.Items != null) |
| | | { |
| | | var item = vm.Items.FirstOrDefault(); |
| | | SetCurrent(item); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //鍒涘缓 |
| | | private PumpWorkingViewViewModel CreateViewModel() |
| | |
| | | return vm; |
| | | } |
| | | |
| | | //璁剧疆褰撳墠 |
| | | private void SetCurrent(PumpWorkingViewItemViewModel item) |
| | | { |
| | | if (item != null) |
| | | { |
| | | this.barTxtQ.EditValue = $"{Math.Round(item.Q, 1)}m鲁/h"; |
| | | this.barTxtH.EditValue = $"{Math.Round(item.H, 2)}m"; |
| | | this.barTxtP.EditValue = $"{Math.Round(item.P ?? 0, 1)}kW"; |
| | | this.barTxtE.EditValue = $"{Math.Round(item.E ?? 0, 1)}%"; |
| | | } |
| | | } |
| | | |
| | | private void PumpWorkingViewChart1_RunPointSelectedEvent(PumpWorkingViewItemViewModel obj) |
| | | { |
| | | SetCurrent(obj); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |