Main_Form.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. //Add code
  11. using System.IO;
  12. using System.IO.Ports;
  13. namespace RF_TRIO_PLL_ZIG
  14. {
  15. public partial class Main_Form : Form
  16. {
  17. Serial serial = new Serial(); // Uart Open
  18. Bluecell_BootProtocol bluecell_BootProtocol = new Bluecell_BootProtocol();
  19. Update_Serial file = new Update_Serial();
  20. public byte Tdd_T_Sync = 0;
  21. public Main_Form()
  22. {
  23. InitializeComponent();
  24. serial.Serial_Initialize(ref comboBox_Port);
  25. }
  26. private void Firmware_Update_Click(object sender, EventArgs e)
  27. {
  28. OpenFileDialog ofd = new OpenFileDialog();
  29. //FileDownload file = new FileDownload();
  30. if (Ascii_checkBox.Checked == true)
  31. Ascii_checkBox.Checked = false;
  32. file.ShowFileOpenDialog(ref serial, ofd);
  33. }
  34. private void Crc16_Check_Click(object sender, EventArgs e)
  35. {
  36. #if false
  37. Crc16 crc16 = new Crc16();
  38. byte[] tempdata = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,0x0A };
  39. label1.Text = crc16.CRC16_Generate(tempdata, 11).ToString();
  40. #endif
  41. this.serial.Test_Serial();
  42. }
  43. private void Button_PortOpen_Click(object sender, EventArgs e)
  44. {
  45. bool ret = false;
  46. ret = Serial_connectiondisable(serial.Serial_PortOpen(ref button_PortOpen, ref comboBox_Port));
  47. if (ret == false && timer.Enabled == false)
  48. {
  49. timer.Start(); //타이머를 발동시킨다.
  50. }
  51. else if (timer.Enabled == true)
  52. {
  53. timer.Stop(); //타이머를 멈춘다.
  54. }
  55. else
  56. {
  57. /*NOP*/
  58. }
  59. serial.Serial_Main_Form_Get(this);
  60. }
  61. private void ComboBox_Port_SelectedIndexChanged(object sender, EventArgs e)
  62. {
  63. serial.Serial_Name = comboBox_Port.SelectedItem.ToString();
  64. }
  65. private void Button_terminal_Click(object sender, EventArgs e)
  66. {
  67. serial.Serial_TerminalOpen(serial);
  68. }
  69. public bool Serial_connectiondisable(Boolean on_off)
  70. {
  71. comboBox_Port.Enabled = on_off;
  72. comboBox_baudrate.Enabled = on_off;
  73. return on_off;
  74. }
  75. private delegate void BoolSet();
  76. public void TX_Light_ON()
  77. {
  78. this.pictureBox_G_TX.Visible = true;
  79. this.pictureBox_R_TX.Visible = false;
  80. }
  81. public void TX_Light_OFF()
  82. {
  83. this.pictureBox_R_TX.Visible = true;
  84. this.pictureBox_G_TX.Visible = false;
  85. }
  86. public void RX_Light_ON()
  87. {
  88. this.pictureBox_G_RX.Visible = true;
  89. this.pictureBox_R_RX.Visible = false;
  90. }
  91. public void RX_Light_OFF()
  92. {
  93. this.pictureBox_R_RX.Visible = true;
  94. this.pictureBox_G_RX.Visible = false;
  95. }
  96. private void timer_Tick(object sender, EventArgs e)
  97. {
  98. if (this.pictureBox_G_TX.Visible == true)
  99. {
  100. TX_Light_OFF();
  101. }
  102. if (this.pictureBox_G_RX.Visible == true)
  103. {
  104. RX_Light_OFF();
  105. }
  106. }
  107. private void Main_Form_Load(object sender, EventArgs e)
  108. {
  109. pictureBox_PATH_1_8G_DL_ON.Visible = !false;
  110. pictureBox_PATH_1_8G_UL_ON.Visible = !false;
  111. pictureBox_PATH_2_1G_DL_ON.Visible = !false;
  112. pictureBox_PATH_2_1G_UL_ON.Visible = !false;
  113. pictureBox_PATH_3_5G_L_ON.Visible = !false;
  114. pictureBox_PATH_3_5G_H_ON.Visible = !false;
  115. pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = !false;
  116. pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = !false;
  117. pictureBox_PATH_3_5G_UL_ON.Visible = !false;
  118. pictureBox_PATH_3_5G_DL_ON.Visible = !false;
  119. pictureBox_PATH_1_8G_DL_OFF.Visible = false;
  120. pictureBox_PATH_1_8G_UL_OFF.Visible = false;
  121. pictureBox_PATH_2_1G_DL_OFF.Visible = false;
  122. pictureBox_PATH_2_1G_UL_OFF.Visible = false;
  123. pictureBox_PATH_3_5G_L_OFF.Visible = false;
  124. pictureBox_PATH_3_5G_H_OFF.Visible = false;
  125. pictureBox_PLL_ON_OFF_3_5G_L_OFF.Visible = false;
  126. pictureBox_PLL_ON_OFF_3_5G_H_OFF.Visible = false;
  127. pictureBox_PATH_3_5G_UL_OFF.Visible = false;
  128. pictureBox_PATH_3_5G_DL_OFF.Visible = false;
  129. pictureBox_G_RX.Visible = !false;
  130. pictureBox_G_TX.Visible = !false;
  131. }
  132. private delegate void StringSend(object label, String str);
  133. public void ADC_Voltage_Value_Set(byte[] data)
  134. {
  135. int temp_val = 0;
  136. double Volt_Calc_val = 3.3 / 4095;
  137. double ret = 0;
  138. try
  139. {
  140. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_1_8G_DL_IN_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_1_8G_DL_IN_L]);
  141. ret = temp_val * Volt_Calc_val;
  142. this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_DL_IN, ret.ToString("N2") + "V");
  143. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_1_8G_DL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_1_8G_DL_OUT_L]);
  144. ret = temp_val * Volt_Calc_val;
  145. this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_DL_OUT, ret.ToString("N2") + "V");
  146. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_1_8G_UL_IN_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_1_8G_UL_IN_L]);
  147. ret = temp_val * Volt_Calc_val;
  148. this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_UL_IN, ret.ToString("N2") + "V");
  149. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_1_8G_UL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_1_8G_UL_OUT_L]);
  150. ret = temp_val * Volt_Calc_val;
  151. this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_UL_OUT, ret.ToString("N2") + "V");
  152. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_2_1G_DL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_2_1G_DL_IN_L]);
  153. ret = temp_val * Volt_Calc_val;
  154. this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_DL_IN, ret.ToString("N2") + "V");
  155. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_2_1G_DL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_2_1G_DL_OUT_L]);
  156. ret = temp_val * Volt_Calc_val;
  157. this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_DL_OUT, ret.ToString("N2") + "V");
  158. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_2_1G_UL_IN_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_2_1G_UL_IN_L]);
  159. ret = temp_val * Volt_Calc_val;
  160. this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_UL_IN, ret.ToString("N2") + "V");
  161. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_2_1G_UL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_2_1G_UL_OUT_L]);
  162. ret = temp_val * Volt_Calc_val;
  163. this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_UL_OUT, ret.ToString("N2") + "V");
  164. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_3_5G_DL_IN_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_3_5G_DL_IN_L]);
  165. ret = temp_val * Volt_Calc_val;
  166. this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_DL_IN, ret.ToString("N2") + "V");
  167. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_3_5G_DL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_3_5G_DL_OUT_L]);
  168. ret = temp_val * Volt_Calc_val;
  169. this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_DL_OUT, ret.ToString("N2") + "V");
  170. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_3_5G_UL_IN_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_3_5G_UL_IN_L]);
  171. ret = temp_val * Volt_Calc_val;
  172. this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_UL_IN, ret.ToString("N2") + "V");
  173. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.DET_3_5G_UL_OUT_H] << 8) | (data[(int)Bluecell_TypeIndex_t.DET_3_5G_UL_OUT_L]);
  174. ret = temp_val * Volt_Calc_val;
  175. this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_UL_OUT, ret.ToString("N2") + "V");
  176. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.RFU_TEMP_H] << 8) | (data[(int)Bluecell_TypeIndex_t.RFU_TEMP_L]);
  177. ret = temp_val * Volt_Calc_val;
  178. this.Invoke(new StringSend(Label_Text_Set), label_RFU_Temp, ret.ToString("N2") + "V");
  179. temp_val = (int)(data[(int)Bluecell_TypeIndex_t._28V_DET_H] << 8) | (data[(int)Bluecell_TypeIndex_t._28V_DET_L]);
  180. ret = temp_val * Volt_Calc_val;
  181. this.Invoke(new StringSend(Label_Text_Set), label_28V_Det, ret.ToString("N2") + "V");
  182. if (IamSetting_Get() == false)
  183. {
  184. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  185. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  186. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, ret.ToString());
  187. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL2];
  188. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  189. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL2, ret.ToString());
  190. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL1];
  191. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  192. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL1, ret.ToString());
  193. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL2];
  194. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  195. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL2, ret.ToString());
  196. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL3];
  197. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  198. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL3, ret.ToString());
  199. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL4];
  200. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  201. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL4, ret.ToString());
  202. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_DL1];
  203. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  204. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_DL1, ret.ToString());
  205. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_DL2];
  206. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  207. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_DL2, ret.ToString());
  208. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL1];
  209. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  210. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL1, ret.ToString());
  211. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL2];
  212. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  213. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL2, ret.ToString());
  214. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL3];
  215. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  216. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL3, ret.ToString());
  217. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL4];
  218. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  219. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL4, ret.ToString());
  220. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_DL];
  221. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  222. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_DL, ret.ToString());
  223. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_UL];
  224. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  225. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_UL, ret.ToString());
  226. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_COM1];
  227. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  228. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM1, ret.ToString());
  229. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_COM2];
  230. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  231. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM2, ret.ToString());
  232. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_COM3];
  233. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  234. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM3, ret.ToString());
  235. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_1_8G_DL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_1_8G_DL_L];
  236. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_1_8G_DL, temp_val.ToString());
  237. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_1_8G_UL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_1_8G_UL_L];
  238. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_1_8G_UL, temp_val.ToString());
  239. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_2_1G_DL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_2_1G_DL_L];
  240. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_2_1G_DL, temp_val.ToString());
  241. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_2_1G_UL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_2_1G_UL_L];
  242. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_2_1G_UL, temp_val.ToString());
  243. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_3_5G_DL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_3_5G_DL_L];
  244. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_3_5G_DL, temp_val.ToString());
  245. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_3_5G_UL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_3_5G_UL_L];
  246. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_3_5G_UL, temp_val.ToString());
  247. /* temp_val = data[(int)Bluecell_TypeIndex_t.PLL_3_5G_DL_H] << 8 | data[(int)Bluecell_TypeIndex_t.PLL_1_8G_UL_L];
  248. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  249. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  250. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  251. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  252. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  253. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  254. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  255. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  256. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  257. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  258. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  259. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  260. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  261. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  262. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  263. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  264. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  265. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  266. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  267. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  268. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  269. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  270. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, temp_val.ToString());
  271. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  272. */
  273. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  274. // this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL2, data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL2]);
  275. }
  276. }
  277. catch { /*MessageBox.Show("What is this?");*/ }
  278. }
  279. public void ReSetting_Values(byte[] temp_buf)
  280. {
  281. this.numericUpDown_ATT_1_8G_DL1.Text = temp_buf[(byte)Bluecell_TypeIndex_t.ATT_1_8G_DL1].ToString();
  282. /*this.numericUpDown_ATT_1_8G_DL2.Text;
  283. this.numericUpDown_ATT_1_8G_UL1.Text;
  284. this.numericUpDown_ATT_1_8G_UL2.Text;
  285. this.numericUpDown_ATT_1_8G_UL3.Text;
  286. this.numericUpDown_ATT_1_8G_UL4.Text;
  287. this.numericUpDown_ATT_2_1G_DL1.Text;
  288. this.numericUpDown_ATT_2_1G_DL2.Text;
  289. this.numericUpDown_ATT_2_1G_UL1.Text;
  290. this.numericUpDown_ATT_2_1G_UL2.Text;
  291. this.numericUpDown_ATT_2_1G_UL3.Text;
  292. this.numericUpDown_ATT_2_1G_UL4.Text;
  293. this.numericUpDown_ATT_3_5G_DL.Text;
  294. this.numericUpDown_ATT_3_5G_UL.Text;
  295. this.numericUpDown_ATT_3_5G_COM1.Text;
  296. this.numericUpDown_ATT_3_5G_COM2.Text;
  297. this.numericUpDown_ATT_3_5G_COM3.Text;*/
  298. }
  299. private void Label_Text_Set(object label, String str)
  300. {
  301. Label Temp_label = (Label)label;
  302. Temp_label.Text = str;
  303. }
  304. private void numeric_Text_Set(object numeric, String str)
  305. {
  306. NumericUpDown Temp_numeric = (NumericUpDown)numeric;
  307. Temp_numeric.Text = str;
  308. }
  309. private void ATT_Enter(object sender, KeyEventArgs e)
  310. {
  311. if (e.KeyCode == Keys.Enter)
  312. {
  313. Button_Set_Click(sender, e);
  314. //to do
  315. }
  316. else
  317. {
  318. return;
  319. }
  320. }
  321. private void TDD_T_SYNC_Click(object sender, EventArgs e)
  322. {
  323. PictureBox pictureBox = (PictureBox)sender;
  324. Tdd_T_Sync = Convert.ToByte(pictureBox.Tag);
  325. bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
  326. pictureBox_TDD_T_SYNC_UL_ON.Visible = !pictureBox_TDD_T_SYNC_UL_ON.Visible;
  327. pictureBox_TDD_T_SYNC_DL_OFF.Visible = !pictureBox_TDD_T_SYNC_DL_OFF.Visible;
  328. }
  329. const byte PATH_1_8G_DL_ON = 1;
  330. const byte PATH_1_8G_DL_OFF = 2;
  331. const byte PATH_1_8G_UL_ON = 3;
  332. const byte PATH_1_8G_UL_OFF = 4;
  333. const byte PATH_2_1G_DL_ON = 5;
  334. const byte PATH_2_1G_DL_OFF = 6;
  335. const byte PATH_2_1G_UL_ON = 7;
  336. const byte PATH_2_1G_UL_OFF = 8;
  337. const byte PATH_3_5G_DL_ON = 9;
  338. const byte PATH_3_5G_DL_OFF = 10;
  339. const byte PATH_3_5G_UL_ON = 11;
  340. const byte PATH_3_5G_UL_OFF = 12;
  341. const byte PATH_3_5G_H_ON = 13;
  342. const byte PATH_3_5G_H_OFF = 14;
  343. const byte PATH_3_5G_L_ON = 15;
  344. const byte PATH_3_5G_L_OFF = 16;
  345. const byte PLL_POWER_ONOFF_3_5G_H_ON = 17;
  346. const byte PLL_POWER_ONOFF_3_5G_H_OFF = 18;
  347. const byte PLL_POWER_ONOFF_3_5G_L_ON = 19;
  348. const byte PLL_POWER_ONOFF_3_5G_L_OFF = 20;
  349. private void Power_OnOff_Set(object sender, EventArgs e)
  350. {
  351. byte temp_tag = 0;
  352. PictureBox pictureBox = (PictureBox)sender;
  353. temp_tag = Convert.ToByte(pictureBox.Tag);
  354. switch (temp_tag)
  355. {
  356. case PATH_1_8G_DL_OFF:
  357. pictureBox_PATH_1_8G_DL_ON.Visible = true;
  358. break;
  359. case PATH_1_8G_DL_ON:
  360. pictureBox_PATH_1_8G_DL_OFF.Visible = true;
  361. break;
  362. case PATH_1_8G_UL_OFF:
  363. pictureBox_PATH_1_8G_UL_ON.Visible = true;
  364. break;
  365. case PATH_1_8G_UL_ON:
  366. pictureBox_PATH_1_8G_UL_OFF.Visible = true;
  367. break;
  368. case PATH_2_1G_DL_OFF:
  369. pictureBox_PATH_2_1G_DL_ON.Visible = true;
  370. break;
  371. case PATH_2_1G_DL_ON:
  372. pictureBox_PATH_2_1G_DL_OFF.Visible = true;
  373. break;
  374. case PATH_2_1G_UL_OFF:
  375. pictureBox_PATH_2_1G_UL_ON.Visible = true;
  376. break;
  377. case PATH_2_1G_UL_ON:
  378. pictureBox_PATH_2_1G_UL_OFF.Visible = true;
  379. break;
  380. case PATH_3_5G_DL_OFF:
  381. pictureBox_PATH_3_5G_DL_ON.Visible = true;
  382. break;
  383. case PATH_3_5G_DL_ON:
  384. pictureBox_PATH_3_5G_DL_OFF.Visible = true;
  385. break;
  386. case PATH_3_5G_UL_OFF:
  387. pictureBox_PATH_3_5G_UL_ON.Visible = true;
  388. break;
  389. case PATH_3_5G_UL_ON:
  390. pictureBox_PATH_3_5G_UL_OFF.Visible = true;
  391. break;
  392. case PATH_3_5G_H_OFF:
  393. pictureBox_PATH_3_5G_H_ON.Visible = true;
  394. break;
  395. case PATH_3_5G_H_ON:
  396. pictureBox_PATH_3_5G_H_OFF.Visible = true;
  397. break;
  398. case PATH_3_5G_L_OFF:
  399. pictureBox_PATH_3_5G_L_ON.Visible = true;
  400. break;
  401. case PATH_3_5G_L_ON:
  402. pictureBox_PATH_3_5G_L_OFF.Visible = true;
  403. break;
  404. case PLL_POWER_ONOFF_3_5G_H_ON:
  405. pictureBox_PLL_ON_OFF_3_5G_H_OFF.Visible = true;
  406. break;
  407. case PLL_POWER_ONOFF_3_5G_H_OFF:
  408. pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = true;
  409. break;
  410. case PLL_POWER_ONOFF_3_5G_L_ON:
  411. pictureBox_PLL_ON_OFF_3_5G_L_OFF.Visible = true;
  412. break;
  413. case PLL_POWER_ONOFF_3_5G_L_OFF:
  414. pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = true;
  415. break;
  416. }
  417. pictureBox.Visible = !pictureBox.Visible;
  418. bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
  419. }
  420. private void button1_Click(object sender, EventArgs e)
  421. {
  422. Crc16 crc16 = new Crc16();
  423. byte[] temp_buf = new byte[6];
  424. temp_buf[0] = 0xbe;
  425. temp_buf[1] = 2;
  426. temp_buf[2] = 4;
  427. temp_buf[3] = 5;
  428. temp_buf[4] = crc16.STH30_CreateCrc(temp_buf, temp_buf[2]);
  429. temp_buf[5] = 0xeb;
  430. serial.Serial_DataSend(temp_buf, temp_buf[2] + 2);
  431. }
  432. private void Button_Set_Click(object sender, EventArgs e)
  433. {
  434. bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
  435. }
  436. private bool IamSetting = false;
  437. private void Activi_Change__Setting(object sender, EventArgs e)
  438. {
  439. IamSetting = true;
  440. }
  441. private void Activi_Change__SettingComplete(object sender, EventArgs e)
  442. {
  443. IamSetting = false;
  444. }
  445. public bool IamSetting_Get()
  446. {
  447. return IamSetting;
  448. }
  449. private void Cusor_DeFocus(object sender, EventArgs e)
  450. {
  451. GroupBox grp = (GroupBox)sender;
  452. grp.Focus();
  453. }
  454. }
  455. }