Parcourir la source

DAC 관련 항목 추가

YJ il y a 6 ans
Parent
commit
f7d096b6c9

+ 121 - 5
Basic_Terminal/Func/Bluecell_BootProtocol.cs

@@ -99,8 +99,8 @@ namespace RF_TRIO_PLL_ZIG
99 99
         DET_2_1G_UL_OUT_L,
100 100
         DET_3_5G_DL_IN_H,
101 101
         DET_3_5G_DL_IN_L,
102
-        DET_3_5G_DL_OUT_L,
103 102
         DET_3_5G_DL_OUT_H,
103
+        DET_3_5G_DL_OUT_L,
104 104
         DET_3_5G_UL_IN_H,
105 105
         DET_3_5G_UL_IN_L,
106 106
         DET_3_5G_UL_OUT_H,
@@ -125,6 +125,22 @@ namespace RF_TRIO_PLL_ZIG
125 125
         _T_SYNC_DL,
126 126
         T_SYNC_UL,
127 127
         _T_SYNC_UL,
128
+        DAC_VCtrl_A_H,
129
+        DAC_VCtrl_A_L,
130
+        DAC_VCtrl_B_H,
131
+        DAC_VCtrl_B_L,
132
+        DAC_VCtrl_C_H,
133
+        DAC_VCtrl_C_L,
134
+        DAC_VCtrl_D_H,
135
+        DAC_VCtrl_D_L,
136
+        DAC_VCtrl_E_H,
137
+        DAC_VCtrl_E_L,
138
+        DAC_VCtrl_F_H,
139
+        DAC_VCtrl_F_L,
140
+        DAC_VCtrl_G_H,
141
+        DAC_VCtrl_G_L,
142
+        DAC_VCtrl_H_H,
143
+        DAC_VCtrl_H_L,
128 144
     };
129 145
     class Bluecell_BootProtocol
130 146
     {
@@ -246,7 +262,7 @@ namespace RF_TRIO_PLL_ZIG
246 262
             return ret;
247 263
 
248 264
         }
249
-        const byte BLUECELL_DATA_SET_LENGTH = 80;
265
+        const byte BLUECELL_DATA_SET_LENGTH = (byte)Bluecell_TypeIndex_t.DAC_VCtrl_H_L + 3 + 3 + 1;
250 266
         Main_Form main_Form;
251 267
         public void Bluecell_BtnSet(object serial, object main_form)
252 268
         {
@@ -345,7 +361,7 @@ namespace RF_TRIO_PLL_ZIG
345 361
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PATH_EN_3_5G_L]  = Convert.ToByte(Path_3_5G_L_Get_Func());
346 362
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PATH_EN_3_5G_H]  = Convert.ToByte(Path_3_5G_H_Get_Func());
347 363
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PATH_EN_3_5G_DL] = Convert.ToByte(PATH_3_5G_DL_Get_Func());
348
-            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PATH_EN_3_5G_UL] = Convert.ToByte(PATH_3_5G_DL_Get_Func());
364
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PATH_EN_3_5G_UL] = Convert.ToByte(PATH_3_5G_UL_Get_Func());
349 365
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PLL_ON_OFF_3_5G_H] = Convert.ToByte(PLL_ON_OFF_3_5G_H_Get_Func());
350 366
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.PLL_ON_OFF_3_5G_L] = Convert.ToByte(PLL_ON_OFF_3_5G_L_Get_Func());
351 367
 
