| | |
| | | public void SetBindingData(PumpRunViewViewModel vm) |
| | | { |
| | | this.pumpRunViewChart1.SetBindingData(vm); |
| | | this.barCheckE.Checked = this.pumpRunViewChart1.QEVisible; |
| | | this.barCheckP.Checked = this.pumpRunViewChart1.QPVisble; |
| | | if (vm != null && vm.Items != null) |
| | | { |
| | | var item = vm.Items.FirstOrDefault(); |
| | | 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)}%"; |
| | | } |
| | | SetCurrent(item); |
| | | } |
| | | } |
| | | |
| | | //设置当前 |
| | | private void SetCurrent(PumpRunViewItemViewModel 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 barCheckE_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | //this.pumpRunViewChart1.SetEQVisible |
| | | this.pumpRunViewChart1.QEVisible = this.barCheckE.Checked; |
| | | } |
| | | |
| | | //功率线 |
| | | private void barCheckP_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | |
| | | this.pumpRunViewChart1.QPVisble = this.barCheckP.Checked; |
| | | } |
| | | |
| | | //设置坐标轴 |