using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using Aitex.Core.RT.ConfigCenter; using Aitex.Core.RT.SCCore; namespace Aitex.Core.Backend { public partial class DeviceConfigBackendView : UserControl { public DeviceConfigBackendView() { InitializeComponent(); } private void DeviceConfigBackendView_Load(object sender, EventArgs e) { btnSetHasBoostPump.Enabled = false; btnSetHasThrottleValve.Enabled = false; btnGasLine1Enable.Enabled = false; btnGasLine2Enable.Enabled = false; btnGasLine3Enable.Enabled = false; btnGasLine4Enable.Enabled = false; btnGasLine5Enable.Enabled = false; btnRfPulsingFunctionEnable.Enabled = false; ckHasBoostPump.Checked = SC.GetValue(SCName.PressureControlConfig_EnableBoosterPump); ckHasThrottleValve.Checked = SC.GetValue(SCName.PressureControlConfig_EnableThrottleValve); ckGasLine1Enable.Checked = SC.GetValue(SCName.GasLineConfig_Gas1Enable); ckGasLine2Enable.Checked = SC.GetValue(SCName.GasLineConfig_Gas2Enable); ckGasLine3Enable.Checked = SC.GetValue(SCName.GasLineConfig_Gas3Enable); ckGasLine4Enable.Checked = SC.GetValue(SCName.GasLineConfig_Gas4Enable); ckGasLine5Enable.Checked = SC.GetValue(SCName.GasLineConfig_Gas5Enable); ckRfPulsingFunctionEnable.Checked = SC.GetValue(SCName.RfConfig_EnablePulsingFunction); txtRfPowerRange.Text = SC.GetValue(SCName.RfConfig_PowerRange).ToString("F1"); txtRfFactor.Text = SC.GetValue(SCName.RfConfig_PowerRegulationFactor).ToString("F2"); txtGas1Factor.Text = SC.GetValue(SCName.GasLineConfig_Gas1MfcFlowRegulationFactor).ToString("F2"); txtGas2Factor.Text = SC.GetValue(SCName.GasLineConfig_Gas2MfcFlowRegulationFactor).ToString("F2"); txtGas3Factor.Text = SC.GetValue(SCName.GasLineConfig_Gas3MfcFlowRegulationFactor).ToString("F2"); txtGas4Factor.Text = SC.GetValue(SCName.GasLineConfig_Gas4MfcFlowRegulationFactor).ToString("F2"); txtGas5Factor.Text = SC.GetValue(SCName.GasLineConfig_Gas5MfcFlowRegulationFactor).ToString("F2"); } private void ckHasBoostPump_CheckedChanged(object sender, EventArgs e) { btnSetHasBoostPump.Enabled = (ckHasBoostPump.Checked != SC.GetValue(SCName.PressureControlConfig_EnableBoosterPump)); } private void ckHasThrottleValve_CheckedChanged(object sender, EventArgs e) { btnSetHasThrottleValve.Enabled = (ckHasThrottleValve.Checked != SC.GetValue(SCName.PressureControlConfig_EnableThrottleValve)); } private void btnSetHasBoostPump_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.PressureControlConfig_EnableBoosterPump, ckHasBoostPump.Checked ? "true" : "false"); btnSetHasBoostPump.Enabled = false; } private void btnSetHasThrottleValve_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.PressureControlConfig_EnableThrottleValve, ckHasThrottleValve.Checked ? "true" : "false"); btnSetHasThrottleValve.Enabled = false; } private void btnGasLine1Enable_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.GasLineConfig_Gas1Enable, ckGasLine1Enable.Checked ? "true" : "false"); btnGasLine1Enable.Enabled = false; } private void ckGasLine1Enable_CheckedChanged(object sender, EventArgs e) { btnGasLine1Enable.Enabled = (ckGasLine1Enable.Checked != SC.GetValue(SCName.GasLineConfig_Gas1Enable)); } private void ckGasLine2Enable_CheckedChanged(object sender, EventArgs e) { btnGasLine2Enable.Enabled = (ckGasLine2Enable.Checked != SC.GetValue(SCName.GasLineConfig_Gas2Enable)); } private void ckGasLine3Enable_CheckedChanged(object sender, EventArgs e) { btnGasLine3Enable.Enabled = (ckGasLine3Enable.Checked != SC.GetValue(SCName.GasLineConfig_Gas3Enable)); } private void ckGasLine4Enable_CheckedChanged(object sender, EventArgs e) { btnGasLine4Enable.Enabled = (ckGasLine4Enable.Checked != SC.GetValue(SCName.GasLineConfig_Gas4Enable)); } private void ckGasLine5Enable_CheckedChanged(object sender, EventArgs e) { btnGasLine5Enable.Enabled = (ckGasLine5Enable.Checked != SC.GetValue(SCName.GasLineConfig_Gas5Enable)); } private void ckRfPulsingFunctionEnable_CheckedChanged(object sender, EventArgs e) { btnRfPulsingFunctionEnable.Enabled = (ckRfPulsingFunctionEnable.Checked != SC.GetValue(SCName.RfConfig_EnablePulsingFunction)); } private void txtRfPowerRange_TextChanged(object sender, EventArgs e) { btnRfPowerRange.Enabled = true; } private void btnRfPowerRange_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtRfPowerRange.Text.Trim(), out value)) { MessageBox.Show("Error Input value in RF power range"); return; } SC.SetItemValue(SCName.RfConfig_PowerRange, value); btnRfPowerRange.Enabled = false; } private void btnGasLine2Enable_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.GasLineConfig_Gas2Enable, ckGasLine2Enable.Checked ? "true" : "false"); btnGasLine2Enable.Enabled = false; } private void btnGasLine3Enable_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.GasLineConfig_Gas3Enable, ckGasLine3Enable.Checked ? "true" : "false"); btnGasLine3Enable.Enabled = false; } private void btnGasLine4Enable_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.GasLineConfig_Gas4Enable, ckGasLine4Enable.Checked ? "true" : "false"); btnGasLine4Enable.Enabled = false; } private void btnGasLine5Enable_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.GasLineConfig_Gas5Enable, ckGasLine5Enable.Checked ? "true" : "false"); btnGasLine5Enable.Enabled = false; } private void btnRfPulsingFunctionEnable_Click(object sender, EventArgs e) { SC.SetItemValue(SCName.RfConfig_EnablePulsingFunction, ckRfPulsingFunctionEnable.Checked ? "true" : "false"); btnRfPulsingFunctionEnable.Enabled = false; } private void btnRfFactor_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtRfFactor.Text.Trim(), out value)) { MessageBox.Show("Error Input value in RF regulation factor"); return; } SC.SetItemValue(SCName.RfConfig_PowerRegulationFactor, value); } private void btnGas1Factor_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtGas1Factor.Text.Trim(), out value)) { MessageBox.Show("Error Input value in mfc 1 flow regulation factor"); return; } SC.SetItemValue(SCName.GasLineConfig_Gas1MfcFlowRegulationFactor, value); } private void btnGas2Factor_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtGas2Factor.Text.Trim(), out value)) { MessageBox.Show("Error Input value in mfc 2 flow regulation factor"); return; } SC.SetItemValue(SCName.GasLineConfig_Gas2MfcFlowRegulationFactor, value); } private void btnGas3Factor_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtGas3Factor.Text.Trim(), out value)) { MessageBox.Show("Error Input value in mfc 3 flow regulation factor"); return; } SC.SetItemValue(SCName.GasLineConfig_Gas3MfcFlowRegulationFactor, value); } private void btnGas4Factor_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtGas4Factor.Text.Trim(), out value)) { MessageBox.Show("Error Input value in mfc 4 flow regulation factor"); return; } SC.SetItemValue(SCName.GasLineConfig_Gas4MfcFlowRegulationFactor, value); } private void btnGas5Factor_Click(object sender, EventArgs e) { double value = 0.0; if (!double.TryParse(txtGas5Factor.Text.Trim(), out value)) { MessageBox.Show("Error Input value in mfc 5 flow regulation factor"); return; } SC.SetItemValue(SCName.GasLineConfig_Gas5MfcFlowRegulationFactor, value); } private void txtRfFactor_TextChanged(object sender, EventArgs e) { } private void txtGas1Factor_TextChanged(object sender, EventArgs e) { } private void txtGas2Factor_TextChanged(object sender, EventArgs e) { } private void txtGas3Factor_TextChanged(object sender, EventArgs e) { } private void txtGas4Factor_TextChanged(object sender, EventArgs e) { } private void txtGas5Factor_TextChanged(object sender, EventArgs e) { } } }