@@ -354,11 +370,111 @@ namespace RF_TRIO_PLL_ZIG
354 370
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t._T_SYNC_DL] = main_Form.Tdd_T_Sync;//Convert.ToByte(PATH_3_5G_DL_Get_Func());
355 371
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.T_SYNC_UL] = main_Form.Tdd_T_Sync;//Convert.ToByte(PLL_ON_OFF_3_5G_H_Get_Func());
356 372
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t._T_SYNC_UL] = main_Form.Tdd_T_Sync;//Convert.ToByte(PLL_ON_OFF_3_5G_L_Get_Func());
373
+
374
+
375
+
376
+            double double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_A.Text) * 4095;
377
+            UInt16 temp = Convert.ToUInt16(double_temp / 4);
378
+            temp = Convert.ToUInt16(temp & 0xFF00);
379
+
380
+
381
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_A_H]
382
+                = Convert.ToByte(0x00 + Convert.ToByte(temp >> 8));
383
+
384
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_A_L] 
385
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_A.Text) * 4095) / 4) & 0x00FF);
386
+
387
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_B.Text) * 4095;
388
+            temp = Convert.ToUInt16(double_temp / 4);
389
+            temp = Convert.ToUInt16(temp & 0xFF00);
390
+
391
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_B_H]
392
+                = Convert.ToByte(0x10 + Convert.ToByte(temp >> 8));
393
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_B_L]
394
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_B.Text) * 4095) / 4) & 0x00FF);
395
+
396
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_C.Text) * 4095;
397
+            temp = Convert.ToUInt16(double_temp / 4);
398
+            temp = Convert.ToUInt16(temp & 0xFF00);
399
+
400
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_C_H]
401
+                = Convert.ToByte(0x20 + Convert.ToByte(temp >> 8));
402
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_C_L]
403
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_C.Text) * 4095) / 4) & 0x00FF);
404
+
405
+
406
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_D.Text) * 4095;
407
+            temp = Convert.ToUInt16(double_temp / 4);
408
+            temp = Convert.ToUInt16(temp & 0xFF00);
409
+
410
+
411
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_D_H]
412
+                = Convert.ToByte(0x30 + Convert.ToByte(temp >> 8));
413
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_D_L]
414
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_D.Text) * 4095) / 4) & 0x00FF); ;
415
+
416
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_E.Text) * 4095;
417
+            temp = Convert.ToUInt16(double_temp / 4);
418
+            temp = Convert.ToUInt16(temp & 0xFF00);
419
+
420
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_E_H]
421
+                = Convert.ToByte(0x40 + Convert.ToByte(temp >> 8));
422
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_E_L]
423
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_E.Text) * 4095) / 4) & 0x00FF);
424
+
425
+
426
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_F.Text) * 4095;
427
+            temp = Convert.ToUInt16(double_temp / 4);
428
+            temp = Convert.ToUInt16(temp & 0xFF00);
429
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_F_H]
430
+                = Convert.ToByte(0x50 + Convert.ToByte(temp >> 8));
431
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_F_L]
432
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_F.Text) * 4095) / 4) & 0x00FF);
433
+
434
+
435
+
436
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_G.Text) * 4095;
437
+            temp = Convert.ToUInt16(double_temp / 4);
438
+            temp = Convert.ToUInt16(temp & 0xFF00);
439
+
440
+
441
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_G_H]
442
+                = Convert.ToByte(0x60 + Convert.ToByte(temp >> 8));
443
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_G_L] 
444
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_G.Text) * 4095) / 4) & 0x00FF);
445
+
446
+
447
+            double_temp = Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_H.Text) * 4095;
448
+            temp = Convert.ToUInt16(double_temp / 4);
449
+            temp = Convert.ToUInt16(temp & 0xFF00);
450
+            
451
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_H_H]
452
+                = Convert.ToByte(0x70 + Convert.ToByte(temp >> 8));
453
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_H_L] 
454
+                = Convert.ToByte(Convert.ToUInt16((Convert.ToDouble(main_Form.numericUpDown_DAC_VoltCtrl_H.Text) * 4095) / 4) & 0x00FF);
455
+
456
+
357 457
             /* * * * * * FIX DATA * * * * * */
358
-            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t._T_SYNC_UL + 1] = crc16.STH30_CreateCrc(temp_buf, BLUECELL_DATA_SET_LENGTH -  3);
359
-            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t._T_SYNC_UL + 2] = BLUECELL_TAILER;
458
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_H_L + 1] 
459
+                = crc16.STH30_CreateCrc(temp_buf, BLUECELL_DATA_SET_LENGTH -  3);
460
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DAC_VCtrl_H_L + 2] 
461
+                = BLUECELL_TAILER;
360 462
             this.serial.Serial_DataSend(temp_buf, temp_buf.Length);
361 463
         }
464
+        int[] RF_Status = new int[BLUECELL_DATA_SET_LENGTH];
465
+        private delegate void StringSend(string Text);
466
+        private delegate void ByteSend(byte[] Text);
467
+        public void Bluecell_RF_Status_Get(object serial, object main_form,byte[] temp_buf)
468
+        {
469
+            this.main_Form = (Main_Form)main_form;
470
+            this.serial = (Serial)serial;
471
+           
472
+            
473
+            this.main_Form.ADC_Voltage_Value_Set(temp_buf);
474
+            //Debug.Invoke(new StringSend(Debug.Data_Recv_Str), data);
475
+            //main_Form.label1_8GHz_DL_OUT.Text = Convert.ToString(temp_val);
476
+
477
+        }
362 478
         bool PATH_1_8G_UL_Get_Func()
