public SingleGateThresholdErrorUpdateForm(int gateNo) { InitializeComponent(); this.gateNo = gateNo; labelControl_gate.Text = gateNo.ToString(); GateThresholdErrorValue gateThresholdErrorValue = GateService.getInstance().getGateThresholdError(gateNo); //为空就是默认值 if (gateThresholdErrorValue == null) { textEdit_nuclearError.Text = nuclear_error_default.ToString(); textEdit_temperatureError.Text = temperature_error_default.ToString(); } else { textEdit_nuclearError.Text = gateThresholdErrorValue.nuclear_error.ToString(); textEdit_temperatureError.Text = gateThresholdErrorValue.temperature_error.ToString(); } }
/// <summary> /// 手动选中每个值后,查找对应的闸机的阈值误差并显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void checkedListBoxControl_gate_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { int index = e.Index; CheckState checkState = e.State; //如果是当前项被选中,则获取该闸机的阈值显示出来 if (selectedAllButton == false && checkState == CheckState.Checked) { GateThresholdErrorValue gateThresholdErrorValue = GateService.getInstance().getGateThresholdError(index + 1); //为空就是默认值 if (gateThresholdErrorValue == null) { textEdit_nuclearError.Text = nuclear_error_default.ToString(); textEdit_temperatureError.Text = temperature_error_default.ToString(); } else { textEdit_nuclearError.Text = gateThresholdErrorValue.nuclear_error.ToString(); textEdit_temperatureError.Text = gateThresholdErrorValue.temperature_error.ToString(); } } }