DeviceConfigBackendView.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Aitex.Core.RT.ConfigCenter;
  10. using Aitex.Core.RT.SCCore;
  11. namespace Aitex.Core.Backend
  12. {
  13. public partial class DeviceConfigBackendView : UserControl
  14. {
  15. public DeviceConfigBackendView()
  16. {
  17. InitializeComponent();
  18. }
  19. private void DeviceConfigBackendView_Load(object sender, EventArgs e)
  20. {
  21. btnSetHasBoostPump.Enabled = false;
  22. btnSetHasThrottleValve.Enabled = false;
  23. btnGasLine1Enable.Enabled = false;
  24. btnGasLine2Enable.Enabled = false;
  25. btnGasLine3Enable.Enabled = false;
  26. btnGasLine4Enable.Enabled = false;
  27. btnGasLine5Enable.Enabled = false;
  28. btnRfPulsingFunctionEnable.Enabled = false;
  29. ckHasBoostPump.Checked = SC.GetValue<bool>(SCName.PressureControlConfig_EnableBoosterPump);
  30. ckHasThrottleValve.Checked = SC.GetValue<bool>(SCName.PressureControlConfig_EnableThrottleValve);
  31. ckGasLine1Enable.Checked = SC.GetValue<bool>(SCName.GasLineConfig_Gas1Enable);
  32. ckGasLine2Enable.Checked = SC.GetValue<bool>(SCName.GasLineConfig_Gas2Enable);
  33. ckGasLine3Enable.Checked = SC.GetValue<bool>(SCName.GasLineConfig_Gas3Enable);
  34. ckGasLine4Enable.Checked = SC.GetValue<bool>(SCName.GasLineConfig_Gas4Enable);
  35. ckGasLine5Enable.Checked = SC.GetValue<bool>(SCName.GasLineConfig_Gas5Enable);
  36. ckRfPulsingFunctionEnable.Checked = SC.GetValue<bool>(SCName.RfConfig_EnablePulsingFunction);
  37. txtRfPowerRange.Text = SC.GetValue<double>(SCName.RfConfig_PowerRange).ToString("F1");
  38. txtRfFactor.Text = SC.GetValue<double>(SCName.RfConfig_PowerRegulationFactor).ToString("F2");
  39. txtGas1Factor.Text = SC.GetValue<double>(SCName.GasLineConfig_Gas1MfcFlowRegulationFactor).ToString("F2");
  40. txtGas2Factor.Text = SC.GetValue<double>(SCName.GasLineConfig_Gas2MfcFlowRegulationFactor).ToString("F2");
  41. txtGas3Factor.Text = SC.GetValue<double>(SCName.GasLineConfig_Gas3MfcFlowRegulationFactor).ToString("F2");
  42. txtGas4Factor.Text = SC.GetValue<double>(SCName.GasLineConfig_Gas4MfcFlowRegulationFactor).ToString("F2");
  43. txtGas5Factor.Text = SC.GetValue<double>(SCName.GasLineConfig_Gas5MfcFlowRegulationFactor).ToString("F2");
  44. }
  45. private void ckHasBoostPump_CheckedChanged(object sender, EventArgs e)
  46. {
  47. btnSetHasBoostPump.Enabled = (ckHasBoostPump.Checked != SC.GetValue<bool>(SCName.PressureControlConfig_EnableBoosterPump));
  48. }
  49. private void ckHasThrottleValve_CheckedChanged(object sender, EventArgs e)
  50. {
  51. btnSetHasThrottleValve.Enabled = (ckHasThrottleValve.Checked !=
  52. SC.GetValue<bool>(SCName.PressureControlConfig_EnableThrottleValve));
  53. }
  54. private void btnSetHasBoostPump_Click(object sender, EventArgs e)
  55. {
  56. SC.SetItemValue(SCName.PressureControlConfig_EnableBoosterPump, ckHasBoostPump.Checked ? "true" : "false");
  57. btnSetHasBoostPump.Enabled = false;
  58. }
  59. private void btnSetHasThrottleValve_Click(object sender, EventArgs e)
  60. {
  61. SC.SetItemValue(SCName.PressureControlConfig_EnableThrottleValve, ckHasThrottleValve.Checked ? "true" : "false");
  62. btnSetHasThrottleValve.Enabled = false;
  63. }
  64. private void btnGasLine1Enable_Click(object sender, EventArgs e)
  65. {
  66. SC.SetItemValue(SCName.GasLineConfig_Gas1Enable, ckGasLine1Enable.Checked ? "true" : "false");
  67. btnGasLine1Enable.Enabled = false;
  68. }
  69. private void ckGasLine1Enable_CheckedChanged(object sender, EventArgs e)
  70. {
  71. btnGasLine1Enable.Enabled = (ckGasLine1Enable.Checked != SC.GetValue<bool>(SCName.GasLineConfig_Gas1Enable));
  72. }
  73. private void ckGasLine2Enable_CheckedChanged(object sender, EventArgs e)
  74. {
  75. btnGasLine2Enable.Enabled = (ckGasLine2Enable.Checked != SC.GetValue<bool>(SCName.GasLineConfig_Gas2Enable));
  76. }
  77. private void ckGasLine3Enable_CheckedChanged(object sender, EventArgs e)
  78. {
  79. btnGasLine3Enable.Enabled = (ckGasLine3Enable.Checked != SC.GetValue<bool>(SCName.GasLineConfig_Gas3Enable));
  80. }
  81. private void ckGasLine4Enable_CheckedChanged(object sender, EventArgs e)
  82. {
  83. btnGasLine4Enable.Enabled = (ckGasLine4Enable.Checked != SC.GetValue<bool>(SCName.GasLineConfig_Gas4Enable));
  84. }
  85. private void ckGasLine5Enable_CheckedChanged(object sender, EventArgs e)
  86. {
  87. btnGasLine5Enable.Enabled = (ckGasLine5Enable.Checked != SC.GetValue<bool>(SCName.GasLineConfig_Gas5Enable));
  88. }
  89. private void ckRfPulsingFunctionEnable_CheckedChanged(object sender, EventArgs e)
  90. {
  91. btnRfPulsingFunctionEnable.Enabled = (ckRfPulsingFunctionEnable.Checked != SC.GetValue<bool>(SCName.RfConfig_EnablePulsingFunction));
  92. }
  93. private void txtRfPowerRange_TextChanged(object sender, EventArgs e)
  94. {
  95. btnRfPowerRange.Enabled = true;
  96. }
  97. private void btnRfPowerRange_Click(object sender, EventArgs e)
  98. {
  99. double value = 0.0;
  100. if (!double.TryParse(txtRfPowerRange.Text.Trim(), out value))
  101. {
  102. MessageBox.Show("Error Input value in RF power range");
  103. return;
  104. }
  105. SC.SetItemValue(SCName.RfConfig_PowerRange, value);
  106. btnRfPowerRange.Enabled = false;
  107. }
  108. private void btnGasLine2Enable_Click(object sender, EventArgs e)
  109. {
  110. SC.SetItemValue(SCName.GasLineConfig_Gas2Enable, ckGasLine2Enable.Checked ? "true" : "false");
  111. btnGasLine2Enable.Enabled = false;
  112. }
  113. private void btnGasLine3Enable_Click(object sender, EventArgs e)
  114. {
  115. SC.SetItemValue(SCName.GasLineConfig_Gas3Enable, ckGasLine3Enable.Checked ? "true" : "false");
  116. btnGasLine3Enable.Enabled = false;
  117. }
  118. private void btnGasLine4Enable_Click(object sender, EventArgs e)
  119. {
  120. SC.SetItemValue(SCName.GasLineConfig_Gas4Enable, ckGasLine4Enable.Checked ? "true" : "false");
  121. btnGasLine4Enable.Enabled = false;
  122. }
  123. private void btnGasLine5Enable_Click(object sender, EventArgs e)
  124. {
  125. SC.SetItemValue(SCName.GasLineConfig_Gas5Enable, ckGasLine5Enable.Checked ? "true" : "false");
  126. btnGasLine5Enable.Enabled = false;
  127. }
  128. private void btnRfPulsingFunctionEnable_Click(object sender, EventArgs e)
  129. {
  130. SC.SetItemValue(SCName.RfConfig_EnablePulsingFunction, ckRfPulsingFunctionEnable.Checked ? "true" : "false");
  131. btnRfPulsingFunctionEnable.Enabled = false;
  132. }
  133. private void btnRfFactor_Click(object sender, EventArgs e)
  134. {
  135. double value = 0.0;
  136. if (!double.TryParse(txtRfFactor.Text.Trim(), out value))
  137. {
  138. MessageBox.Show("Error Input value in RF regulation factor");
  139. return;
  140. }
  141. SC.SetItemValue(SCName.RfConfig_PowerRegulationFactor, value);
  142. }
  143. private void btnGas1Factor_Click(object sender, EventArgs e)
  144. {
  145. double value = 0.0;
  146. if (!double.TryParse(txtGas1Factor.Text.Trim(), out value))
  147. {
  148. MessageBox.Show("Error Input value in mfc 1 flow regulation factor");
  149. return;
  150. }
  151. SC.SetItemValue(SCName.GasLineConfig_Gas1MfcFlowRegulationFactor, value);
  152. }
  153. private void btnGas2Factor_Click(object sender, EventArgs e)
  154. {
  155. double value = 0.0;
  156. if (!double.TryParse(txtGas2Factor.Text.Trim(), out value))
  157. {
  158. MessageBox.Show("Error Input value in mfc 2 flow regulation factor");
  159. return;
  160. }
  161. SC.SetItemValue(SCName.GasLineConfig_Gas2MfcFlowRegulationFactor, value);
  162. }
  163. private void btnGas3Factor_Click(object sender, EventArgs e)
  164. {
  165. double value = 0.0;
  166. if (!double.TryParse(txtGas3Factor.Text.Trim(), out value))
  167. {
  168. MessageBox.Show("Error Input value in mfc 3 flow regulation factor");
  169. return;
  170. }
  171. SC.SetItemValue(SCName.GasLineConfig_Gas3MfcFlowRegulationFactor, value);
  172. }
  173. private void btnGas4Factor_Click(object sender, EventArgs e)
  174. {
  175. double value = 0.0;
  176. if (!double.TryParse(txtGas4Factor.Text.Trim(), out value))
  177. {
  178. MessageBox.Show("Error Input value in mfc 4 flow regulation factor");
  179. return;
  180. }
  181. SC.SetItemValue(SCName.GasLineConfig_Gas4MfcFlowRegulationFactor, value);
  182. }
  183. private void btnGas5Factor_Click(object sender, EventArgs e)
  184. {
  185. double value = 0.0;
  186. if (!double.TryParse(txtGas5Factor.Text.Trim(), out value))
  187. {
  188. MessageBox.Show("Error Input value in mfc 5 flow regulation factor");
  189. return;
  190. }
  191. SC.SetItemValue(SCName.GasLineConfig_Gas5MfcFlowRegulationFactor, value);
  192. }
  193. private void txtRfFactor_TextChanged(object sender, EventArgs e)
  194. {
  195. }
  196. private void txtGas1Factor_TextChanged(object sender, EventArgs e)
  197. {
  198. }
  199. private void txtGas2Factor_TextChanged(object sender, EventArgs e)
  200. {
  201. }
  202. private void txtGas3Factor_TextChanged(object sender, EventArgs e)
  203. {
  204. }
  205. private void txtGas4Factor_TextChanged(object sender, EventArgs e)
  206. {
  207. }
  208. private void txtGas5Factor_TextChanged(object sender, EventArgs e)
  209. {
  210. }
  211. }
  212. }