363 479
         {
364 480
             bool ret = false;

+ 11 - 1
Basic_Terminal/Func/Data_Handler.cs

@@ -46,9 +46,14 @@ namespace RF_TRIO_PLL_ZIG
46 46
 
47 47
             return ret;
48 48
         }
49
-        public void Recv_dataCheck(object fileDownload, byte[] data)
49
+        Serial serial;
50
+        Main_Form main_Form; //= new Main_Form();
51
+        public void Recv_dataCheck(object serial,object main_form, object fileDownload, byte[] data)
50 52
         {
51 53
             Boolean Header_Check;
54
+            Bluecell_BootProtocol bluecell_BootProtocol = new Bluecell_BootProtocol();
55
+            this.serial = (Serial)serial;
56
+            this.main_Form = (Main_Form)main_form;
52 57
             byte Crc_Check, seq;
53 58
             try
54 59
             {
@@ -65,6 +70,7 @@ namespace RF_TRIO_PLL_ZIG
65 70
             {
66 71
                 this.fileDownload = new Update_Serial();
67 72
             }
73
+            /* * * * * * * * * * * * * *파일 다운로드 부분* * * * * * * * * * * * *  */
68 74
             if (this.fileDownload.Update_ready == true)
69 75
             {
70 76
                 Header_Check = HeaderCheck(data);
@@ -96,6 +102,10 @@ namespace RF_TRIO_PLL_ZIG
96 102
                 }
97 103
                 
98 104
             }
105
+            else/* * * * * * * * * * * * * *API RECV 부분 * * * * * * * * * * * * *  */
106
+            {
107
+                bluecell_BootProtocol.Bluecell_RF_Status_Get(this.serial,this.main_Form, data);
108
+            }
99 109
         }
100 110
     }
101 111
 }

+ 25 - 7
Basic_Terminal/Func/Serial.cs

@@ -78,6 +78,7 @@ namespace RF_TRIO_PLL_ZIG
78 78
         private delegate void BoolSet();
79 79
         public void Serial_DataRecvFunction(object sender, SerialDataReceivedEventArgs e)
80 80
         {
81
+            string tmpSTR = "";
81 82
             //this.main_form.RX_Light_ON();
82 83
             main_form.Invoke(new BoolSet(main_form.RX_Light_ON));
83 84
             if (this.Debug.Created && Debug.RadioButton_ascii.Checked == true)
@@ -89,7 +90,7 @@ namespace RF_TRIO_PLL_ZIG
89 90
                     else
90 91
                         Debug.Invoke(new StringSend(Debug.Data_Recv_Str), Str2hex(data, true));
91 92
 
92
-                data_Handler.Recv_dataCheck(this.fileDownload, Str2bytes(data));
93
+                data_Handler.Recv_dataCheck(this,this.main_form,this.fileDownload, Str2bytes(data));
93 94
             }
94 95
             else
95 96
             {
@@ -97,15 +98,28 @@ namespace RF_TRIO_PLL_ZIG
97 98
                 int nLnegth = serialPort.BytesToRead;
98 99
                 byte[] btdata = new byte[nLnegth];
99 100
                 serialPort.Read(btdata, 0, nLnegth);
100
-
101
+                
101 102
                 if (nLnegth > 0)
102 103
                 {
103 104
                     if (this.Debug.Created)
104 105
                     {
105
-                        string tmpSTR = Encoding.Default.GetString(btdata).TrimEnd('\0');
106
-                        Debug.Invoke(new StringSend(Debug.Data_Recv_Str), Str2hex(tmpSTR, true));
106
+                        if (this.Debug.radioButton_ascii.Checked == true)
107
+                        {
108
+                            tmpSTR = Encoding.Default.GetString(btdata).TrimEnd('\0');
109
+                            Debug.Invoke(new StringSend(Debug.Data_Recv_Str), Str2hex(tmpSTR, true));
110
+                        }
111
+                        else
112
+                        {
113
+                            
114
+                            Debug.Invoke(new ByteSend(Debug.Data_Recv_Hex), btdata);
115
+                        }
116
+                    }
117
+                    else
118
+                    {
119
+                        if (this.Debug.Created)
120
+                            Debug.Invoke(new ByteSend(Debug.Data_Recv_Hex), btdata);
107 121
                     }
108
-                    data_Handler.Recv_dataCheck(this.fileDownload, btdata);
122
+                    data_Handler.Recv_dataCheck(this, this.main_form,this.fileDownload, btdata);
109 123
                    
110 124
                     // 이부분에서 데이타 처리하는 부분으로 전송하여 사용하면 됨
111 125
                 }
@@ -176,10 +190,13 @@ namespace RF_TRIO_PLL_ZIG
176 190
         }
