|
|
@@ -40,6 +40,7 @@ namespace Jdas_Mbic
|
|
40
|
40
|
|
|
41
|
41
|
private void JdasMbic_Load(object sender, EventArgs e)
|
|
42
|
42
|
{
|
|
|
43
|
+ serial.Serial_Main_Form_Get(this);
|
|
43
|
44
|
ATT_TableLayoutSetting();
|
|
44
|
45
|
serial.Serial_Initialize(ref comboBox_Port);
|
|
45
|
46
|
|
|
|
@@ -56,7 +57,6 @@ namespace Jdas_Mbic
|
|
56
|
57
|
dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " dBm"; ;
|
|
57
|
58
|
dataGridView_TableSetting[1, i].Value = "0";
|
|
58
|
59
|
TempDbmData = TempDbmData + 0.5;
|
|
59
|
|
-
|
|
60
|
60
|
}
|
|
61
|
61
|
|
|
62
|
62
|
foreach (DataGridViewRow row in this.dataGridView_TableSetting.Rows)
|
|
|
@@ -193,8 +193,8 @@ namespace Jdas_Mbic
|
|
193
|
193
|
MessageBox.Show("존재하지 않는 ComboBox 입니다.\r\n 확인해주세요.");
|
|
194
|
194
|
break;
|
|
195
|
195
|
}
|
|
196
|
|
-
|
|
197
|
|
-
|
|
|
196
|
+
|
|
|
197
|
+ button_FileLoad_Click(null,null);
|
|
198
|
198
|
}
|
|
199
|
199
|
private List<int> DataGridViewIndexOutput()
|
|
200
|
200
|
{
|
|
|
@@ -252,7 +252,14 @@ namespace Jdas_Mbic
|
|
252
|
252
|
for (int i = 0; i < (Count - 1); i++)
|
|
253
|
253
|
{
|
|
254
|
254
|
Tmpdata = Convert.ToDouble(dataGridView_TableSetting[1, TmpList[0] + i].Value);
|
|
255
|
|
- dataGridView_TableSetting[1, TmpList[0] + (i + 1) ].Value = string.Format("{0:0.0}",Math.Round(Tmpdata + Result, 1));
|
|
|
255
|
+ if (comboBox_TableName.Text.Contains("DET") == true)
|
|
|
256
|
+ {
|
|
|
257
|
+ dataGridView_TableSetting[1, TmpList[0] + (i + 1)].Value = string.Format("{0:0.000}", Math.Round(Tmpdata + Result, 3));
|
|
|
258
|
+ }
|
|
|
259
|
+ else
|
|
|
260
|
+ {
|
|
|
261
|
+ dataGridView_TableSetting[1, TmpList[0] + (i + 1)].Value = string.Format("{0:0.0}", Math.Round(Tmpdata + Result, 1));
|
|
|
262
|
+ }
|
|
256
|
263
|
}
|
|
257
|
264
|
|
|
258
|
265
|
/* for (int i = 0; i < TmpList.Count; i++)
|
|
|
@@ -272,7 +279,11 @@ namespace Jdas_Mbic
|
|
272
|
279
|
|
|
273
|
280
|
private void button_CurrentOutput_Click(object sender, EventArgs e)
|
|
274
|
281
|
{
|
|
|
282
|
+ int columnIndex = dataGridView_TableSetting.CurrentCell.ColumnIndex;
|
|
|
283
|
+ int rowIndex = dataGridView_TableSetting.CurrentCell.RowIndex;
|
|
275
|
284
|
|
|
|
285
|
+ dataGridView_TableSetting[1, rowIndex].Value
|
|
|
286
|
+ = numericUpDown_CurrentOutput.Value;
|
|
276
|
287
|
}
|
|
277
|
288
|
|
|
278
|
289
|
private void button_MultiOffset_Click(object sender, EventArgs e)
|
|
|
@@ -634,8 +645,8 @@ namespace Jdas_Mbic
|
|
634
|
645
|
byte datatype = (byte)Bluecell_BootProtocol.DATATYPE.ATTSET;
|
|
635
|
646
|
Int16[] DL = new Int16[4];
|
|
636
|
647
|
Int16[] UL = new Int16[4];
|
|
637
|
|
- Int16[] ALC = new Int16[4];
|
|
638
|
|
- Int16[] AGC = new Int16[4];
|
|
|
648
|
+ Int16[] ALC_MAX = new Int16[4];
|
|
|
649
|
+ Int16[] ALC_MIN = new Int16[4];
|
|
639
|
650
|
byte tmp_H = 0;
|
|
640
|
651
|
byte tmp_L = 0;
|
|
641
|
652
|
DL[0] = Convert.ToInt16(numericUpDown_ATT_DL1.Value * 100);
|
|
|
@@ -648,15 +659,15 @@ namespace Jdas_Mbic
|
|
648
|
659
|
UL[2] = Convert.ToInt16(numericUpDown_ATT_UL3.Value * 100);
|
|
649
|
660
|
UL[3] = Convert.ToInt16(numericUpDown_ATT_UL4.Value * 100);
|
|
650
|
661
|
|
|
651
|
|
- ALC[0] = Convert.ToInt16(numericUpDown_ALC1.Value * 100);
|
|
652
|
|
- ALC[1] = Convert.ToInt16(numericUpDown_ALC2.Value * 100);
|
|
653
|
|
- ALC[2] = Convert.ToInt16(numericUpDown_ALC3.Value * 100);
|
|
654
|
|
- ALC[3] = Convert.ToInt16(numericUpDown_ALC4.Value * 100);
|
|
|
662
|
+ ALC_MAX[0] = Convert.ToInt16(numericUpDown_ALC1_MAX.Value * 100);
|
|
|
663
|
+ ALC_MAX[1] = Convert.ToInt16(numericUpDown_ALC2_MAX.Value * 100);
|
|
|
664
|
+ ALC_MAX[2] = Convert.ToInt16(numericUpDown_ALC3_MAX.Value * 100);
|
|
|
665
|
+ ALC_MAX[3] = Convert.ToInt16(numericUpDown_ALC4_MAX.Value * 100);
|
|
655
|
666
|
|
|
656
|
|
- AGC[0] = Convert.ToInt16(numericUpDown_AGC1.Value * 100);
|
|
657
|
|
- AGC[1] = Convert.ToInt16(numericUpDown_AGC2.Value * 100);
|
|
658
|
|
- AGC[2] = Convert.ToInt16(numericUpDown_AGC3.Value * 100);
|
|
659
|
|
- AGC[3] = Convert.ToInt16(numericUpDown_AGC4.Value * 100);
|
|
|
667
|
+ ALC_MIN[0] = Convert.ToInt16(numericUpDown_ALC1_MIN.Value * 100);
|
|
|
668
|
+ ALC_MIN[1] = Convert.ToInt16(numericUpDown_AGC2_MIN.Value * 100);
|
|
|
669
|
+ ALC_MIN[2] = Convert.ToInt16(numericUpDown_AGC3_MIN.Value * 100);
|
|
|
670
|
+ ALC_MIN[3] = Convert.ToInt16(numericUpDown_AGC4_MIN.Value * 100);
|
|
660
|
671
|
|
|
661
|
672
|
|
|
662
|
673
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
|
|
@@ -680,21 +691,22 @@ namespace Jdas_Mbic
|
|
680
|
691
|
}
|
|
681
|
692
|
for (int i = 8; i < 12; i++)
|
|
682
|
693
|
{
|
|
683
|
|
- tmp_H = Convert.ToByte((ALC[i - 8] & 0xFF00) >> 8);
|
|
684
|
|
- tmp_L = Convert.ToByte((ALC[i - 8] & 0x00FF));
|
|
|
694
|
+ tmp_H = Convert.ToByte((ALC_MAX[i - 8] & 0xFF00) >> 8);
|
|
|
695
|
+ tmp_L = Convert.ToByte((ALC_MAX[i - 8] & 0x00FF));
|
|
685
|
696
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i * 2] = tmp_H;
|
|
686
|
697
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i * 2 + 1] = tmp_L;
|
|
687
|
698
|
}
|
|
688
|
699
|
for (int i = 12; i < 16; i++)
|
|
689
|
700
|
{
|
|
690
|
|
- tmp_H = Convert.ToByte((AGC[i - 12] & 0xFF00) >> 8);
|
|
691
|
|
- tmp_L = Convert.ToByte((AGC[i - 12] & 0x00FF));
|
|
|
701
|
+ tmp_H = Convert.ToByte((ALC_MIN[i - 12] & 0xFF00) >> 8);
|
|
|
702
|
+ tmp_L = Convert.ToByte((ALC_MIN[i - 12] & 0x00FF));
|
|
692
|
703
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i * 2] = tmp_H;
|
|
693
|
704
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i * 2 + 1] = tmp_L;
|
|
694
|
705
|
}
|
|
695
|
706
|
|
|
696
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 31] = 1; //CRC
|
|
|
707
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 16 * 2] = 1; //CRC
|
|
697
|
708
|
serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
|
709
|
+ ReqTimer_Cnt = 0;
|
|
698
|
710
|
}
|
|
699
|
711
|
|
|
700
|
712
|
private void pictureBox_ATT_PATH_Ctrl_Click(object sender, EventArgs e)
|
|
|
@@ -702,6 +714,7 @@ namespace Jdas_Mbic
|
|
702
|
714
|
byte[] temp_buf = new byte[BLUECELL_RESET_LENGTH];
|
|
703
|
715
|
PictureBox pictureBox = (PictureBox)sender;
|
|
704
|
716
|
DATATYPE datatype = DATATYPE.ATTSET;
|
|
|
717
|
+ ReqTimer_Cnt = 0;
|
|
705
|
718
|
switch (pictureBox.Name)
|
|
706
|
719
|
{
|
|
707
|
720
|
case "pictureBox_DL1_PATH_OFF":
|
|
|
@@ -1210,22 +1223,40 @@ namespace Jdas_Mbic
|
|
1210
|
1223
|
ATT_ALC3_ONOFF,
|
|
1211
|
1224
|
ATT_AGC4_ONOFF,
|
|
1212
|
1225
|
ATT_ALC4_ONOFF,
|
|
1213
|
|
- ATT_ALC1_H,
|
|
1214
|
|
- ATT_ALC1_L,
|
|
1215
|
|
- ATT_ALC2_H,
|
|
1216
|
|
- ATT_ALC2_L,
|
|
1217
|
|
- ATT_ALC3_H,
|
|
1218
|
|
- ATT_ALC3_L,
|
|
1219
|
|
- ATT_ALC4_H,
|
|
1220
|
|
- ATT_ALC4_L,
|
|
1221
|
|
- ATT_AGC1_H,
|
|
1222
|
|
- ATT_AGC1_L,
|
|
1223
|
|
- ATT_AGC2_H,
|
|
1224
|
|
- ATT_AGC2_L,
|
|
1225
|
|
- ATT_AGC3_H,
|
|
1226
|
|
- ATT_AGC3_L,
|
|
1227
|
|
- ATT_AGC4_H,
|
|
1228
|
|
- ATT_AGC4_L,
|
|
|
1226
|
+ ATT_ALC1_MAX_H,
|
|
|
1227
|
+ ATT_ALC1_MAX_L,
|
|
|
1228
|
+ ATT_ALC2_MAX_H,
|
|
|
1229
|
+ ATT_ALC2_MAX_L,
|
|
|
1230
|
+ ATT_ALC3_MAX_H,
|
|
|
1231
|
+ ATT_ALC3_MAX_L,
|
|
|
1232
|
+ ATT_ALC4_MAX_H,
|
|
|
1233
|
+ ATT_ALC4_MAX_L,
|
|
|
1234
|
+ ATT_ALC1_MIN_H,
|
|
|
1235
|
+ ATT_ALC1_MIN_L,
|
|
|
1236
|
+ ATT_ALC2_MIN_H,
|
|
|
1237
|
+ ATT_ALC2_MIN_L,
|
|
|
1238
|
+ ATT_ALC3_MIN_H,
|
|
|
1239
|
+ ATT_ALC3_MIN_L,
|
|
|
1240
|
+ ATT_ALC4_MIN_H,
|
|
|
1241
|
+ ATT_ALC4_MIN_L,
|
|
|
1242
|
+ ATT_USER_DL1_H,
|
|
|
1243
|
+ ATT_USER_DL1_L,
|
|
|
1244
|
+ ATT_USER_DL2_H,
|
|
|
1245
|
+ ATT_USER_DL2_L,
|
|
|
1246
|
+ ATT_USER_DL3_H,
|
|
|
1247
|
+ ATT_USER_DL3_L,
|
|
|
1248
|
+ ATT_USER_DL4_H,
|
|
|
1249
|
+ ATT_USER_DL4_L,
|
|
|
1250
|
+ ATT_USER_UL1_H,
|
|
|
1251
|
+ ATT_USER_UL1_L,
|
|
|
1252
|
+ ATT_USER_UL2_H,
|
|
|
1253
|
+ ATT_USER_UL2_L,
|
|
|
1254
|
+ ATT_USER_UL3_H,
|
|
|
1255
|
+ ATT_USER_UL3_L,
|
|
|
1256
|
+ ATT_USER_UL4_H,
|
|
|
1257
|
+ ATT_USER_UL4_L,
|
|
|
1258
|
+ ATT_USER_TEMP_H,
|
|
|
1259
|
+ ATT_USER_TEMP_L,
|
|
1229
|
1260
|
bluecell_crc,
|
|
1230
|
1261
|
};
|
|
1231
|
1262
|
const byte Reqdatastartindex = 4;
|
|
|
@@ -1240,6 +1271,16 @@ namespace Jdas_Mbic
|
|
1240
|
1271
|
TextBox Temp_label = (TextBox)label;
|
|
1241
|
1272
|
Temp_label.Text = str;
|
|
1242
|
1273
|
}
|
|
|
1274
|
+ private void String_Text_Set(object label, String str)
|
|
|
1275
|
+ {
|
|
|
1276
|
+ String Temp_label = (String)label;
|
|
|
1277
|
+ Temp_label = str;
|
|
|
1278
|
+ }
|
|
|
1279
|
+ private void Label_Text_Set(object label, String str)
|
|
|
1280
|
+ {
|
|
|
1281
|
+ Label Temp_label = (Label)label;
|
|
|
1282
|
+ Temp_label.Text = str;
|
|
|
1283
|
+ }
|
|
1243
|
1284
|
private void Table_Text_Set(object label, String str)
|
|
1244
|
1285
|
{
|
|
1245
|
1286
|
label = str;
|
|
|
@@ -1254,10 +1295,65 @@ namespace Jdas_Mbic
|
|
1254
|
1295
|
CheckBox Temp_pic = (CheckBox) label;
|
|
1255
|
1296
|
Temp_pic.Checked = set;
|
|
1256
|
1297
|
}
|
|
|
1298
|
+ private Double ADCValueTodBmConvert(object[] RefData, object[] AdcData, object Currdata)
|
|
|
1299
|
+ {
|
|
|
1300
|
+ object data = Currdata;
|
|
|
1301
|
+ Double ret = 0xFF,Currentret = 0;
|
|
|
1302
|
+ int LastIndex = 0;
|
|
|
1303
|
+ for(int i = 0; i < AdcData.Length; i++)
|
|
|
1304
|
+ {
|
|
|
1305
|
+ Currentret = Convert.ToDouble(AdcData[i]) - Convert.ToDouble(data);
|
|
|
1306
|
+ if(Currentret < 0)
|
|
|
1307
|
+ {
|
|
|
1308
|
+ Currentret = (Currentret * -2) + Currentret;
|
|
|
1309
|
+ }
|
|
|
1310
|
+ if (ret > Currentret)
|
|
|
1311
|
+ {
|
|
|
1312
|
+ ret = Currentret;
|
|
|
1313
|
+ LastIndex = i;
|
|
|
1314
|
+ }
|
|
|
1315
|
+ }
|
|
|
1316
|
+ return Convert.ToDouble(RefData[LastIndex]);
|
|
|
1317
|
+ }
|
|
|
1318
|
+ private double DET_Table_Apply(object label)
|
|
|
1319
|
+ {
|
|
|
1320
|
+ TextBox Temp_TextBox = (TextBox)label;
|
|
|
1321
|
+ double ret = 0;
|
|
|
1322
|
+ switch(Temp_TextBox.Name)
|
|
|
1323
|
+ {
|
|
|
1324
|
+ case "textBox_DET_DL1":
|
|
|
1325
|
+ ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL1_Table, textBox_DET_DL1.Text);
|
|
|
1326
|
+ break;
|
|
|
1327
|
+ case "textBox_DET_DL2":
|
|
|
1328
|
+ ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL2_Table, textBox_DET_DL2.Text);
|
|
|
1329
|
+ break;
|
|
|
1330
|
+ case "textBox_DET_DL3":
|
|
|
1331
|
+ ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL3_Table, textBox_DET_DL3.Text);
|
|
|
1332
|
+ break;
|
|
|
1333
|
+ case "textBox_DET_DL4":
|
|
|
1334
|
+ ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL4_Table, textBox_DET_DL4.Text);
|
|
|
1335
|
+ break;
|
|
|
1336
|
+
|
|
|
1337
|
+ case "textBox_DET_UL1":
|
|
|
1338
|
+ ret = ADCValueTodBmConvert(DET_UL1_RefTable, DET_UL1_Table, textBox_DET_UL1.Text);
|
|
|
1339
|
+ break;
|
|
|
1340
|
+ case "textBox_DET_UL2":
|
|
|
1341
|
+ ret = ADCValueTodBmConvert(DET_UL2_RefTable, DET_UL2_Table, textBox_DET_UL2.Text);
|
|
|
1342
|
+ break;
|
|
|
1343
|
+ case "textBox_DET_UL3":
|
|
|
1344
|
+ ret = ADCValueTodBmConvert(DET_UL3_RefTable, DET_UL3_Table, textBox_DET_UL3.Text);
|
|
|
1345
|
+ break;
|
|
|
1346
|
+ case "textBox_DET_UL4":
|
|
|
1347
|
+ ret = ADCValueTodBmConvert(DET_UL4_RefTable, DET_UL4_Table, textBox_DET_UL4.Text);
|
|
|
1348
|
+ break;
|
|
|
1349
|
+ }
|
|
|
1350
|
+ return ret;
|
|
|
1351
|
+ }
|
|
1257
|
1352
|
public void GUIDataStatusSet(byte[] buf)
|
|
1258
|
1353
|
{
|
|
1259
|
1354
|
double Volt_Calc_val = 3.3 / 4095;
|
|
1260
|
1355
|
double adcdata = 0;
|
|
|
1356
|
+ double dBmdata = 0;
|
|
1261
|
1357
|
if (buf[(int)BluecellReqIndex.Selftest0] == 0)
|
|
1262
|
1358
|
{
|
|
1263
|
1359
|
this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest1_ON, false);// = false;
|
|
|
@@ -1288,7 +1384,7 @@ namespace Jdas_Mbic
|
|
1288
|
1384
|
}
|
|
1289
|
1385
|
else
|
|
1290
|
1386
|
{
|
|
1291
|
|
- this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest2_OFF, false);// = false;
|
|
|
1387
|
+ this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest3_OFF, false);// = false;
|
|
1292
|
1388
|
this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest3_ON, true);// = false;
|
|
1293
|
1389
|
}
|
|
1294
|
1390
|
|
|
|
@@ -1388,8 +1484,8 @@ namespace Jdas_Mbic
|
|
1388
|
1484
|
this.Invoke(new SWVisible(CheckBoxVisible_Text_Set), checkBox_Fix, IamSetting_Get());// = false;
|
|
1389
|
1485
|
if (IamSetting_Get() == false)
|
|
1390
|
1486
|
{
|
|
1391
|
|
- this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest1_ON, false);// = false;
|
|
1392
|
|
- this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest1_OFF, true);// = false;
|
|
|
1487
|
+ //this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest1_ON, false);// = false;
|
|
|
1488
|
+ //this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_SelfTest1_OFF, true);// = false;
|
|
1393
|
1489
|
adcdata = 0;
|
|
1394
|
1490
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_DL1_H] << 8) & 0xFF00);
|
|
1395
|
1491
|
adcdata += (buf[(int)BluecellReqIndex.ATT_DL1_L] & 0x00FF);
|
|
|
@@ -1433,111 +1529,274 @@ namespace Jdas_Mbic
|
|
1433
|
1529
|
adcdata /= 100;
|
|
1434
|
1530
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_UL4, adcdata.ToString("N2"));
|
|
1435
|
1531
|
adcdata = 0;
|
|
1436
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_AGC1_H] << 8) & 0xFF00);
|
|
1437
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_AGC1_L] & 0x00FF);
|
|
|
1532
|
+
|
|
|
1533
|
+
|
|
|
1534
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC1_MIN_H] << 8) & 0xFF00);
|
|
|
1535
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC1_MIN_L] & 0x00FF);
|
|
|
1536
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1537
|
+ {
|
|
|
1538
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1539
|
+ adcdata *= -1;
|
|
|
1540
|
+ }
|
|
|
1541
|
+ adcdata /= 100;
|
|
|
1542
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC1_MIN, adcdata.ToString("N2"));
|
|
|
1543
|
+
|
|
|
1544
|
+
|
|
|
1545
|
+
|
|
|
1546
|
+ adcdata = 0;
|
|
|
1547
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC2_MIN_H] << 8) & 0xFF00);
|
|
|
1548
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC2_MIN_L] & 0x00FF);
|
|
|
1549
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1550
|
+ {
|
|
|
1551
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1552
|
+ adcdata *= -1;
|
|
|
1553
|
+ }
|
|
|
1554
|
+ adcdata /= 100;
|
|
|
1555
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC2_MIN, adcdata.ToString("N2"));
|
|
|
1556
|
+ adcdata = 0;
|
|
|
1557
|
+
|
|
|
1558
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC3_MIN_H] << 8) & 0xFF00);
|
|
|
1559
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC3_MIN_L] & 0x00FF);
|
|
|
1560
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1561
|
+ {
|
|
|
1562
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1563
|
+ adcdata *= -1;
|
|
|
1564
|
+ }
|
|
|
1565
|
+ adcdata /= 100;
|
|
|
1566
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC3_MIN, adcdata.ToString("N2"));
|
|
|
1567
|
+ adcdata = 0;
|
|
|
1568
|
+
|
|
|
1569
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC4_MIN_H] << 8) & 0xFF00);
|
|
|
1570
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC4_MIN_L] & 0x00FF);
|
|
|
1571
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1572
|
+ {
|
|
|
1573
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1574
|
+ adcdata *= -1;
|
|
|
1575
|
+ }
|
|
|
1576
|
+ adcdata /= 100;
|
|
|
1577
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC4_MIN, adcdata.ToString("N2"));
|
|
|
1578
|
+ adcdata = 0;
|
|
|
1579
|
+
|
|
|
1580
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC1_MAX_H] << 8) & 0xFF00);
|
|
|
1581
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC1_MAX_L] & 0x00FF);
|
|
|
1582
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1583
|
+ {
|
|
|
1584
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1585
|
+ adcdata *= -1;
|
|
|
1586
|
+ }
|
|
|
1587
|
+ adcdata /= 100;
|
|
|
1588
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC1_MAX, adcdata.ToString("N2"));
|
|
|
1589
|
+ adcdata = 0;
|
|
|
1590
|
+
|
|
|
1591
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC2_MAX_H] << 8) & 0xFF00);
|
|
|
1592
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC2_MAX_L] & 0x00FF);
|
|
|
1593
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1594
|
+ {
|
|
|
1595
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1596
|
+ adcdata *= -1;
|
|
|
1597
|
+ }
|
|
|
1598
|
+ adcdata /= 100;
|
|
|
1599
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC2_MAX, adcdata.ToString("N2"));
|
|
|
1600
|
+ adcdata = 0;
|
|
|
1601
|
+
|
|
|
1602
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC3_MAX_H] << 8) & 0xFF00);
|
|
|
1603
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC3_MAX_L] & 0x00FF);
|
|
|
1604
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1605
|
+ {
|
|
|
1606
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1607
|
+ adcdata *= -1;
|
|
|
1608
|
+ }
|
|
|
1609
|
+ adcdata /= 100;
|
|
|
1610
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC3_MAX, adcdata.ToString("N2"));
|
|
|
1611
|
+ adcdata = 0;
|
|
|
1612
|
+
|
|
|
1613
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC4_MAX_H] << 8) & 0xFF00);
|
|
|
1614
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_ALC4_MAX_L] & 0x00FF);
|
|
|
1615
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1616
|
+ {
|
|
|
1617
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1618
|
+ adcdata *= -1;
|
|
|
1619
|
+ }
|
|
|
1620
|
+ adcdata /= 100;
|
|
|
1621
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC4_MAX, adcdata.ToString("N2"));
|
|
|
1622
|
+ adcdata = 0;
|
|
|
1623
|
+
|
|
|
1624
|
+
|
|
|
1625
|
+
|
|
|
1626
|
+
|
|
|
1627
|
+
|
|
|
1628
|
+
|
|
|
1629
|
+
|
|
|
1630
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_DL1_H] << 8) & 0xFF00);
|
|
|
1631
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_DL1_L] & 0x00FF);
|
|
|
1632
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1633
|
+ {
|
|
|
1634
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1635
|
+ adcdata *= -1;
|
|
|
1636
|
+ }
|
|
1438
|
1637
|
adcdata /= 100;
|
|
1439
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC1, adcdata.ToString("N2"));
|
|
|
1638
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL1_User, adcdata.ToString("N2"));
|
|
1440
|
1639
|
adcdata = 0;
|
|
1441
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_AGC2_H] << 8) & 0xFF00);
|
|
1442
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_AGC2_L] & 0x00FF);
|
|
|
1640
|
+
|
|
|
1641
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_DL2_H] << 8) & 0xFF00);
|
|
|
1642
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_DL2_L] & 0x00FF);
|
|
|
1643
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1644
|
+ {
|
|
|
1645
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1646
|
+ adcdata *= -1;
|
|
|
1647
|
+ }
|
|
1443
|
1648
|
adcdata /= 100;
|
|
1444
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC2, adcdata.ToString("N2"));
|
|
|
1649
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL2_User, adcdata.ToString("N2"));
|
|
1445
|
1650
|
adcdata = 0;
|
|
1446
|
1651
|
|
|
1447
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_AGC3_H] << 8) & 0xFF00);
|
|
1448
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_AGC3_L] & 0x00FF);
|
|
|
1652
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_DL3_H] << 8) & 0xFF00);
|
|
|
1653
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_DL3_L] & 0x00FF);
|
|
|
1654
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1655
|
+ {
|
|
|
1656
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1657
|
+ adcdata *= -1;
|
|
|
1658
|
+ }
|
|
1449
|
1659
|
adcdata /= 100;
|
|
1450
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC3, adcdata.ToString("N2"));
|
|
|
1660
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL3_User, adcdata.ToString("N2"));
|
|
1451
|
1661
|
adcdata = 0;
|
|
1452
|
1662
|
|
|
1453
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_AGC4_H] << 8) & 0xFF00);
|
|
1454
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_AGC4_L] & 0x00FF);
|
|
|
1663
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_DL4_H] << 8) & 0xFF00);
|
|
|
1664
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_DL4_L] & 0x00FF);
|
|
|
1665
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1666
|
+ {
|
|
|
1667
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1668
|
+ adcdata *= -1;
|
|
|
1669
|
+ }
|
|
1455
|
1670
|
adcdata /= 100;
|
|
1456
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC4, adcdata.ToString("N2"));
|
|
|
1671
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL4_User, adcdata.ToString("N2"));
|
|
1457
|
1672
|
adcdata = 0;
|
|
1458
|
1673
|
|
|
1459
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC1_H] << 8) & 0xFF00);
|
|
1460
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_ALC1_L] & 0x00FF);
|
|
|
1674
|
+
|
|
|
1675
|
+
|
|
|
1676
|
+
|
|
|
1677
|
+
|
|
|
1678
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_UL1_H] << 8) & 0xFF00);
|
|
|
1679
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_UL1_L] & 0x00FF);
|
|
|
1680
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1681
|
+ {
|
|
|
1682
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1683
|
+ adcdata *= -1;
|
|
|
1684
|
+ }
|
|
1461
|
1685
|
adcdata /= 100;
|
|
1462
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC1, adcdata.ToString("N2"));
|
|
|
1686
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL1_User, adcdata.ToString("N2"));
|
|
1463
|
1687
|
adcdata = 0;
|
|
1464
|
1688
|
|
|
1465
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC2_H] << 8) & 0xFF00);
|
|
1466
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_ALC2_L] & 0x00FF);
|
|
|
1689
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_UL2_H] << 8) & 0xFF00);
|
|
|
1690
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_UL2_L] & 0x00FF);
|
|
|
1691
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1692
|
+ {
|
|
|
1693
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1694
|
+ adcdata *= -1;
|
|
|
1695
|
+ }
|
|
1467
|
1696
|
adcdata /= 100;
|
|
1468
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC2, adcdata.ToString("N2"));
|
|
|
1697
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL2_User, adcdata.ToString("N2"));
|
|
1469
|
1698
|
adcdata = 0;
|
|
1470
|
1699
|
|
|
1471
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC3_H] << 8) & 0xFF00);
|
|
1472
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_ALC3_L] & 0x00FF);
|
|
|
1700
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_UL3_H] << 8) & 0xFF00);
|
|
|
1701
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_UL3_L] & 0x00FF);
|
|
|
1702
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1703
|
+ {
|
|
|
1704
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1705
|
+ adcdata *= -1;
|
|
|
1706
|
+ }
|
|
1473
|
1707
|
adcdata /= 100;
|
|
1474
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC3, adcdata.ToString("N2"));
|
|
|
1708
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL3_User, adcdata.ToString("N2"));
|
|
1475
|
1709
|
adcdata = 0;
|
|
1476
|
1710
|
|
|
1477
|
|
- adcdata += ((buf[(int)BluecellReqIndex.ATT_ALC4_H] << 8) & 0xFF00);
|
|
1478
|
|
- adcdata += (buf[(int)BluecellReqIndex.ATT_ALC4_L] & 0x00FF);
|
|
|
1711
|
+ adcdata += ((buf[(int)BluecellReqIndex.ATT_USER_UL4_H] << 8) & 0xFF00);
|
|
|
1712
|
+ adcdata += (buf[(int)BluecellReqIndex.ATT_USER_UL4_L] & 0x00FF);
|
|
|
1713
|
+ if ((((int)(adcdata) & 0xFF00) & 0xF000) == 0xF000)
|
|
|
1714
|
+ {
|
|
|
1715
|
+ adcdata = (0xffff - adcdata) + 1;
|
|
|
1716
|
+ adcdata *= -1;
|
|
|
1717
|
+ }
|
|
1479
|
1718
|
adcdata /= 100;
|
|
1480
|
|
- this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC4, adcdata.ToString("N2"));
|
|
|
1719
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL4_User, adcdata.ToString("N2"));
|
|
1481
|
1720
|
adcdata = 0;
|
|
1482
|
1721
|
|
|
1483
|
1722
|
|
|
1484
|
1723
|
|
|
|
1724
|
+
|
|
1485
|
1725
|
}
|
|
1486
|
1726
|
adcdata = 0;
|
|
1487
|
1727
|
adcdata = ((buf[(int)BluecellReqIndex.DET_DL1_IN_H] << 8) & 0xFF00);
|
|
1488
|
1728
|
adcdata += (buf[(int)BluecellReqIndex.DET_DL1_IN_L] & 0x00FF);
|
|
1489
|
1729
|
adcdata *= Volt_Calc_val;
|
|
1490
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL1, adcdata.ToString("N2"));
|
|
|
1730
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL1, adcdata.ToString("N3"));
|
|
|
1731
|
+ dBmdata = DET_Table_Apply(textBox_DET_DL1);
|
|
|
1732
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL1_dBm, dBmdata.ToString("N3"));
|
|
|
1733
|
+ //this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL1_dBm, adcdata.ToString("N2"));
|
|
1491
|
1734
|
adcdata = 0;
|
|
1492
|
1735
|
|
|
1493
|
1736
|
adcdata = ((buf[(int)BluecellReqIndex.DET_DL2_IN_H] << 8) & 0xFF00);
|
|
1494
|
1737
|
adcdata += (buf[(int)BluecellReqIndex.DET_DL2_IN_L] & 0x00FF);
|
|
1495
|
1738
|
adcdata *= Volt_Calc_val;
|
|
1496
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL2, adcdata.ToString("N2"));
|
|
|
1739
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL2, adcdata.ToString("N3"));
|
|
|
1740
|
+ dBmdata = DET_Table_Apply(textBox_DET_DL2);
|
|
|
1741
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL2_dBm, dBmdata.ToString("N3"));
|
|
1497
|
1742
|
adcdata = 0;
|
|
1498
|
1743
|
|
|
1499
|
1744
|
adcdata = ((buf[(int)BluecellReqIndex.DET_DL3_IN_H] << 8) & 0xFF00);
|
|
1500
|
1745
|
adcdata += (buf[(int)BluecellReqIndex.DET_DL3_IN_L] & 0x00FF);
|
|
1501
|
1746
|
adcdata *= Volt_Calc_val;
|
|
1502
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL3, adcdata.ToString("N2"));
|
|
|
1747
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL3, adcdata.ToString("N3"));
|
|
|
1748
|
+ dBmdata = DET_Table_Apply(textBox_DET_DL3);
|
|
|
1749
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL3_dBm, dBmdata.ToString("N3"));
|
|
1503
|
1750
|
adcdata = 0;
|
|
1504
|
1751
|
|
|
1505
|
1752
|
adcdata = ((buf[(int)BluecellReqIndex.DET_DL4_IN_H] << 8) & 0xFF00);
|
|
1506
|
1753
|
adcdata += (buf[(int)BluecellReqIndex.DET_DL4_IN_L] & 0x00FF);
|
|
1507
|
1754
|
adcdata *= Volt_Calc_val;
|
|
1508
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL4, adcdata.ToString("N2"));
|
|
|
1755
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL4, adcdata.ToString("N3"));
|
|
|
1756
|
+ dBmdata = DET_Table_Apply(textBox_DET_DL4);
|
|
|
1757
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_DL4_dBm, dBmdata.ToString("N3"));
|
|
1509
|
1758
|
adcdata = 0;
|
|
1510
|
1759
|
|
|
1511
|
1760
|
|
|
1512
|
1761
|
adcdata = ((buf[(int)BluecellReqIndex.DET_UL1_IN_H] << 8) & 0xFF00);
|
|
1513
|
1762
|
adcdata += (buf[(int)BluecellReqIndex.DET_UL1_IN_L] & 0x00FF);
|
|
1514
|
1763
|
adcdata *= Volt_Calc_val;
|
|
1515
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL1, adcdata.ToString("N2"));
|
|
|
1764
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL1, adcdata.ToString("N3"));
|
|
|
1765
|
+ dBmdata = DET_Table_Apply(textBox_DET_UL1);
|
|
|
1766
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL1_dBm, dBmdata.ToString("N3"));
|
|
1516
|
1767
|
adcdata = 0;
|
|
1517
|
1768
|
|
|
1518
|
1769
|
adcdata = ((buf[(int)BluecellReqIndex.DET_UL2_IN_H] << 8) & 0xFF00);
|
|
1519
|
1770
|
adcdata += (buf[(int)BluecellReqIndex.DET_UL2_IN_L] & 0x00FF);
|
|
1520
|
1771
|
adcdata *= Volt_Calc_val;
|
|
1521
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL2, adcdata.ToString("N2"));
|
|
|
1772
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL2, adcdata.ToString("N3"));
|
|
|
1773
|
+ dBmdata = DET_Table_Apply(textBox_DET_UL2);
|
|
|
1774
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL2_dBm, dBmdata.ToString("N3"));
|
|
1522
|
1775
|
adcdata = 0;
|
|
1523
|
1776
|
|
|
1524
|
1777
|
adcdata = ((buf[(int)BluecellReqIndex.DET_UL3_IN_H] << 8) & 0xFF00);
|
|
1525
|
1778
|
adcdata += (buf[(int)BluecellReqIndex.DET_UL3_IN_L] & 0x00FF);
|
|
1526
|
1779
|
adcdata *= Volt_Calc_val;
|
|
1527
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL3, adcdata.ToString("N2"));
|
|
|
1780
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL3, adcdata.ToString("N3"));
|
|
|
1781
|
+ dBmdata = DET_Table_Apply(textBox_DET_UL3);
|
|
|
1782
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL3_dBm, dBmdata.ToString("N3"));
|
|
1528
|
1783
|
adcdata = 0;
|
|
1529
|
1784
|
|
|
1530
|
1785
|
adcdata = ((buf[(int)BluecellReqIndex.DET_UL4_IN_H] << 8) & 0xFF00);
|
|
1531
|
1786
|
adcdata += (buf[(int)BluecellReqIndex.DET_UL4_IN_L] & 0x00FF);
|
|
1532
|
1787
|
adcdata *= Volt_Calc_val;
|
|
1533
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL4, adcdata.ToString("N2"));
|
|
|
1788
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL4, adcdata.ToString("N3"));
|
|
|
1789
|
+ dBmdata = DET_Table_Apply(textBox_DET_UL4);
|
|
|
1790
|
+ this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL4_dBm, dBmdata.ToString("N3"));
|
|
1534
|
1791
|
adcdata = 0;
|
|
1535
|
1792
|
|
|
1536
|
|
- /*adcdata += ((buf[(int)BluecellReqIndex.DET_TEMP_H] << 8) & 0xFF00);
|
|
|
1793
|
+ adcdata += ((buf[(int)BluecellReqIndex.DET_TEMP_H] << 8) & 0xFF00);
|
|
1537
|
1794
|
adcdata += (buf[(int)BluecellReqIndex.DET_TEMP_L] & 0x00FF);
|
|
1538
|
|
- adcdata *= Volt_Calc_val;
|
|
1539
|
|
- this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL1, adcdata.ToString("N2"));
|
|
1540
|
|
- adcdata = 0;*/
|
|
|
1795
|
+ adcdata = adcdata * 3.0 / 4096;
|
|
|
1796
|
+ adcdata = (adcdata - 0.5) * 100;
|
|
|
1797
|
+
|
|
|
1798
|
+ this.Invoke(new StringSend(Label_Text_Set), label_Temp, adcdata.ToString("N2") + "°C");
|
|
|
1799
|
+ adcdata = 0;
|
|
1541
|
1800
|
|
|
1542
|
1801
|
|
|
1543
|
1802
|
|
|
|
@@ -1627,8 +1886,116 @@ namespace Jdas_Mbic
|
|
1627
|
1886
|
this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_ALC4_OFF, false);// = false;
|
|
1628
|
1887
|
this.Invoke(new SWVisible(PicVisible_Text_Set), pictureBox_ALC4_ON, true);// = false;
|
|
1629
|
1888
|
}
|
|
|
1889
|
+ TableCurrentOutputSetting();
|
|
1630
|
1890
|
|
|
1631
|
1891
|
}
|
|
|
1892
|
+ private void TableCurrentOutputSetting()
|
|
|
1893
|
+ {
|
|
|
1894
|
+ ComboBox comboBox = (ComboBox)comboBox_TableName;
|
|
|
1895
|
+ CheckForIllegalCrossThreadCalls = false;
|
|
|
1896
|
+ string tempstr = comboBox_TableName.Text;
|
|
|
1897
|
+ //this.Invoke(new StringSend(String_Text_Set), tempstr, );
|
|
|
1898
|
+ switch (tempstr)
|
|
|
1899
|
+ {
|
|
|
1900
|
+ case "DET_DL1":
|
|
|
1901
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_DL1.Text);
|
|
|
1902
|
+ break;
|
|
|
1903
|
+ case "DET_DL2":
|
|
|
1904
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_DL2.Text);
|
|
|
1905
|
+ break;
|
|
|
1906
|
+ case "DET_DL3":
|
|
|
1907
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_DL3.Text);
|
|
|
1908
|
+ break;
|
|
|
1909
|
+ case "DET_DL4":
|
|
|
1910
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_DL4.Text);
|
|
|
1911
|
+ break;
|
|
|
1912
|
+ case "DET_UL1":
|
|
|
1913
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_UL1.Text);
|
|
|
1914
|
+ break;
|
|
|
1915
|
+ case "DET_UL2":
|
|
|
1916
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_UL2.Text);
|
|
|
1917
|
+ break;
|
|
|
1918
|
+ case "DET_UL3":
|
|
|
1919
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_UL3.Text);
|
|
|
1920
|
+ break;
|
|
|
1921
|
+ case "DET_UL4":
|
|
|
1922
|
+ this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_CurrentOutput, textBox_DET_UL4.Text);
|
|
|
1923
|
+ break;
|
|
|
1924
|
+
|
|
|
1925
|
+ default:
|
|
|
1926
|
+ //MessageBox.Show("존재하지 않는 ComboBox 입니다.\r\n 확인해주세요.");
|
|
|
1927
|
+ break;
|
|
|
1928
|
+ }
|
|
|
1929
|
+ }
|
|
|
1930
|
+ object[] DET_DL1_Table = new object[128];
|
|
|
1931
|
+ object[] DET_DL2_Table = new object[128];
|
|
|
1932
|
+ object[] DET_DL3_Table = new object[128];
|
|
|
1933
|
+ object[] DET_DL4_Table = new object[128];
|
|
|
1934
|
+
|
|
|
1935
|
+ object[] DET_UL1_Table = new object[128];
|
|
|
1936
|
+ object[] DET_UL2_Table = new object[128];
|
|
|
1937
|
+ object[] DET_UL3_Table = new object[128];
|
|
|
1938
|
+ object[] DET_UL4_Table = new object[128];
|
|
|
1939
|
+
|
|
|
1940
|
+ object[] DET_DL1_RefTable = new object[128];
|
|
|
1941
|
+ object[] DET_DL2_RefTable = new object[128];
|
|
|
1942
|
+ object[] DET_DL3_RefTable = new object[128];
|
|
|
1943
|
+ object[] DET_DL4_RefTable = new object[128];
|
|
|
1944
|
+
|
|
|
1945
|
+ object[] DET_UL1_RefTable = new object[128];
|
|
|
1946
|
+ object[] DET_UL2_RefTable = new object[128];
|
|
|
1947
|
+ object[] DET_UL3_RefTable = new object[128];
|
|
|
1948
|
+ object[] DET_UL4_RefTable = new object[128];
|
|
|
1949
|
+ private void DET_TableSetting(object Valueref,object Value,int index)
|
|
|
1950
|
+ {
|
|
|
1951
|
+ ComboBox comboBox = (ComboBox)comboBox_TableName;
|
|
|
1952
|
+ CheckForIllegalCrossThreadCalls = false;
|
|
|
1953
|
+ string tempstr = comboBox_TableName.Text;
|
|
|
1954
|
+ string Valuerefstr = "";
|
|
|
1955
|
+ Valuerefstr = Convert.ToString(Valueref);
|
|
|
1956
|
+ Valuerefstr = Valuerefstr.Replace(" dBm", "");
|
|
|
1957
|
+ Valueref = Valuerefstr;
|
|
|
1958
|
+
|
|
|
1959
|
+ //this.Invoke(new StringSend(String_Text_Set), tempstr, );
|
|
|
1960
|
+ switch (tempstr)
|
|
|
1961
|
+ {
|
|
|
1962
|
+ case "DET_DL1":
|
|
|
1963
|
+ DET_DL1_Table[index] = Value;
|
|
|
1964
|
+ DET_DL1_RefTable[index] = Valueref;
|
|
|
1965
|
+ break;
|
|
|
1966
|
+ case "DET_DL2":
|
|
|
1967
|
+ DET_DL2_Table[index] = Value;
|
|
|
1968
|
+ DET_DL2_RefTable[index] = Valueref;
|
|
|
1969
|
+ break;
|
|
|
1970
|
+ case "DET_DL3":
|
|
|
1971
|
+ DET_DL3_Table[index] = Value;
|
|
|
1972
|
+ DET_DL3_RefTable[index] = Valueref;
|
|
|
1973
|
+ break;
|
|
|
1974
|
+ case "DET_DL4":
|
|
|
1975
|
+ DET_DL4_Table[index] = Value;
|
|
|
1976
|
+ DET_DL4_RefTable[index] = Valueref;
|
|
|
1977
|
+ break;
|
|
|
1978
|
+ case "DET_UL1":
|
|
|
1979
|
+ DET_UL1_Table[index] = Value;
|
|
|
1980
|
+ DET_UL1_RefTable[index] = Valueref;
|
|
|
1981
|
+ break;
|
|
|
1982
|
+ case "DET_UL2":
|
|
|
1983
|
+ DET_UL2_Table[index] = Value;
|
|
|
1984
|
+ DET_UL2_RefTable[index] = Valueref;
|
|
|
1985
|
+ break;
|
|
|
1986
|
+ case "DET_UL3":
|
|
|
1987
|
+ DET_UL3_Table[index] = Value;
|
|
|
1988
|
+ DET_UL3_RefTable[index] = Valueref;
|
|
|
1989
|
+ break;
|
|
|
1990
|
+ case "DET_UL4":
|
|
|
1991
|
+ DET_UL4_Table[index] = Value;
|
|
|
1992
|
+ DET_UL4_RefTable[index] = Valueref;
|
|
|
1993
|
+ break;
|
|
|
1994
|
+ default:
|
|
|
1995
|
+ //MessageBox.Show("존재하지 않는 ComboBox 입니다.\r\n 확인해주세요.");
|
|
|
1996
|
+ break;
|
|
|
1997
|
+ }
|
|
|
1998
|
+ }
|
|
1632
|
1999
|
public void TableDataStatusSet(byte[] buf)
|
|
1633
|
2000
|
{
|
|
1634
|
2001
|
#if true
|
|
|
@@ -1639,8 +2006,16 @@ namespace Jdas_Mbic
|
|
1639
|
2006
|
TableValue <<= 8;
|
|
1640
|
2007
|
|
|
1641
|
2008
|
TableValue += buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i * 2 + 1];
|
|
1642
|
|
- ret = Convert.ToDouble(TableValue) / 100;
|
|
1643
|
|
- dataGridView_TableSetting[1, i].Value = ret.ToString("N2");
|
|
|
2009
|
+ if (comboBox_TableName.Text.Contains("DET") == true)
|
|
|
2010
|
+ ret = Convert.ToDouble(TableValue) / 1000;
|
|
|
2011
|
+ else
|
|
|
2012
|
+ ret = Convert.ToDouble(TableValue) / 100;
|
|
|
2013
|
+ try
|
|
|
2014
|
+ {
|
|
|
2015
|
+ dataGridView_TableSetting[1, i].Value = ret.ToString("N3");
|
|
|
2016
|
+ DET_TableSetting(dataGridView_TableSetting[0, i].Value, dataGridView_TableSetting[1, i].Value, i);
|
|
|
2017
|
+ }
|
|
|
2018
|
+ catch { }
|
|
1644
|
2019
|
//this.Invoke(new StringSend(Table_Text_Set), dataGridView_TableSetting[1, i].Value, TableValue.ToString("N2"));
|
|
1645
|
2020
|
}
|
|
1646
|
2021
|
|
|
|
@@ -1706,9 +2081,13 @@ namespace Jdas_Mbic
|
|
1706
|
2081
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableMaxLength - 2;
|
|
1707
|
2082
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)comboBox_TableName.SelectedIndex;
|
|
1708
|
2083
|
|
|
1709
|
|
- for(int i = 0; i < dataGridView_TableSetting.RowCount; i++)
|
|
|
2084
|
+ for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
|
|
1710
|
2085
|
{
|
|
1711
|
|
- ret = Convert.ToInt16(Convert.ToDouble(dataGridView_TableSetting[1, i].Value ) * 100);
|
|
|
2086
|
+ if (comboBox_TableName.Text.Contains("DET") == true)
|
|
|
2087
|
+ ret = Convert.ToInt16(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 1000);
|
|
|
2088
|
+ else {
|
|
|
2089
|
+ ret = Convert.ToInt16(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 100);
|
|
|
2090
|
+ }
|
|
1712
|
2091
|
tmp_h = Convert.ToByte((ret & 0xFF00) >> 8);
|
|
1713
|
2092
|
tmp_l = Convert.ToByte((ret & 0x00FF));
|
|
1714
|
2093
|
temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i * 2 ] = tmp_h;
|
|
|
@@ -1717,7 +2096,7 @@ namespace Jdas_Mbic
|
|
1717
|
2096
|
|
|
1718
|
2097
|
|
|
1719
|
2098
|
serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
1720
|
|
-
|
|
|
2099
|
+ ReqTimer_Cnt = 0;
|
|
1721
|
2100
|
}
|
|
1722
|
2101
|
const byte TableGetMaxLength = 1 + 6;
|
|
1723
|
2102
|
private void button_FileLoad_Click(object sender, EventArgs e)
|
|
|
@@ -1730,6 +2109,7 @@ namespace Jdas_Mbic
|
|
1730
|
2109
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableGetMaxLength - 2;
|
|
1731
|
2110
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)comboBox_TableName.SelectedIndex;
|
|
1732
|
2111
|
serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
|
2112
|
+ ReqTimer_Cnt = 0;
|
|
1733
|
2113
|
}
|
|
1734
|
2114
|
|
|
1735
|
2115
|
private void button_Save_Click(object sender, EventArgs e)
|
|
|
@@ -1742,7 +2122,85 @@ namespace Jdas_Mbic
|
|
1742
|
2122
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableGetMaxLength - 2;
|
|
1743
|
2123
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)1;
|
|
1744
|
2124
|
serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
|
2125
|
+ ReqTimer_Cnt = 0;
|
|
|
2126
|
+
|
|
|
2127
|
+ }
|
|
|
2128
|
+
|
|
|
2129
|
+ private void numericUpDown_User_KeyDown(object sender, KeyEventArgs e)
|
|
|
2130
|
+ {
|
|
|
2131
|
+ NumericUpDown numeric = (NumericUpDown)sender;
|
|
|
2132
|
+ const byte TableGetMaxLength = 8;
|
|
|
2133
|
+ byte tmp_H = 0;
|
|
|
2134
|
+ byte tmp_L = 0;
|
|
|
2135
|
+
|
|
|
2136
|
+ if (e.KeyCode == Keys.Enter)
|
|
|
2137
|
+ {
|
|
|
2138
|
+
|
|
|
2139
|
+ byte[] temp_buf = new byte[TableGetMaxLength];
|
|
|
2140
|
+
|
|
|
2141
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
|
|
2142
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] = TableGetMaxLength - 3;
|
|
|
2143
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableGetMaxLength - 2;
|
|
|
2144
|
+ Int16 UserData = Convert.ToInt16(numeric.Value * 100);
|
|
|
2145
|
+
|
|
|
2146
|
+ tmp_H = Convert.ToByte((UserData & 0xFF00) >> 8);
|
|
|
2147
|
+ tmp_L = Convert.ToByte((UserData & 0x00FF));
|
|
|
2148
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = tmp_H;
|
|
|
2149
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 1] = tmp_L;
|
|
|
2150
|
+ switch (numeric.Name)
|
|
|
2151
|
+ {
|
|
|
2152
|
+ case "numericUpDown_DL1_User":
|
|
|
2153
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2154
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DL1_USER;
|
|
|
2155
|
+ break;
|
|
|
2156
|
+ case "numericUpDown_DL2_User":
|
|
|
2157
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2158
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DL2_USER;
|
|
|
2159
|
+ break;
|
|
|
2160
|
+ case "numericUpDown_DL3_User":
|
|
|
2161
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2162
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DL3_USER;
|
|
|
2163
|
+ break;
|
|
|
2164
|
+ case "numericUpDown_DL4_User":
|
|
|
2165
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2166
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DL4_USER;
|
|
|
2167
|
+ break;
|
|
|
2168
|
+
|
|
|
2169
|
+ case "numericUpDown_UL1_User":
|
|
|
2170
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2171
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_UL1_USER;
|
|
|
2172
|
+ break;
|
|
|
2173
|
+ case "numericUpDown_UL2_User":
|
|
|
2174
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2175
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_UL2_USER;
|
|
|
2176
|
+ break;
|
|
|
2177
|
+ case "numericUpDown_UL3_User":
|
|
|
2178
|
+
|
|
|
2179
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2180
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_UL3_USER;
|
|
|
2181
|
+ break;
|
|
|
2182
|
+ case "numericUpDown_UL4_User":
|
|
|
2183
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2184
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_UL4_USER;
|
|
|
2185
|
+ break;
|
|
|
2186
|
+ case "numericUpDown_TEMP_User":
|
|
|
2187
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
|
2188
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_TEMP_USER;
|
|
|
2189
|
+ break;
|
|
|
2190
|
+ }
|
|
|
2191
|
+ serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
|
2192
|
+ ReqTimer_Cnt = 0;
|
|
1745
|
2193
|
|
|
|
2194
|
+ //to do
|
|
|
2195
|
+ }
|
|
|
2196
|
+ else if (e.KeyCode == Keys.Escape)
|
|
|
2197
|
+ {
|
|
|
2198
|
+ Activi_Change__Setting(null, null);
|
|
|
2199
|
+ }
|
|
|
2200
|
+ else
|
|
|
2201
|
+ {
|
|
|
2202
|
+ return;
|
|
|
2203
|
+ }
|
|
1746
|
2204
|
}
|
|
1747
|
2205
|
}
|
|
1748
|
2206
|
}
|