Main_Form.cs 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  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. using System.Reflection;
  14. using System.Globalization;
  15. namespace RF_TRIO_PLL_ZIG
  16. {
  17. public partial class Main_Form : Form
  18. {
  19. Serial serial = new Serial(); // Uart Open
  20. Bluecell_BootProtocol bluecell_BootProtocol = new Bluecell_BootProtocol();
  21. Update_Serial file = new Update_Serial();
  22. public byte Tdd_T_Sync = 0;
  23. public Main_Form()
  24. {
  25. InitializeComponent();
  26. serial.Serial_Initialize(ref comboBox_Port);
  27. System.Version assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
  28. //DateTime buildDate = new DateTime(2000, 1, 1).AddDays(assemblyVersion.Build).AddSeconds(assemblyVersion.Revision * 2);
  29. DateTime buildDate = getBuildDateTime();
  30. this.label_Build.Text = buildDate.ToString("yyyy/MM/dd hh:mm:ss");
  31. //this.label_Build.Text = "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString();
  32. }
  33. /// <summary>
  34. /// Version Text로부터 Build된 일시를 구합니다.
  35. /// </summary>
  36. /// <returns></returns>
  37. /*public DateTime getBuildDateTime()
  38. {
  39. //1. Assembly.GetExecutingAssembly().FullName의 값은
  40. //'ApplicationName, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
  41. //와 같다.
  42. string strVersionText = Assembly.GetExecutingAssembly().FullName
  43. .Split(',')[1]
  44. .Trim()
  45. .Split('=')[1];
  46. //2. Version Text의 세번째 값(Build Number)은 2000년 1월 1일부터
  47. //Build된 날짜까지의 총 일(Days) 수 이다.
  48. int intDays = Convert.ToInt32(strVersionText.Split('.')[2]);
  49. DateTime refDate = new DateTime(2000, 1, 1);
  50. DateTime dtBuildDate = refDate.AddDays(intDays);
  51. //3. Verion Text의 네번째 값(Revision NUmber)은 자정으로부터 Build된
  52. //시간까지의 지나간 초(Second) 값 이다.
  53. int intSeconds = Convert.ToInt32(strVersionText.Split('.')[3]);
  54. intSeconds = intSeconds * 2;
  55. dtBuildDate = dtBuildDate.AddSeconds(intSeconds);
  56. //4. 시차조정
  57. DaylightTime daylingTime = TimeZone.CurrentTimeZone
  58. .GetDaylightChanges(dtBuildDate.Year);
  59. if (TimeZone.IsDaylightSavingTime(dtBuildDate, daylingTime))
  60. dtBuildDate = dtBuildDate.Add(daylingTime.Delta);
  61. return dtBuildDate;
  62. }*/
  63. /// <summary>
  64. /// Assembly의 Build된 일시를 구합니다.
  65. /// </summary>
  66. /// <returns></returns>
  67. public DateTime getBuildDateTime()
  68. {
  69. Assembly assembly = Assembly.GetExecutingAssembly();
  70. return System.IO.File.GetLastWriteTime(assembly.Location);
  71. }
  72. private void Firmware_Update_Click(object sender, EventArgs e)
  73. {
  74. OpenFileDialog ofd = new OpenFileDialog();
  75. //FileDownload file = new FileDownload();
  76. if (setcheck_checkBox.Checked == true)
  77. setcheck_checkBox.Checked = false;
  78. file.ShowFileOpenDialog(ref serial, ofd);
  79. }
  80. private void Crc16_Check_Click(object sender, EventArgs e)
  81. {
  82. #if false
  83. Crc16 crc16 = new Crc16();
  84. byte[] tempdata = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,0x0A };
  85. label1.Text = crc16.CRC16_Generate(tempdata, 11).ToString();
  86. #endif
  87. this.serial.Test_Serial();
  88. }
  89. private void Button_PortOpen_Click(object sender, EventArgs e)
  90. {
  91. bool ret = false;
  92. ret = Serial_connectiondisable(serial.Serial_PortOpen(ref button_PortOpen, ref comboBox_Port));
  93. if (ret == false && timer.Enabled == false)
  94. {
  95. timer.Start(); //타이머를 발동시킨다.
  96. }
  97. else if (timer.Enabled == true)
  98. {
  99. timer.Stop(); //타이머를 멈춘다.
  100. }
  101. else
  102. {
  103. /*NOP*/
  104. }
  105. serial.Serial_Main_Form_Get(this);
  106. }
  107. private void ComboBox_Port_SelectedIndexChanged(object sender, EventArgs e)
  108. {
  109. serial.Serial_Name = comboBox_Port.SelectedItem.ToString();
  110. }
  111. private void Button_terminal_Click(object sender, EventArgs e)
  112. {
  113. serial.Serial_TerminalOpen(serial);
  114. }
  115. public bool Serial_connectiondisable(Boolean on_off)
  116. {
  117. comboBox_Port.Enabled = on_off;
  118. comboBox_baudrate.Enabled = on_off;
  119. return on_off;
  120. }
  121. private delegate void BoolSet();
  122. public void TX_Light_ON()
  123. {
  124. this.pictureBox_G_TX.Visible = true;
  125. this.pictureBox_R_TX.Visible = false;
  126. }
  127. public void TX_Light_OFF()
  128. {
  129. this.pictureBox_R_TX.Visible = true;
  130. this.pictureBox_G_TX.Visible = false;
  131. }
  132. public void RX_Light_ON()
  133. {
  134. this.pictureBox_G_RX.Visible = true;
  135. this.pictureBox_R_RX.Visible = false;
  136. }
  137. public void RX_Light_OFF()
  138. {
  139. this.pictureBox_R_RX.Visible = true;
  140. this.pictureBox_G_RX.Visible = false;
  141. }
  142. Int64 Timer_Cnt = 0;
  143. Int32 ReqTimer_Cnt = 0;
  144. public bool TX_RX_Light = false;
  145. private void timer_Tick(object sender, EventArgs e)
  146. {
  147. Update_Serial update_Serial = null;
  148. bool req_set = false;
  149. if(update_Serial == null)
  150. {
  151. update_Serial = (Update_Serial)serial.FileDownloadClass_Get();
  152. if (update_Serial == null)
  153. req_set = true;
  154. else if(update_Serial.Update_ready == false)
  155. req_set = true;
  156. }
  157. if (req_set)
  158. {
  159. ReqTimer_Cnt++;
  160. }
  161. if (TX_RX_Light == true)
  162. {
  163. Timer_Cnt++;
  164. }
  165. if (Timer_Cnt < 1000)
  166. {
  167. if (this.pictureBox_G_TX.Visible == true)
  168. {
  169. TX_Light_OFF();
  170. }
  171. if (this.pictureBox_G_RX.Visible == true)
  172. {
  173. RX_Light_OFF();
  174. }
  175. Timer_Cnt = 0;
  176. TX_RX_Light = false;
  177. }
  178. if(ReqTimer_Cnt > 6)
  179. {
  180. bluecell_BootProtocol.Bluecell_RF_Status_Req(serial);
  181. ReqTimer_Cnt = 0;
  182. }
  183. }
  184. private void Main_Form_Load(object sender, EventArgs e)
  185. {
  186. //pictureBox_PATH_1_8G_DL_ON.Visible = false;
  187. //pictureBox_PATH_1_8G_UL_ON.Visible = false;
  188. //pictureBox_PATH_2_1G_DL_ON.Visible = false;
  189. //pictureBox_PATH_2_1G_UL_ON.Visible = false;
  190. pictureBox_PATH_3_5G_L_ON.Visible = false;
  191. pictureBox_PATH_3_5G_H_ON.Visible = false;
  192. // pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = false;
  193. //pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = false;
  194. pictureBox_PATH_3_5G_UL_ON.Visible = false;
  195. pictureBox_PATH_3_5G_DL_ON.Visible = false;
  196. //pictureBox_PATH_1_8G_DL_OFF.Visible = !false;
  197. //pictureBox_PATH_1_8G_UL_OFF.Visible = !false;
  198. //pictureBox_PATH_2_1G_DL_OFF.Visible = !false;
  199. //pictureBox_PATH_2_1G_UL_OFF.Visible = !false;
  200. pictureBox_PATH_3_5G_L_OFF.Visible = !false;
  201. pictureBox_PATH_3_5G_H_OFF.Visible = !false;
  202. // pictureBox_PLL_ON_OFF_3_5G_L_OFF.Visible = !false;
  203. // pictureBox_PLL_ON_OFF_3_5G_H_OFF.Visible = !false;
  204. pictureBox_PATH_3_5G_UL_OFF.Visible = !false;
  205. pictureBox_PATH_3_5G_DL_OFF.Visible = !false;
  206. pictureBox_G_RX.Visible = !false;
  207. pictureBox_G_TX.Visible = !false;
  208. }
  209. private delegate void StringSend(object label, String str);
  210. public void ADC_Voltage_Value_Set(byte[] data)
  211. {
  212. int temp_val = 0;
  213. double Volt_Calc_val = 3.3 / 4095;
  214. double ret = 0;
  215. try
  216. {
  217. //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]);
  218. //ret = temp_val * Volt_Calc_val;
  219. //this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_DL_IN, ret.ToString("N2") + "V");
  220. //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]);
  221. //ret = temp_val * Volt_Calc_val;
  222. //this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_DL_OUT, ret.ToString("N2") + "V");
  223. //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]);
  224. //ret = temp_val * Volt_Calc_val;
  225. //this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_UL_IN, ret.ToString("N2") + "V");
  226. //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]);
  227. //ret = temp_val * Volt_Calc_val;
  228. //this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_UL_OUT, ret.ToString("N2") + "V");
  229. //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]);
  230. //ret = temp_val * Volt_Calc_val;
  231. //this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_DL_IN, ret.ToString("N2") + "V");
  232. //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]);
  233. //ret = temp_val * Volt_Calc_val;
  234. //this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_DL_OUT, ret.ToString("N2") + "V");
  235. //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]);
  236. //ret = temp_val * Volt_Calc_val;
  237. //this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_UL_IN, ret.ToString("N2") + "V");
  238. //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]);
  239. //ret = temp_val * Volt_Calc_val;
  240. //this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_UL_OUT, ret.ToString("N2") + "V");
  241. 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]);
  242. ret = temp_val * Volt_Calc_val;
  243. this.Invoke(new StringSend(Label_Text_Set), textBox3_5GHz_DL_IN, ret.ToString("N2") + "V");
  244. 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]);
  245. ret = temp_val * Volt_Calc_val;
  246. this.Invoke(new StringSend(Label_Text_Set), textBox3_5GHz_DL_OUT, ret.ToString("N2") + "V");
  247. 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]);
  248. ret = temp_val * Volt_Calc_val;
  249. this.Invoke(new StringSend(Label_Text_Set), textBox3_5GHz_UL_IN, ret.ToString("N2") + "V");
  250. 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]);
  251. ret = temp_val * Volt_Calc_val;
  252. this.Invoke(new StringSend(Label_Text_Set), textBox3_5GHz_UL_OUT, ret.ToString("N2") + "V");
  253. temp_val = (int)(data[(int)Bluecell_TypeIndex_t.RFU_TEMP_H] << 8) | (data[(int)Bluecell_TypeIndex_t.RFU_TEMP_L]);
  254. ret = temp_val * Volt_Calc_val;
  255. this.Invoke(new StringSend(Label_Text_Set), textBox_RFU_Temp, ret.ToString("N2") + "V");
  256. temp_val = (int)(data[(int)Bluecell_TypeIndex_t._28V_DET_H] << 8) | (data[(int)Bluecell_TypeIndex_t._28V_DET_L]);
  257. ret = temp_val * Volt_Calc_val;
  258. this.Invoke(new StringSend(Label_Text_Set), textBox_28V_Det, ret.ToString("N2") + "V");
  259. if (IamSetting_Get() == false)
  260. {
  261. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL1];
  262. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  263. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, ret.ToString());
  264. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL2];
  265. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  266. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL2, ret.ToString());
  267. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL1];
  268. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  269. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL1, ret.ToString());
  270. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL2];
  271. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  272. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL2, ret.ToString());
  273. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL3];
  274. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  275. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL3, ret.ToString());
  276. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_1_8G_UL4];
  277. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  278. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL4, ret.ToString());
  279. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_DL1];
  280. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  281. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_DL1, ret.ToString());
  282. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_DL2];
  283. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  284. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_DL2, ret.ToString());
  285. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL1];
  286. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  287. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL1, ret.ToString());
  288. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL2];
  289. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  290. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL2, ret.ToString());
  291. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL3];
  292. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  293. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL3, ret.ToString());
  294. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_2_1G_UL4];
  295. ret = bluecell_BootProtocol.Bluecell_Reverse_BDA4601_Calc(temp_val);
  296. // this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL4, ret.ToString());
  297. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_LOW1];
  298. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  299. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_LOW1, ret.ToString());
  300. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_HIGH1];
  301. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  302. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_HIGH1, ret.ToString());
  303. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_COM1];
  304. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  305. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM1, ret.ToString());
  306. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_LOW2];
  307. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  308. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_LOW2, ret.ToString());
  309. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_HIGH2];
  310. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  311. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_HIGH2, ret.ToString());
  312. temp_val = data[(int)Bluecell_TypeIndex_t.ATT_3_5G_COM2];
  313. ret = bluecell_BootProtocol.Bluecell_ReversePE43711_Calc(temp_val);
  314. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM2, ret.ToString());
  315. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_1_8G_DL_H] << 8;
  316. ret = ((double)(temp_val | data[(int)Bluecell_TypeIndex_t.PLL_1_8G_DL_L]) / 10);
  317. if(ret != 0)
  318. ret = ret + 215;
  319. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_1_8G_DL, ret.ToString());
  320. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_1_8G_UL_H] << 8;
  321. ret = ((double)(temp_val | data[(int)Bluecell_TypeIndex_t.PLL_1_8G_UL_L]) / 10);
  322. if (ret != 0)
  323. ret = ret + 276.5;
  324. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_1_8G_UL, ret.ToString());
  325. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_2_1G_DL_H] << 8;
  326. ret = ((temp_val | data[(int)Bluecell_TypeIndex_t.PLL_2_1G_DL_L]) );
  327. if (ret != 0)
  328. // ret = (ret + 1536)/10;
  329. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_2_1G_DL, ret.ToString());
  330. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_2_1G_UL_H] << 8;
  331. ret = ((double)(temp_val | data[(int)Bluecell_TypeIndex_t.PLL_2_1G_UL_L]) / 10);
  332. if (ret != 0)
  333. ret = ret - 337.9;
  334. //this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_2_1G_UL, ret.ToString());
  335. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_3_5G_LOW_H] << 16;
  336. temp_val = temp_val | data[(int)Bluecell_TypeIndex_t.PLL_3_5G_LOW_M] << 8;
  337. ret = ((double)(temp_val | data[(int)Bluecell_TypeIndex_t.PLL_3_5G_LOW_L]) / 100);
  338. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_3_5G_LOW, ret.ToString());
  339. temp_val = data[(int)Bluecell_TypeIndex_t.PLL_3_5G_HIGH_H] << 16;
  340. temp_val = temp_val | data[(int)Bluecell_TypeIndex_t.PLL_3_5G_HIGH_M] << 8;
  341. ret = ((double)(temp_val | data[(int)Bluecell_TypeIndex_t.PLL_3_5G_HIGH_L]) / 100);
  342. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_PLL_3_5G_HIGH, ret.ToString());
  343. /***********************DAC A Sector**********************************/
  344. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_A_H] << 8;
  345. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_A_L]) );
  346. ret = (temp_val & 0x0FFF) * 4;
  347. ret = ret / 4095;
  348. ret = Math.Round(Convert.ToDouble(ret), 2);
  349. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_A, ret.ToString());
  350. /***********************DAC B Sector**********************************/
  351. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_B_H] << 8;
  352. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_B_L]) );
  353. ret = (temp_val & 0x0FFF) * 4;
  354. ret = ret / 4095;
  355. ret = Math.Round(Convert.ToDouble(ret), 2);
  356. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_B, ret.ToString());
  357. /***********************DAC C Sector**********************************/
  358. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_C_H] << 8;
  359. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_C_L]) );
  360. ret = (temp_val & 0x0FFF) * 4;
  361. ret = ret / 4095;
  362. ret = Math.Round(Convert.ToDouble(ret ), 2);
  363. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_C, ret.ToString());
  364. /***********************DAC D Sector**********************************/
  365. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_D_H] << 8;
  366. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_D_L]) );
  367. ret = (temp_val & 0x0FFF) * 4;
  368. ret = ret / 4095;
  369. ret = Math.Round(Convert.ToDouble(ret), 2);
  370. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_D, ret.ToString());
  371. /***********************DAC E Sector**********************************/
  372. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_E_H] << 8;
  373. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_E_L]) );
  374. ret = (temp_val & 0x0FFF) * 4;
  375. ret = ret / 4095;
  376. ret = Math.Round(Convert.ToDouble(ret), 2);
  377. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_E, ret.ToString());
  378. /***********************DAC F Sector**********************************/
  379. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_F_H] << 8;
  380. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_F_L]) );
  381. ret = (temp_val & 0x0FFF) * 4;
  382. ret = ret / 4095;
  383. ret = Math.Round(Convert.ToDouble(ret), 2);
  384. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_F, ret.ToString());
  385. /***********************DAC G Sector**********************************/
  386. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_G_H] << 8;
  387. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_G_L]) );
  388. ret = (temp_val & 0x0FFF) * 4;
  389. ret = ret / 4095;
  390. ret = Math.Round(Convert.ToDouble(ret), 2);
  391. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_G, ret.ToString());
  392. /***********************DAC H Sector**********************************/
  393. temp_val = data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_H_H] << 8;
  394. temp_val = ((temp_val | data[(int)Bluecell_TypeIndex_t.DAC_VCtrl_H_L]) );
  395. ret = (temp_val & 0x0FFF) * 4;
  396. ret = ret / 4095;
  397. ret = Math.Round(Convert.ToDouble(ret), 2);
  398. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_DAC_VoltCtrl_H, ret.ToString());
  399. PictureBox pic_on;
  400. PictureBox pic_off;
  401. //pic_on = pictureBox_PATH_1_8G_DL_ON;
  402. //pic_off = pictureBox_PATH_1_8G_DL_OFF;
  403. // if (data[(int)Bluecell_TypeIndex_t.PATH_EN_1_8G_DL] > 0)
  404. // {
  405. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  406. // }
  407. // else
  408. // {
  409. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  410. // }
  411. // //pic_on = pictureBox_PATH_1_8G_UL_ON;
  412. // //pic_off = pictureBox_PATH_1_8G_UL_OFF;
  413. // if (data[(int)Bluecell_TypeIndex_t.PATH_EN_1_8G_UL] > 0)
  414. // {
  415. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  416. // }
  417. // else
  418. // {
  419. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  420. // }
  421. // //pic_on = pictureBox_PATH_2_1G_DL_ON;
  422. // //pic_off = pictureBox_PATH_2_1G_DL_OFF;
  423. // if (data[(int)Bluecell_TypeIndex_t.PATH_EN_2_1G_DL] > 0)
  424. // {
  425. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  426. // }
  427. // else
  428. // {
  429. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  430. // }
  431. // // pic_on = pictureBox_PATH_2_1G_UL_ON;
  432. //// pic_off = pictureBox_PATH_2_1G_UL_OFF;
  433. // if (data[(int)Bluecell_TypeIndex_t.PATH_EN_2_1G_UL] > 0)
  434. // {
  435. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  436. // }
  437. // else
  438. // {
  439. // this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  440. // }
  441. pic_on = pictureBox_PATH_3_5G_DL_ON;
  442. pic_off = pictureBox_PATH_3_5G_DL_OFF;
  443. if (data[(int)Bluecell_TypeIndex_t.PATH_EN_3_5G_DL] > 0)
  444. {
  445. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  446. }
  447. else
  448. {
  449. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  450. }
  451. pic_on = pictureBox_PATH_3_5G_UL_ON;
  452. pic_off = pictureBox_PATH_3_5G_UL_OFF;
  453. if (data[(int)Bluecell_TypeIndex_t.PATH_EN_3_5G_UL] > 0)
  454. {
  455. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  456. }
  457. else
  458. {
  459. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  460. }
  461. pic_on = pictureBox_PATH_3_5G_H_ON;
  462. pic_off = pictureBox_PATH_3_5G_H_OFF;
  463. if (data[(int)Bluecell_TypeIndex_t.PATH_EN_3_5G_H] > 0)
  464. {
  465. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  466. }
  467. else
  468. {
  469. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  470. }
  471. pic_on = pictureBox_PATH_3_5G_L_ON;
  472. pic_off = pictureBox_PATH_3_5G_L_OFF;
  473. if (data[(int)Bluecell_TypeIndex_t.PATH_EN_3_5G_L] > 0)
  474. {
  475. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  476. }
  477. else
  478. {
  479. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  480. }
  481. // pic_on = pictureBox_PLL_ON_OFF_3_5G_H_ON;
  482. // pic_off = pictureBox_PLL_ON_OFF_3_5G_H_OFF;
  483. if (data[(int)Bluecell_TypeIndex_t.PLL_ON_OFF_3_5G_H] > 0)
  484. {
  485. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  486. }
  487. else
  488. {
  489. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  490. }
  491. // pic_on = pictureBox_PLL_ON_OFF_3_5G_L_ON;
  492. // pic_off = pictureBox_PLL_ON_OFF_3_5G_L_OFF;
  493. if (data[(int)Bluecell_TypeIndex_t.PLL_ON_OFF_3_5G_L] > 0)
  494. {
  495. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  496. }
  497. else
  498. {
  499. this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  500. }
  501. if (data[(int)Bluecell_TypeIndex_t.T_SYNC_DL] > 0)
  502. {
  503. TDD_T_SYNC_Get();
  504. //this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, true);
  505. }
  506. else
  507. {
  508. //this.Invoke(new PictureBoxSend(PictureBox_On_OFF_Set), pic_on, pic_off, false);
  509. }
  510. // this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL2, data[(int)Bluecell_TypeIndex_t.ATT_1_8G_DL2]);
  511. }
  512. }
  513. catch { /*MessageBox.Show("What is this?");*/ }
  514. }
  515. private delegate void PictureBoxSend(object picon, object picoff, bool set);
  516. private void PictureBox_On_OFF_Set(object pic_on,object pic_off,bool set)
  517. {
  518. PictureBox picture_on = (PictureBox)pic_on;
  519. PictureBox picture_off = (PictureBox)pic_off;
  520. picture_on.Visible = set;
  521. picture_off.Visible =!set;
  522. }
  523. public void ReSetting_Values(byte[] temp_buf)
  524. {
  525. //this.numericUpDown_ATT_1_8G_DL1.Text = temp_buf[(byte)Bluecell_TypeIndex_t.ATT_1_8G_DL1].ToString();
  526. }
  527. private void Label_Text_Set(object label, String str)
  528. {
  529. TextBox Temp_label = (TextBox)label;
  530. Temp_label.Text = str;
  531. }
  532. private void numeric_Text_Set(object numeric, String str)
  533. {
  534. NumericUpDown Temp_numeric = (NumericUpDown)numeric;
  535. Temp_numeric.Text = str;
  536. }
  537. private void ATT_Enter(object sender, KeyEventArgs e)
  538. {
  539. if (e.KeyCode == Keys.Enter)
  540. {
  541. Button_Set_Click(sender, e);
  542. //to do
  543. }
  544. else
  545. {
  546. return;
  547. }
  548. }
  549. private void TDD_T_SYNC_Click(object sender, EventArgs e)
  550. {
  551. PictureBox pictureBox = (PictureBox)sender;
  552. Tdd_T_Sync = Convert.ToByte(pictureBox.Tag);
  553. bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
  554. pictureBox_TDD_T_SYNC_UL_ON.Visible = !pictureBox_TDD_T_SYNC_UL_ON.Visible;
  555. pictureBox_TDD_T_SYNC_DL_OFF.Visible = !pictureBox_TDD_T_SYNC_DL_OFF.Visible;
  556. }
  557. private void TDD_T_SYNC_Get()
  558. {
  559. }
  560. const byte PATH_1_8G_DL_ON = 1;
  561. const byte PATH_1_8G_DL_OFF = 2;
  562. const byte PATH_1_8G_UL_ON = 3;
  563. const byte PATH_1_8G_UL_OFF = 4;
  564. const byte PATH_2_1G_DL_ON = 5;
  565. const byte PATH_2_1G_DL_OFF = 6;
  566. const byte PATH_2_1G_UL_ON = 7;
  567. const byte PATH_2_1G_UL_OFF = 8;
  568. const byte PATH_3_5G_DL_ON = 9;
  569. const byte PATH_3_5G_DL_OFF = 10;
  570. const byte PATH_3_5G_UL_ON = 11;
  571. const byte PATH_3_5G_UL_OFF = 12;
  572. const byte PATH_3_5G_H_ON = 13;
  573. const byte PATH_3_5G_H_OFF = 14;
  574. const byte PATH_3_5G_L_ON = 15;
  575. const byte PATH_3_5G_L_OFF = 16;
  576. const byte PLL_POWER_ONOFF_3_5G_H_ON = 17;
  577. const byte PLL_POWER_ONOFF_3_5G_H_OFF = 18;
  578. const byte PLL_POWER_ONOFF_3_5G_L_ON = 19;
  579. const byte PLL_POWER_ONOFF_3_5G_L_OFF = 20;
  580. private void Power_OnOff_Set(object sender, EventArgs e)
  581. {
  582. byte temp_tag = 0;
  583. PictureBox pictureBox = (PictureBox)sender;
  584. temp_tag = Convert.ToByte(pictureBox.Tag);
  585. switch (temp_tag)
  586. {
  587. /* case PATH_1_8G_DL_OFF:
  588. pictureBox_PATH_1_8G_DL_ON.Visible = true;
  589. break;
  590. case PATH_1_8G_DL_ON:
  591. pictureBox_PATH_1_8G_DL_OFF.Visible = true;
  592. break;
  593. case PATH_1_8G_UL_OFF:
  594. pictureBox_PATH_1_8G_UL_ON.Visible = true;
  595. break;
  596. case PATH_1_8G_UL_ON:
  597. pictureBox_PATH_1_8G_UL_OFF.Visible = true;
  598. break;
  599. case PATH_2_1G_DL_OFF:
  600. pictureBox_PATH_2_1G_DL_ON.Visible = true;
  601. break;
  602. case PATH_2_1G_DL_ON:
  603. pictureBox_PATH_2_1G_DL_OFF.Visible = true;
  604. break;
  605. case PATH_2_1G_UL_OFF:
  606. pictureBox_PATH_2_1G_UL_ON.Visible = true;
  607. break;
  608. case PATH_2_1G_UL_ON:
  609. pictureBox_PATH_2_1G_UL_OFF.Visible = true;
  610. break;*/
  611. case PATH_3_5G_DL_OFF:
  612. pictureBox_PATH_3_5G_DL_ON.Visible = true;
  613. break;
  614. case PATH_3_5G_DL_ON:
  615. pictureBox_PATH_3_5G_DL_OFF.Visible = true;
  616. break;
  617. case PATH_3_5G_UL_OFF:
  618. pictureBox_PATH_3_5G_UL_ON.Visible = true;
  619. break;
  620. case PATH_3_5G_UL_ON:
  621. pictureBox_PATH_3_5G_UL_OFF.Visible = true;
  622. break;
  623. case PATH_3_5G_H_OFF:
  624. pictureBox_PATH_3_5G_H_ON.Visible = true;
  625. break;
  626. case PATH_3_5G_H_ON:
  627. pictureBox_PATH_3_5G_H_OFF.Visible = true;
  628. break;
  629. case PATH_3_5G_L_OFF:
  630. pictureBox_PATH_3_5G_L_ON.Visible = true;
  631. break;
  632. case PATH_3_5G_L_ON:
  633. pictureBox_PATH_3_5G_L_OFF.Visible = true;
  634. break;
  635. case PLL_POWER_ONOFF_3_5G_H_ON:
  636. // pictureBox_PLL_ON_OFF_3_5G_H_OFF.Visible = true;
  637. break;
  638. case PLL_POWER_ONOFF_3_5G_H_OFF:
  639. // pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = true;
  640. break;
  641. case PLL_POWER_ONOFF_3_5G_L_ON:
  642. // pictureBox_PLL_ON_OFF_3_5G_L_OFF.Visible = true;
  643. break;
  644. case PLL_POWER_ONOFF_3_5G_L_OFF:
  645. // pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = true;
  646. break;
  647. }
  648. pictureBox.Visible = !pictureBox.Visible;
  649. bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
  650. }
  651. private void button1_Click(object sender, EventArgs e)
  652. {
  653. /*this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL1, "0.0");
  654. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_DL2, "0.0");
  655. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL1, "0.0");
  656. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL2, "0.0");
  657. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL3, "0.0");
  658. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_1_8G_UL4, "0.0");
  659. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_DL1, "0.0");
  660. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_DL2, "0.0");
  661. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL1, "0.0");
  662. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL2, "0.0");
  663. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL3, "0.0");
  664. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_2_1G_UL4, "0.0");*/
  665. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_LOW1, "0.0");
  666. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_HIGH1, "0.0");
  667. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM1, "0.0");
  668. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_LOW2, "0.0");
  669. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_HIGH2, "0.0");
  670. this.Invoke(new StringSend(numeric_Text_Set), numericUpDown_ATT_3_5G_COM2, "0.0");
  671. Button_Set_Click(sender, e);
  672. /*Crc16 crc16 = new Crc16();
  673. byte[] temp_buf = new byte[6];
  674. temp_buf[0] = 0xbe;
  675. temp_buf[1] = 2;
  676. temp_buf[2] = 4;
  677. temp_buf[3] = 5;
  678. temp_buf[4] = crc16.STH30_CreateCrc(temp_buf, temp_buf[2]);
  679. temp_buf[5] = 0xeb;
  680. serial.Serial_DataSend(temp_buf, temp_buf[2] + 2);*/
  681. }
  682. private void Button_Set_Click(object sender, EventArgs e)
  683. {
  684. bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
  685. }
  686. private bool IamSetting = false;
  687. private void Activi_Change__Setting(object sender, EventArgs e)
  688. {
  689. IamSetting = true;
  690. }
  691. private void Activi_Change__SettingComplete(object sender, EventArgs e)
  692. {
  693. IamSetting = false;
  694. }
  695. public bool IamSetting_Get()
  696. {
  697. return IamSetting;
  698. }
  699. private void Cusor_DeFocus(object sender, EventArgs e)
  700. {
  701. GroupBox grp = (GroupBox)sender;
  702. grp.Focus();
  703. }
  704. private void button_Save_Click(object sender, EventArgs e)
  705. {
  706. Crc16 crc16 = new Crc16();
  707. DialogResult ret;
  708. byte[] temp_buf = new byte[6];
  709. ret = MessageBox.Show("저장 하시겠습니까?",
  710. "Setting",
  711. MessageBoxButtons.YesNo,
  712. MessageBoxIcon.Question,
  713. MessageBoxDefaultButton.Button1,
  714. MessageBoxOptions.DefaultDesktopOnly);
  715. if (ret == DialogResult.Yes)
  716. {
  717. temp_buf[0] = 0xbe;
  718. temp_buf[1] = 3;
  719. temp_buf[2] = 3;
  720. temp_buf[3] = 4;
  721. temp_buf[4] = crc16.STH30_CreateCrc(temp_buf, temp_buf[2]);
  722. temp_buf[5] = 0xeb;
  723. serial.Serial_DataSend(temp_buf, temp_buf[2] + 3);
  724. }
  725. else
  726. {
  727. this.BringToFront();
  728. }
  729. }
  730. public void Message_Box_Open()
  731. {
  732. //blue_MessageBox blue_MessageBox = new Blue_MessageBox();
  733. //MessageBox.Show("Setting OK");
  734. if(setcheck_checkBox.Checked == true)
  735. MessageBox.Show("OK",
  736. "Setting",
  737. MessageBoxButtons.OK,
  738. MessageBoxIcon.None,
  739. MessageBoxDefaultButton.Button1,
  740. MessageBoxOptions.DefaultDesktopOnly);
  741. }
  742. public void Message_Box_Error_Open(byte[] data)
  743. {
  744. byte type = data[(byte)Bluecell_TypeIndex_t.BLUE_CRCINDEX + 1];
  745. string str = "";
  746. if (type == 0)
  747. str = "PLL 1.8 DL Error";
  748. else if (type == 1)
  749. str = "PLL 1.8 UL Error";
  750. else if (type == 2)
  751. str = "PLL 2.1 DL Error";
  752. else if (type == 3)
  753. str = "PLL 2.1 UL Error";
  754. else
  755. str = "Error!!!";
  756. //blue_MessageBox blue_MessageBox = new Blue_MessageBox();
  757. //MessageBox.Show("Setting OK");
  758. if (setcheck_checkBox.Checked == true)
  759. MessageBox.Show(str,
  760. "Setting",
  761. MessageBoxButtons.OK,
  762. MessageBoxIcon.Error,
  763. MessageBoxDefaultButton.Button1,
  764. MessageBoxOptions.DefaultDesktopOnly);
  765. }
  766. private void comboBox_Port_MouseDown(object sender, MouseEventArgs e)
  767. {
  768. // serial.SetPortNameValues(comboBox_Port);
  769. }
  770. }
  771. }