177 191
         public void Serial_DataSend(byte[] buffer, int count)
178 192
         {
179
-            try { serialPort.Write(buffer, 0, count); }
193
+            try {
194
+                serialPort.Write(buffer, 0, count);
195
+                main_form.Invoke(new BoolSet(main_form.TX_Light_ON));
196
+            }
180 197
             catch { MessageBox.Show("Port Open Failed!!!"); }
181
-            main_form.Invoke(new BoolSet(main_form.TX_Light_ON));
182 198
             
199
+
183 200
         }
184 201
         public void FileDownloadClass_Get(object filedownload)
185 202
         {
@@ -215,5 +232,6 @@ namespace RF_TRIO_PLL_ZIG
215 232
         {
216 233
             this.main_form = (Main_Form)frm;
217 234
         }
235
+
218 236
     }
219 237
 }

+ 2 - 2
Basic_Terminal/Wnd/Debug.Designer.cs

@@ -162,7 +162,7 @@
162 162
         private System.Windows.Forms.Button button_Clear;
163 163
         private System.Windows.Forms.CheckBox checkBox2;
164 164
         private System.Windows.Forms.CheckBox checkBox1;
165
-        private System.Windows.Forms.RadioButton radioButton_ascii;
166
-        private System.Windows.Forms.RadioButton radioButton_hex;
165
+        public System.Windows.Forms.RadioButton radioButton_ascii;
166
+        public System.Windows.Forms.RadioButton radioButton_hex;
167 167
     }
168 168
 }

+ 39 - 0
Basic_Terminal/Wnd/Debug.cs

@@ -98,6 +98,45 @@ namespace RF_TRIO_PLL_ZIG
98 98
 
99 99
         }
100 100
 #endif
101
+        public void Data_Recv_Hex(byte[] text)
102
+        {
103
+            string AppendMessage = "";
104
+
105
+            int nLimitLines = Convert.ToInt32(LineLimit); //제한 라인 수
106
+            try
107
+            {
108
+                for (int i = 0; i < text.Length; i++)
109
+                {
110
+                    AppendMessage += Convert.ToString(text[i], 16);
111
+                }
112
+                tbReceived.AppendText(AppendMessage);
113
+                try
114
+                {
115
+                    SendMessage(this.Handle, WM_SETREDRAW, false, 0);
116
+                }
117
+                catch { return; }
118
+                if (tbReceived.Lines.Length > nLimitLines)
119
+                {
120
+                    LinkedList<string> tempLines = new LinkedList<string>(tbReceived.Lines);
121
+
122
+                    while ((tempLines.Count - nLimitLines) > 0)
123
+                    {
124
+                        tempLines.RemoveFirst();
125
+                    }
126
+
127
+                    tbReceived.Lines = tempLines.ToArray();
128
+                }
129
+                try
130
+                {
131
+                    SendMessage(this.Handle, WM_SETREDRAW, true, 0);
132
+                }
133
+                catch { return; }
134
+                tbReceived.Select(tbReceived.Text.Length, 0);
135
+                tbReceived.ScrollToCaret();
136
+            }
137
+            finally { }
138
+
139
+        }
101 140
         public void Data_Send(byte[] text)
102 141
         {
103 142
             string AppendMessage = "\n[TX]";

Fichier diff supprimé car celui-ci est trop grand
+ 969 - 512
Basic_Terminal/Wnd/Main_Form.Designer.cs


+ 158 - 38
Basic_Terminal/Wnd/Main_Form.cs

@@ -115,25 +115,33 @@ namespace RF_TRIO_PLL_ZIG
115 115
             }
116 116
         }
117 117
 
118
-        private void button_Set_Click(object sender, EventArgs e)
119
-        {
120
-            bluecell_BootProtocol.Bluecell_BtnSet(this.serial,this);
121
-        }
122
-
118
+    
123 119
         private void Main_Form_Load(object sender, EventArgs e)
124 120
         {
125
-            pictureBox_PATH_1_8G_DL_ON.Visible      = false;
126
-            pictureBox_PATH_1_8G_UL_ON.Visible      = false; 
127
-            pictureBox_PATH_2_1G_DL_ON.Visible      = false; 
128
-            pictureBox_PATH_2_1G_UL_ON.Visible      = false; 
129
-            pictureBox_PATH_3_5G_L_ON.Visible       = false; 
130
-            pictureBox_PATH_3_5G_H_ON.Visible       = false; 
131
-            pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = false; 
132
-            pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = false; 
133
-            pictureBox_PATH_3_5G_UL_ON.Visible      = false; 
134
-            pictureBox_PATH_3_5G_DL_ON.Visible      = false;
135
-            pictureBox_G_RX.Visible                 = false;
136
-            pictureBox_G_TX.Visible                 = false;
121
+            pictureBox_PATH_1_8G_DL_ON.Visible      = !false;
122
+            pictureBox_PATH_1_8G_UL_ON.Visible      = !false; 
123
+            pictureBox_PATH_2_1G_DL_ON.Visible      = !false; 
124
+            pictureBox_PATH_2_1G_UL_ON.Visible      = !false; 
125
+            pictureBox_PATH_3_5G_L_ON.Visible       = !false; 
126
+            pictureBox_PATH_3_5G_H_ON.Visible       = !false; 
127
+            pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = !false; 
128
+            pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = !false;
129
+            pictureBox_PATH_3_5G_UL_ON.Visible = !false;
130
+            pictureBox_PATH_3_5G_DL_ON.Visible = !false;
131
+
132
+            pictureBox_PATH_1_8G_DL_OFF.Visible = false;
133
+            pictureBox_PATH_1_8G_UL_OFF.Visible = false;
134
+            pictureBox_PATH_2_1G_DL_OFF.Visible = false;
135
+            pictureBox_PATH_2_1G_UL_OFF.Visible = false;
136
+            pictureBox_PATH_3_5G_L_OFF.Visible = false;
137
+            pictureBox_PATH_3_5G_H_OFF.Visible = false;
138
+            pictureBox_PLL_ON_OFF_3_5G_L_OFF.Visible = false;
139
+            pictureBox_PLL_ON_OFF_3_5G_H_OFF.Visible = false;
140
+            pictureBox_PATH_3_5G_UL_OFF.Visible = false;
141
+            pictureBox_PATH_3_5G_DL_OFF.Visible = false;
142
+
143
+            pictureBox_G_RX.Visible                 = !false;
144
+            pictureBox_G_TX.Visible                 = !false;
137 145
             /*        public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_L_OFF;
138 146
         public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_H_OFF;
139 147
         public System.Windows.Forms.PictureBox pictureBox_PLL_ON_OFF_3_5G_L_OFF;
@@ -155,12 +163,52 @@ namespace RF_TRIO_PLL_ZIG
155 163
         public System.Windows.Forms.PictureBox pictureBox_PATH_1_8G_UL_ON;;*/
156 164
 
157 165
         }
166
+        private delegate void StringSend(object label, String str);
167
+        public void ADC_Voltage_Value_Set(byte[] data)
168
+        {
169
+            int temp_val = 0;
170
+            try
171
+            {
172
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_DL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_DL_IN_L]);
173
+
174
+                this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_DL_IN, Convert.ToString(temp_val));
175
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_DL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_DL_OUT_L]);
176
+                this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_DL_OUT, Convert.ToString(temp_val));
177
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_DL_OUT_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_UL_IN_L]);
178
+                this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_UL_IN, Convert.ToString(temp_val));
179
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_UL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_UL_OUT_L]);
180
+                this.Invoke(new StringSend(Label_Text_Set), label1_8GHz_UL_OUT, Convert.ToString(temp_val));
181
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_1_8G_UL_OUT_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_DL_IN_L]);
182
+                this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_DL_IN, Convert.ToString(temp_val));
183
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_DL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_DL_OUT_L]);
184
+                this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_DL_OUT, Convert.ToString(temp_val));
185
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_DL_OUT_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_UL_IN_L]);
186
+                this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_UL_IN, Convert.ToString(temp_val));
187
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_UL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_2_1G_UL_OUT_L]);
188
+                this.Invoke(new StringSend(Label_Text_Set), label2_1GHz_UL_OUT, Convert.ToString(temp_val));
189
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_DL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_DL_IN_L]);
190
+                this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_DL_IN, Convert.ToString(temp_val));
191
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_DL_OUT_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_DL_OUT_L]);
192
+                this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_DL_OUT, Convert.ToString(temp_val));
193
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_UL_IN_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_UL_IN_L]);
194
+                this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_UL_IN, Convert.ToString(temp_val));
195
+                temp_val = (int)(data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_UL_OUT_H] << 8) | (data[(int)Bluecell_ProtIndex_p.Bluecell_data + (int)Bluecell_TypeIndex_t.DET_3_5G_UL_OUT_L]);
196
+                this.Invoke(new StringSend(Label_Text_Set), label3_5GHz_UL_OUT, Convert.ToString(temp_val));
197
+            }
198
+            catch { }
199
+
158 200
 
201
+        }
202
+        private void Label_Text_Set(object label,String str)
203
+        {
204
+            Label Temp_label = (Label)label;
205
+            Temp_label.Text = str;
206
+        }
159 207
         private void ATT_Enter(object sender, KeyEventArgs e)
160 208
         {
161 209
             if (e.KeyCode == Keys.Enter)
162 210
             {
163
-                button_Set_Click(sender, e);
211
+                Button_Set_Click(sender, e);
164 212
                 //to do
165 213
             }
166 214
             else
@@ -178,16 +226,26 @@ namespace RF_TRIO_PLL_ZIG
178 226
             pictureBox_TDD_T_SYNC_UL_ON.Visible = !pictureBox_TDD_T_SYNC_UL_ON.Visible;
179 227
             pictureBox_TDD_T_SYNC_DL_OFF.Visible = !pictureBox_TDD_T_SYNC_DL_OFF.Visible;
180 228
         }
181
-        const byte PATH_1_8G_DL = 0;
182
-        const byte PATH_1_8G_UL = 1;
183
-        const byte PATH_2_1G_DL = 2;
184
-        const byte PATH_2_1G_UL = 3;
185
-        const byte PATH_3_5G_DL = 4;
186
-        const byte PATH_3_5G_UL = 5;
187
-        const byte PATH_3_5G_H = 6;
188
-        const byte PATH_3_5G_L = 7;
189
-        const byte PLL_POWER_ONOFF_3_5G_H = 8;
190
-        const byte PLL_POWER_ONOFF_3_5G_L = 9;
229
+        const byte PATH_1_8G_DL_ON = 1;
230
+        const byte PATH_1_8G_DL_OFF = 2;
231
+        const byte PATH_1_8G_UL_ON = 3;
232
+        const byte PATH_1_8G_UL_OFF = 4;
233
+        const byte PATH_2_1G_DL_ON = 5;
234
+        const byte PATH_2_1G_DL_OFF = 6;
235
+        const byte PATH_2_1G_UL_ON = 7;
236
+        const byte PATH_2_1G_UL_OFF = 8;
237
+        const byte PATH_3_5G_DL_ON = 9;
238
+        const byte PATH_3_5G_DL_OFF = 10;
239
+        const byte PATH_3_5G_UL_ON = 11;
240
+        const byte PATH_3_5G_UL_OFF = 12;
241
+        const byte PATH_3_5G_H_ON = 13;
242
+        const byte PATH_3_5G_H_OFF = 14;
243
+        const byte PATH_3_5G_L_ON = 15;
244
+        const byte PATH_3_5G_L_OFF = 16;
245
+        const byte PLL_POWER_ONOFF_3_5G_H_ON = 17;
246
+        const byte PLL_POWER_ONOFF_3_5G_H_OFF = 18;
247
+        const byte PLL_POWER_ONOFF_3_5G_L_ON = 19;
248
+        const byte PLL_POWER_ONOFF_3_5G_L_OFF = 20;
191 249
 
192 250
         private void Power_OnOff_Set(object sender, EventArgs e)
193 251
         {
@@ -196,25 +254,65 @@ namespace RF_TRIO_PLL_ZIG
196 254
             temp_tag = Convert.ToByte(pictureBox.Tag);
197 255
             switch (temp_tag)
198 256
             {
199
-                case PATH_1_8G_DL:
257
+                case PATH_1_8G_DL_OFF:
258
+                    pictureBox_PATH_1_8G_DL_ON.Visible = true;
259
+                    break;
260
+                case PATH_1_8G_DL_ON:
261
+                    pictureBox_PATH_1_8G_DL_OFF.Visible = true;
262
+                    break;
263
+                case PATH_1_8G_UL_OFF:
264
+                    pictureBox_PATH_1_8G_UL_ON.Visible = true;
265
+                    break;
266
+                case PATH_1_8G_UL_ON:
267
+                    pictureBox_PATH_1_8G_UL_OFF.Visible = true;
268
+                    break;
269
+                case PATH_2_1G_DL_OFF:
270
+                    pictureBox_PATH_2_1G_DL_ON.Visible = true;
200 271
                     break;
201
-                case PATH_1_8G_UL:
272
+                case PATH_2_1G_DL_ON:
273
+                    pictureBox_PATH_2_1G_DL_OFF.Visible = true;
202 274
                     break;
203
-                case PATH_2_1G_DL:
275
+                case PATH_2_1G_UL_OFF:
276
+                    pictureBox_PATH_2_1G_UL_ON.Visible = true;
204 277
                     break;
205
-                case PATH_2_1G_UL:
278
+                case PATH_2_1G_UL_ON:
279
+                    pictureBox_PATH_2_1G_UL_OFF.Visible = true;
206 280
                     break;
207
-                case PATH_3_5G_DL:
281
+                case PATH_3_5G_DL_OFF:
282
+                    pictureBox_PATH_3_5G_DL_ON.Visible = true;
208 283
                     break;
209
-                case PATH_3_5G_UL:
284
+                case PATH_3_5G_DL_ON:
285
+                    pictureBox_PATH_3_5G_DL_OFF.Visible = true;
210 286
                     break;
211
-                case PATH_3_5G_H:
287
+                case PATH_3_5G_UL_OFF:
288
+                    pictureBox_PATH_3_5G_UL_ON.Visible = true;
212 289
                     break;
213
-                case PATH_3_5G_L:
290
+                case PATH_3_5G_UL_ON:
291
+                    pictureBox_PATH_3_5G_UL_OFF.Visible = true;
214 292
                     break;
215
-                case PLL_POWER_ONOFF_3_5G_H:
293
+                case PATH_3_5G_H_OFF:
294
+                    pictureBox_PATH_3_5G_H_ON.Visible = true;
216 295
                     break;
217
-                case PLL_POWER_ONOFF_3_5G_L:
296
+                case PATH_3_5G_H_ON:
297
+                    pictureBox_PATH_3_5G_H_OFF.Visible = true;
298
+                    break;
299
+                case PATH_3_5G_L_OFF:
300
+                    pictureBox_PATH_3_5G_L_ON.Visible = true;
301
+                    break;
302
+                case PATH_3_5G_L_ON:
303
+                    pictureBox_PATH_3_5G_L_OFF.Visible = true;
304
+                    break;
305
+                case PLL_POWER_ONOFF_3_5G_H_ON:
306
+                    pictureBox_PLL_ON_OFF_3_5G_H_OFF.Visible = true;
307
+                    break;
308
+                case PLL_POWER_ONOFF_3_5G_H_OFF:
309
+                    pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = true;
310
+                    break;
311
+                case PLL_POWER_ONOFF_3_5G_L_ON:
312
+                    pictureBox_PLL_ON_OFF_3_5G_L_OFF.Visible = true;
313
+                    break;
314
+                case PLL_POWER_ONOFF_3_5G_L_OFF:
315
+                    pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = true;
218 316
                     break;
219 317
 
220 318
 
@@ -222,5 +320,27 @@ namespace RF_TRIO_PLL_ZIG
222 320
             pictureBox.Visible = !pictureBox.Visible;
223 321
             bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
224 322
         }
323
+
324
+        private void button1_Click(object sender, EventArgs e)
325
+        {
326
+            Crc16 crc16 = new Crc16();
327
+            byte[] temp_buf = new byte[6];
328
+            temp_buf[0] = 0xbe;
329
+            temp_buf[1] = 2;
330
+            temp_buf[2] = 4;
331
+            temp_buf[3] = 5;
332
+            temp_buf[4] = crc16.STH30_CreateCrc(temp_buf, temp_buf[2]);
333
+            temp_buf[5] = 0xeb;
334
+            serial.Serial_DataSend(temp_buf, temp_buf[2] + 2);
335
+        }
336
+
337
+ 
338
+
339
+        private void Button_Set_Click(object sender, EventArgs e)
340
+        {
341
+            bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
342
+        }
343
+
344
+
225 345
     }
226 346
 }