|
@@ -31,7 +31,33 @@ namespace Jdas_Mbic
|
31
|
31
|
DL_DET = 0,
|
32
|
32
|
UL_DET
|
33
|
33
|
};
|
34
|
|
-
|
|
34
|
+ enum MBIC_TableNumber
|
|
35
|
+ {
|
|
36
|
+ DLI_P1_Level_Table_Number = 0x00,
|
|
37
|
+ DLI_P2_Level_Table_Number = 0x01,
|
|
38
|
+ DLI_P3_Level_Table_Number = 0x02,
|
|
39
|
+ DLI_P4_Level_Table_Number = 0x03,
|
|
40
|
+ ULO_P1_Level_Table_Number = 0x10,
|
|
41
|
+ ULO_P2_Level_Table_Number = 0x11,
|
|
42
|
+ ULO_P3_Level_Table_Number = 0x12,
|
|
43
|
+ ULO_P4_Level_Table_Number = 0x13,
|
|
44
|
+ DLI_P1_ATT_Temp_guarantee_Table_Number = 0x20,
|
|
45
|
+ DLI_P2_ATT_Temp_guarantee_Table_Number = 0x21,
|
|
46
|
+ DLI_P3_ATT_Temp_guarantee_Table_Number = 0x22,
|
|
47
|
+ DLI_P4_ATT_Temp_guarantee_Table_Number = 0x23,
|
|
48
|
+ ULO_P1_ATT_Temp_guarantee_Table_Number = 0x30,
|
|
49
|
+ ULO_P2_ATT_Temp_guarantee_Table_Number = 0x31,
|
|
50
|
+ ULO_P3_ATT_Temp_guarantee_Table_Number = 0x32,
|
|
51
|
+ ULO_P4_ATT_Temp_guarantee_Table_Number = 0x33,
|
|
52
|
+ DLI_P1_ATT_Accuracy_Table_Number = 0x40,
|
|
53
|
+ DLI_P2_ATT_Accuracy_Table_Number = 0x41,
|
|
54
|
+ DLI_P3_ATT_Accuracy_Table_Number = 0x42,
|
|
55
|
+ DLI_P4_ATT_Accuracy_Table_Number = 0x43,
|
|
56
|
+ ULO_P1_ATT_Accuracy_Table_Number = 0x50,
|
|
57
|
+ ULO_P2_ATT_Accuracy_Table_Number = 0x51,
|
|
58
|
+ ULO_P3_ATT_Accuracy_Table_Number = 0x52,
|
|
59
|
+ ULO_P4_ATT_Accuracy_Table_Number = 0x53,
|
|
60
|
+ }
|
35
|
61
|
|
36
|
62
|
public JdasMbic()
|
37
|
63
|
{
|
|
@@ -146,6 +172,8 @@ namespace Jdas_Mbic
|
146
|
172
|
* TABLE Setting Area
|
147
|
173
|
*
|
148
|
174
|
*/
|
|
175
|
+
|
|
176
|
+
|
149
|
177
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
150
|
178
|
{
|
151
|
179
|
ComboBox comboBox = (ComboBox)sender;
|
|
@@ -194,7 +222,7 @@ namespace Jdas_Mbic
|
194
|
222
|
break;
|
195
|
223
|
}
|
196
|
224
|
|
197
|
|
- button_FileLoad_Click(null,null);
|
|
225
|
+ button_FileLoad_Click(sender, null);
|
198
|
226
|
}
|
199
|
227
|
private List<int> DataGridViewIndexOutput()
|
200
|
228
|
{
|
|
@@ -340,7 +368,7 @@ namespace Jdas_Mbic
|
340
|
368
|
private delegate void SWVisible(object label, bool set);
|
341
|
369
|
private delegate void GridviewSend(ref object gridview, string Text);
|
342
|
370
|
private delegate void ByteSend(byte[] Text);
|
343
|
|
-
|
|
371
|
+ private delegate String Stringreturn(object combobox);
|
344
|
372
|
int offset = 0;
|
345
|
373
|
byte[] rxBuffer;
|
346
|
374
|
#if false
|
|
@@ -652,25 +680,25 @@ namespace Jdas_Mbic
|
652
|
680
|
Int16[] ALC_MIN = new Int16[4];
|
653
|
681
|
byte tmp_H = 0;
|
654
|
682
|
byte tmp_L = 0;
|
655
|
|
- DL[0] = Convert.ToInt16(numericUpDown_ATT_DL1.Value * 100);
|
656
|
|
- DL[1] = Convert.ToInt16(numericUpDown_ATT_DL2.Value * 100);
|
657
|
|
- DL[2] = Convert.ToInt16(numericUpDown_ATT_DL3.Value * 100);
|
658
|
|
- DL[3] = Convert.ToInt16(numericUpDown_ATT_DL4.Value * 100);
|
|
683
|
+ DL[0] = Convert.ToInt16(numericUpDown_ATT_DL1.Value * 10);
|
|
684
|
+ DL[1] = Convert.ToInt16(numericUpDown_ATT_DL2.Value * 10);
|
|
685
|
+ DL[2] = Convert.ToInt16(numericUpDown_ATT_DL3.Value * 10);
|
|
686
|
+ DL[3] = Convert.ToInt16(numericUpDown_ATT_DL4.Value * 10);
|
659
|
687
|
|
660
|
|
- UL[0] = Convert.ToInt16(numericUpDown_ATT_UL1.Value * 100);
|
661
|
|
- UL[1] = Convert.ToInt16(numericUpDown_ATT_UL2.Value * 100);
|
662
|
|
- UL[2] = Convert.ToInt16(numericUpDown_ATT_UL3.Value * 100);
|
663
|
|
- UL[3] = Convert.ToInt16(numericUpDown_ATT_UL4.Value * 100);
|
|
688
|
+ UL[0] = Convert.ToInt16(numericUpDown_ATT_UL1.Value * 10);
|
|
689
|
+ UL[1] = Convert.ToInt16(numericUpDown_ATT_UL2.Value * 10);
|
|
690
|
+ UL[2] = Convert.ToInt16(numericUpDown_ATT_UL3.Value * 10);
|
|
691
|
+ UL[3] = Convert.ToInt16(numericUpDown_ATT_UL4.Value * 10);
|
664
|
692
|
|
665
|
|
- ALC_MAX[0] = Convert.ToInt16(numericUpDown_ALC1_MAX.Value * 100);
|
666
|
|
- ALC_MAX[1] = Convert.ToInt16(numericUpDown_ALC2_MAX.Value * 100);
|
667
|
|
- ALC_MAX[2] = Convert.ToInt16(numericUpDown_ALC3_MAX.Value * 100);
|
668
|
|
- ALC_MAX[3] = Convert.ToInt16(numericUpDown_ALC4_MAX.Value * 100);
|
|
693
|
+ ALC_MAX[0] = Convert.ToInt16(numericUpDown_ALC1_MAX.Value * 10);
|
|
694
|
+ ALC_MAX[1] = Convert.ToInt16(numericUpDown_ALC2_MAX.Value * 10);
|
|
695
|
+ ALC_MAX[2] = Convert.ToInt16(numericUpDown_ALC3_MAX.Value * 10);
|
|
696
|
+ ALC_MAX[3] = Convert.ToInt16(numericUpDown_ALC4_MAX.Value * 10);
|
669
|
697
|
|
670
|
|
- ALC_MIN[0] = Convert.ToInt16(numericUpDown_ALC1_MIN.Value * 100);
|
671
|
|
- ALC_MIN[1] = Convert.ToInt16(numericUpDown_AGC2_MIN.Value * 100);
|
672
|
|
- ALC_MIN[2] = Convert.ToInt16(numericUpDown_AGC3_MIN.Value * 100);
|
673
|
|
- ALC_MIN[3] = Convert.ToInt16(numericUpDown_AGC4_MIN.Value * 100);
|
|
698
|
+ ALC_MIN[0] = Convert.ToInt16(numericUpDown_ALC1_MIN.Value * 10);
|
|
699
|
+ ALC_MIN[1] = Convert.ToInt16(numericUpDown_AGC2_MIN.Value * 10);
|
|
700
|
+ ALC_MIN[2] = Convert.ToInt16(numericUpDown_AGC3_MIN.Value * 10);
|
|
701
|
+ ALC_MIN[3] = Convert.ToInt16(numericUpDown_AGC4_MIN.Value * 10);
|
674
|
702
|
|
675
|
703
|
|
676
|
704
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
|
@@ -1288,6 +1316,11 @@ namespace Jdas_Mbic
|
1288
|
1316
|
{
|
1289
|
1317
|
label = str;
|
1290
|
1318
|
}
|
|
1319
|
+ private String ComboBox_Text_Get(object data)
|
|
1320
|
+ {
|
|
1321
|
+ ComboBox Temp_data = (ComboBox)data;
|
|
1322
|
+ return Temp_data.Text;
|
|
1323
|
+ }
|
1291
|
1324
|
private void PicVisible_Text_Set(object label, bool set)
|
1292
|
1325
|
{
|
1293
|
1326
|
PictureBox Temp_pic = (PictureBox)label;
|
|
@@ -1298,25 +1331,58 @@ namespace Jdas_Mbic
|
1298
|
1331
|
CheckBox Temp_pic = (CheckBox) label;
|
1299
|
1332
|
Temp_pic.Checked = set;
|
1300
|
1333
|
}
|
1301
|
|
- private Double ADCValueTodBmConvert(object[] RefData, object[] AdcData, object Currdata)
|
|
1334
|
+ private Double ADCValueTodBmConvert(DataGridView table,object[] RefData, object[] AdcData, object Currdata)
|
1302
|
1335
|
{
|
1303
|
|
- object data = Currdata;
|
|
1336
|
+ /*
|
|
1337
|
+ * RefData : Dbm 값
|
|
1338
|
+ AdcData : Dbm과 매칭되어있는 ADC값
|
|
1339
|
+ Currdata : 현재 ADC 값
|
|
1340
|
+ */
|
|
1341
|
+ object data = Currdata; // 현재 ADC 값
|
|
1342
|
+ double[] Vitual_array = new double[10];
|
|
1343
|
+ double step = 0;
|
|
1344
|
+ double temp,temp1;
|
1304
|
1345
|
Double ret = 0xFF,Currentret = 0;
|
1305
|
1346
|
int LastIndex = 0;
|
1306
|
|
- for(int i = 0; i < AdcData.Length; i++)
|
|
1347
|
+ int dot = 0;
|
|
1348
|
+ for(int i = 0; i < table.RowCount; i++)
|
1307
|
1349
|
{
|
1308
|
|
- Currentret = Convert.ToDouble(AdcData[i]) - Convert.ToDouble(data);
|
1309
|
|
- if(Currentret < 0)
|
1310
|
|
- {
|
1311
|
|
- Currentret = (Currentret * -2) + Currentret;
|
1312
|
|
- }
|
1313
|
|
- if (ret > Currentret)
|
|
1350
|
+ try
|
1314
|
1351
|
{
|
1315
|
|
- ret = Currentret;
|
1316
|
|
- LastIndex = i;
|
|
1352
|
+ step = (Convert.ToDouble(AdcData[i]) - Convert.ToDouble(AdcData[i + 1])) / 10;
|
|
1353
|
+ for (int a = 0; a < 10; a++)
|
|
1354
|
+ {
|
|
1355
|
+ Vitual_array[a] = Convert.ToDouble(AdcData[i]) - (step * a);
|
|
1356
|
+ /*현재 ADC 값과 테이블의 ADC값의 모든값들을 마이너스 합 후 */
|
|
1357
|
+ Currentret = Convert.ToDouble(Vitual_array[a]) - Convert.ToDouble(data);
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+ /*만약 0보다 작을 시 절대값을 취해준다.*/
|
|
1361
|
+ if (Currentret < 0)
|
|
1362
|
+ {
|
|
1363
|
+ Currentret = (Currentret * -2) + Currentret;
|
|
1364
|
+ }
|
|
1365
|
+ /*만약 현재 결과 값이 이전 결과 값보다
|
|
1366
|
+ * 작을 경우 그값이 최종 결과 값이다.*/
|
|
1367
|
+ if (ret >= Currentret)
|
|
1368
|
+ {
|
|
1369
|
+ ret = Currentret;
|
|
1370
|
+ LastIndex = i;
|
|
1371
|
+ dot = a;
|
|
1372
|
+ }
|
|
1373
|
+ }
|
1317
|
1374
|
}
|
|
1375
|
+ catch { }
|
|
1376
|
+
|
|
1377
|
+
|
1318
|
1378
|
}
|
1319
|
|
- return Convert.ToDouble(RefData[LastIndex]);
|
|
1379
|
+ temp = Convert.ToDouble(AdcData[LastIndex]);
|
|
1380
|
+ temp1 = Convert.ToDouble(Currdata);
|
|
1381
|
+ if (temp1 < temp)
|
|
1382
|
+ return Convert.ToDouble(RefData[LastIndex + 1]) + (dot * 0.1);
|
|
1383
|
+ else
|
|
1384
|
+ return Convert.ToDouble(RefData[0]);
|
|
1385
|
+
|
1320
|
1386
|
}
|
1321
|
1387
|
private double DET_Table_Apply(object label)
|
1322
|
1388
|
{
|
|
@@ -1325,29 +1391,29 @@ namespace Jdas_Mbic
|
1325
|
1391
|
switch(Temp_TextBox.Name)
|
1326
|
1392
|
{
|
1327
|
1393
|
case "textBox_DET_DL1":
|
1328
|
|
- ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL1_Table, textBox_DET_DL1.Text);
|
|
1394
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting,DET_DL1_RefTable, DET_DL1_Table, textBox_DET_DL1.Text);
|
1329
|
1395
|
break;
|
1330
|
1396
|
case "textBox_DET_DL2":
|
1331
|
|
- ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL2_Table, textBox_DET_DL2.Text);
|
|
1397
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_DL1_RefTable, DET_DL2_Table, textBox_DET_DL2.Text);
|
1332
|
1398
|
break;
|
1333
|
1399
|
case "textBox_DET_DL3":
|
1334
|
|
- ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL3_Table, textBox_DET_DL3.Text);
|
|
1400
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_DL1_RefTable, DET_DL3_Table, textBox_DET_DL3.Text);
|
1335
|
1401
|
break;
|
1336
|
1402
|
case "textBox_DET_DL4":
|
1337
|
|
- ret = ADCValueTodBmConvert(DET_DL1_RefTable, DET_DL4_Table, textBox_DET_DL4.Text);
|
|
1403
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_DL1_RefTable, DET_DL4_Table, textBox_DET_DL4.Text);
|
1338
|
1404
|
break;
|
1339
|
1405
|
|
1340
|
1406
|
case "textBox_DET_UL1":
|
1341
|
|
- ret = ADCValueTodBmConvert(DET_UL1_RefTable, DET_UL1_Table, textBox_DET_UL1.Text);
|
|
1407
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_UL1_RefTable, DET_UL1_Table, textBox_DET_UL1.Text);
|
1342
|
1408
|
break;
|
1343
|
1409
|
case "textBox_DET_UL2":
|
1344
|
|
- ret = ADCValueTodBmConvert(DET_UL2_RefTable, DET_UL2_Table, textBox_DET_UL2.Text);
|
|
1410
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_UL2_RefTable, DET_UL2_Table, textBox_DET_UL2.Text);
|
1345
|
1411
|
break;
|
1346
|
1412
|
case "textBox_DET_UL3":
|
1347
|
|
- ret = ADCValueTodBmConvert(DET_UL3_RefTable, DET_UL3_Table, textBox_DET_UL3.Text);
|
|
1413
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_UL3_RefTable, DET_UL3_Table, textBox_DET_UL3.Text);
|
1348
|
1414
|
break;
|
1349
|
1415
|
case "textBox_DET_UL4":
|
1350
|
|
- ret = ADCValueTodBmConvert(DET_UL4_RefTable, DET_UL4_Table, textBox_DET_UL4.Text);
|
|
1416
|
+ ret = ADCValueTodBmConvert(dataGridView_TableSetting, DET_UL4_RefTable, DET_UL4_Table, textBox_DET_UL4.Text);
|
1351
|
1417
|
break;
|
1352
|
1418
|
}
|
1353
|
1419
|
return ret;
|
|
@@ -1493,17 +1559,17 @@ namespace Jdas_Mbic
|
1493
|
1559
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_DL1_H] << 8) & 0xFF00);
|
1494
|
1560
|
adcdata += (buf[(int)BluecellReqIndex.ATT_DL1_L] & 0x00FF);
|
1495
|
1561
|
|
1496
|
|
- adcdata /= 100;
|
|
1562
|
+ adcdata /= 10;
|
1497
|
1563
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_DL1, adcdata.ToString("N2"));
|
1498
|
1564
|
adcdata = 0;
|
1499
|
1565
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_DL2_H] << 8) & 0xFF00);
|
1500
|
1566
|
adcdata += (buf[(int)BluecellReqIndex.ATT_DL2_L] & 0x00FF);
|
1501
|
|
- adcdata /= 100;
|
|
1567
|
+ adcdata /= 10;
|
1502
|
1568
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_DL2, adcdata.ToString("N2"));
|
1503
|
1569
|
adcdata = 0;
|
1504
|
1570
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_DL3_H] << 8) & 0xFF00);
|
1505
|
1571
|
adcdata += (buf[(int)BluecellReqIndex.ATT_DL3_L] & 0x00FF);
|
1506
|
|
- adcdata /= 100;
|
|
1572
|
+ adcdata /= 10;
|
1507
|
1573
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_DL3, adcdata.ToString("N2"));
|
1508
|
1574
|
adcdata = 0;
|
1509
|
1575
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_DL4_H] << 8) & 0xFF00);
|
|
@@ -1514,12 +1580,12 @@ namespace Jdas_Mbic
|
1514
|
1580
|
|
1515
|
1581
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_UL1_H] << 8) & 0xFF00);
|
1516
|
1582
|
adcdata += (buf[(int)BluecellReqIndex.ATT_UL1_L] & 0x00FF);
|
1517
|
|
- adcdata /= 100;
|
|
1583
|
+ adcdata /= 10;
|
1518
|
1584
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_UL1, adcdata.ToString("N2"));
|
1519
|
1585
|
adcdata = 0;
|
1520
|
1586
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_UL2_H] << 8) & 0xFF00);
|
1521
|
1587
|
adcdata += (buf[(int)BluecellReqIndex.ATT_UL2_L] & 0x00FF);
|
1522
|
|
- adcdata /= 100;
|
|
1588
|
+ adcdata /= 10;
|
1523
|
1589
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_UL2, adcdata.ToString("N2"));
|
1524
|
1590
|
adcdata = 0;
|
1525
|
1591
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_UL3_H] << 8) & 0xFF00);
|
|
@@ -1529,7 +1595,7 @@ namespace Jdas_Mbic
|
1529
|
1595
|
adcdata = 0;
|
1530
|
1596
|
adcdata += ((buf[(int)BluecellReqIndex.ATT_UL4_H] << 8) & 0xFF00);
|
1531
|
1597
|
adcdata += (buf[(int)BluecellReqIndex.ATT_UL4_L] & 0x00FF);
|
1532
|
|
- adcdata /= 100;
|
|
1598
|
+ adcdata /= 10;
|
1533
|
1599
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ATT_UL4, adcdata.ToString("N2"));
|
1534
|
1600
|
adcdata = 0;
|
1535
|
1601
|
|
|
@@ -1541,7 +1607,7 @@ namespace Jdas_Mbic
|
1541
|
1607
|
adcdata = (0xffff - adcdata) + 1;
|
1542
|
1608
|
adcdata *= -1;
|
1543
|
1609
|
}
|
1544
|
|
- adcdata /= 100;
|
|
1610
|
+ adcdata /= 10;
|
1545
|
1611
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC1_MIN, adcdata.ToString("N2"));
|
1546
|
1612
|
|
1547
|
1613
|
|
|
@@ -1554,7 +1620,7 @@ namespace Jdas_Mbic
|
1554
|
1620
|
adcdata = (0xffff - adcdata) + 1;
|
1555
|
1621
|
adcdata *= -1;
|
1556
|
1622
|
}
|
1557
|
|
- adcdata /= 100;
|
|
1623
|
+ adcdata /= 10;
|
1558
|
1624
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC2_MIN, adcdata.ToString("N2"));
|
1559
|
1625
|
adcdata = 0;
|
1560
|
1626
|
|
|
@@ -1565,7 +1631,7 @@ namespace Jdas_Mbic
|
1565
|
1631
|
adcdata = (0xffff - adcdata) + 1;
|
1566
|
1632
|
adcdata *= -1;
|
1567
|
1633
|
}
|
1568
|
|
- adcdata /= 100;
|
|
1634
|
+ adcdata /= 10;
|
1569
|
1635
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC3_MIN, adcdata.ToString("N2"));
|
1570
|
1636
|
adcdata = 0;
|
1571
|
1637
|
|
|
@@ -1576,7 +1642,7 @@ namespace Jdas_Mbic
|
1576
|
1642
|
adcdata = (0xffff - adcdata) + 1;
|
1577
|
1643
|
adcdata *= -1;
|
1578
|
1644
|
}
|
1579
|
|
- adcdata /= 100;
|
|
1645
|
+ adcdata /= 10;
|
1580
|
1646
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_AGC4_MIN, adcdata.ToString("N2"));
|
1581
|
1647
|
adcdata = 0;
|
1582
|
1648
|
|
|
@@ -1587,7 +1653,7 @@ namespace Jdas_Mbic
|
1587
|
1653
|
adcdata = (0xffff - adcdata) + 1;
|
1588
|
1654
|
adcdata *= -1;
|
1589
|
1655
|
}
|
1590
|
|
- adcdata /= 100;
|
|
1656
|
+ adcdata /= 10;
|
1591
|
1657
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC1_MAX, adcdata.ToString("N2"));
|
1592
|
1658
|
adcdata = 0;
|
1593
|
1659
|
|
|
@@ -1598,7 +1664,7 @@ namespace Jdas_Mbic
|
1598
|
1664
|
adcdata = (0xffff - adcdata) + 1;
|
1599
|
1665
|
adcdata *= -1;
|
1600
|
1666
|
}
|
1601
|
|
- adcdata /= 100;
|
|
1667
|
+ adcdata /= 10;
|
1602
|
1668
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC2_MAX, adcdata.ToString("N2"));
|
1603
|
1669
|
adcdata = 0;
|
1604
|
1670
|
|
|
@@ -1609,7 +1675,7 @@ namespace Jdas_Mbic
|
1609
|
1675
|
adcdata = (0xffff - adcdata) + 1;
|
1610
|
1676
|
adcdata *= -1;
|
1611
|
1677
|
}
|
1612
|
|
- adcdata /= 100;
|
|
1678
|
+ adcdata /= 10;
|
1613
|
1679
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC3_MAX, adcdata.ToString("N2"));
|
1614
|
1680
|
adcdata = 0;
|
1615
|
1681
|
|
|
@@ -1620,7 +1686,7 @@ namespace Jdas_Mbic
|
1620
|
1686
|
adcdata = (0xffff - adcdata) + 1;
|
1621
|
1687
|
adcdata *= -1;
|
1622
|
1688
|
}
|
1623
|
|
- adcdata /= 100;
|
|
1689
|
+ adcdata /= 10;
|
1624
|
1690
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_ALC4_MAX, adcdata.ToString("N2"));
|
1625
|
1691
|
adcdata = 0;
|
1626
|
1692
|
|
|
@@ -1637,7 +1703,7 @@ namespace Jdas_Mbic
|
1637
|
1703
|
adcdata = (0xffff - adcdata) + 1;
|
1638
|
1704
|
adcdata *= -1;
|
1639
|
1705
|
}
|
1640
|
|
- adcdata /= 100;
|
|
1706
|
+ adcdata /= 10;
|
1641
|
1707
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL1_User, adcdata.ToString("N2"));
|
1642
|
1708
|
adcdata = 0;
|
1643
|
1709
|
|
|
@@ -1648,7 +1714,7 @@ namespace Jdas_Mbic
|
1648
|
1714
|
adcdata = (0xffff - adcdata) + 1;
|
1649
|
1715
|
adcdata *= -1;
|
1650
|
1716
|
}
|
1651
|
|
- adcdata /= 100;
|
|
1717
|
+ adcdata /= 10;
|
1652
|
1718
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL2_User, adcdata.ToString("N2"));
|
1653
|
1719
|
adcdata = 0;
|
1654
|
1720
|
|
|
@@ -1659,7 +1725,7 @@ namespace Jdas_Mbic
|
1659
|
1725
|
adcdata = (0xffff - adcdata) + 1;
|
1660
|
1726
|
adcdata *= -1;
|
1661
|
1727
|
}
|
1662
|
|
- adcdata /= 100;
|
|
1728
|
+ adcdata /= 10;
|
1663
|
1729
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL3_User, adcdata.ToString("N2"));
|
1664
|
1730
|
adcdata = 0;
|
1665
|
1731
|
|
|
@@ -1670,7 +1736,7 @@ namespace Jdas_Mbic
|
1670
|
1736
|
adcdata = (0xffff - adcdata) + 1;
|
1671
|
1737
|
adcdata *= -1;
|
1672
|
1738
|
}
|
1673
|
|
- adcdata /= 100;
|
|
1739
|
+ adcdata /= 10;
|
1674
|
1740
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_DL4_User, adcdata.ToString("N2"));
|
1675
|
1741
|
adcdata = 0;
|
1676
|
1742
|
|
|
@@ -1685,7 +1751,7 @@ namespace Jdas_Mbic
|
1685
|
1751
|
adcdata = (0xffff - adcdata) + 1;
|
1686
|
1752
|
adcdata *= -1;
|
1687
|
1753
|
}
|
1688
|
|
- adcdata /= 100;
|
|
1754
|
+ adcdata /= 10;
|
1689
|
1755
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL1_User, adcdata.ToString("N2"));
|
1690
|
1756
|
adcdata = 0;
|
1691
|
1757
|
|
|
@@ -1696,7 +1762,7 @@ namespace Jdas_Mbic
|
1696
|
1762
|
adcdata = (0xffff - adcdata) + 1;
|
1697
|
1763
|
adcdata *= -1;
|
1698
|
1764
|
}
|
1699
|
|
- adcdata /= 100;
|
|
1765
|
+ adcdata /= 10;
|
1700
|
1766
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL2_User, adcdata.ToString("N2"));
|
1701
|
1767
|
adcdata = 0;
|
1702
|
1768
|
|
|
@@ -1707,7 +1773,7 @@ namespace Jdas_Mbic
|
1707
|
1773
|
adcdata = (0xffff - adcdata) + 1;
|
1708
|
1774
|
adcdata *= -1;
|
1709
|
1775
|
}
|
1710
|
|
- adcdata /= 100;
|
|
1776
|
+ adcdata /= 10;
|
1711
|
1777
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL3_User, adcdata.ToString("N2"));
|
1712
|
1778
|
adcdata = 0;
|
1713
|
1779
|
|
|
@@ -1718,7 +1784,7 @@ namespace Jdas_Mbic
|
1718
|
1784
|
adcdata = (0xffff - adcdata) + 1;
|
1719
|
1785
|
adcdata *= -1;
|
1720
|
1786
|
}
|
1721
|
|
- adcdata /= 100;
|
|
1787
|
+ adcdata /= 10;
|
1722
|
1788
|
this.Invoke(new StringSend(Numeric_Text_Set), numericUpDown_UL4_User, adcdata.ToString("N2"));
|
1723
|
1789
|
adcdata = 0;
|
1724
|
1790
|
|
|
@@ -1792,12 +1858,14 @@ namespace Jdas_Mbic
|
1792
|
1858
|
dBmdata = DET_Table_Apply(textBox_DET_UL4);
|
1793
|
1859
|
this.Invoke(new StringSend(TextBox_Text_Set), textBox_DET_UL4_dBm, dBmdata.ToString("N3"));
|
1794
|
1860
|
adcdata = 0;
|
1795
|
|
-
|
|
1861
|
+#if false
|
1796
|
1862
|
adcdata += ((buf[(int)BluecellReqIndex.DET_TEMP_H] << 8) & 0xFF00);
|
1797
|
1863
|
adcdata += (buf[(int)BluecellReqIndex.DET_TEMP_L] & 0x00FF);
|
1798
|
|
- adcdata = adcdata * 3.0 / 4096;
|
|
1864
|
+ adcdata = adcdata * 3.3 / 4095;
|
1799
|
1865
|
adcdata = (adcdata - 0.5) * 100;
|
1800
|
|
-
|
|
1866
|
+#else
|
|
1867
|
+ adcdata = (buf[(int)BluecellReqIndex.DET_TEMP_L]);
|
|
1868
|
+#endif
|
1801
|
1869
|
this.Invoke(new StringSend(Label_Text_Set), label_Temp, adcdata.ToString("N2") + "°C");
|
1802
|
1870
|
adcdata = 0;
|
1803
|
1871
|
|
|
@@ -2004,20 +2072,41 @@ namespace Jdas_Mbic
|
2004
|
2072
|
#if true
|
2005
|
2073
|
Int16 TableValue = 0;
|
2006
|
2074
|
double ret = 0;
|
2007
|
|
- for (int i = 0; i < (buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] - 4)/2; i++) {
|
2008
|
|
- TableValue = buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1 )+ i * 2];
|
2009
|
|
- TableValue <<= 8;
|
|
2075
|
+ sbyte tempdata = 0;
|
|
2076
|
+ string data = Convert.ToString(this.Invoke(new Stringreturn(ComboBox_Text_Get), comboBox_TableName));
|
|
2077
|
+ bool Det_Att_Set = false;
|
|
2078
|
+ byte datalen_div = 2;
|
|
2079
|
+ if (data.Contains("DET") == true)
|
|
2080
|
+ {
|
|
2081
|
+ Det_Att_Set = false;
|
|
2082
|
+ datalen_div = 2;
|
|
2083
|
+ }
|
|
2084
|
+ else
|
|
2085
|
+ {
|
|
2086
|
+ Det_Att_Set = true;
|
|
2087
|
+ datalen_div = 1;
|
|
2088
|
+ }
|
|
2089
|
+ for (int i = 0; i < (buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] - 4)/ datalen_div; i++) {
|
|
2090
|
+ if(Det_Att_Set == false)
|
|
2091
|
+ {
|
|
2092
|
+ TableValue = buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1 )+ i * 2];
|
|
2093
|
+ TableValue <<= 8;
|
2010
|
2094
|
|
2011
|
|
- TableValue += buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i * 2 + 1];
|
2012
|
|
- if (comboBox_TableName.Text.Contains("DET") == true)
|
|
2095
|
+ TableValue += buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i * 2 + 1];
|
2013
|
2096
|
ret = Convert.ToDouble(TableValue) / 1000;
|
|
2097
|
+ }
|
2014
|
2098
|
else
|
2015
|
|
- ret = Convert.ToDouble(TableValue) / 100;
|
|
2099
|
+ {
|
|
2100
|
+ tempdata =(SByte)((buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i]));//Convert.ToSByte((buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i]));
|
|
2101
|
+
|
|
2102
|
+ ret = Convert.ToDouble(tempdata) / 2;
|
|
2103
|
+ }
|
2016
|
2104
|
try
|
2017
|
2105
|
{
|
2018
|
2106
|
dataGridView_TableSetting[1, i].Value = ret.ToString("N3");
|
2019
|
2107
|
DET_TableSetting(dataGridView_TableSetting[0, i].Value, dataGridView_TableSetting[1, i].Value, i);
|
2020
|
2108
|
}
|
|
2109
|
+
|
2021
|
2110
|
catch { }
|
2022
|
2111
|
//this.Invoke(new StringSend(Table_Text_Set), dataGridView_TableSetting[1, i].Value, TableValue.ToString("N2"));
|
2023
|
2112
|
}
|
|
@@ -2070,47 +2159,141 @@ namespace Jdas_Mbic
|
2070
|
2159
|
|
2071
|
2160
|
}
|
2072
|
2161
|
|
2073
|
|
- const byte TableMaxLength = 128 + 6; // Header + Type + Length + CRCINDEX + TableIndex + ..... + CRC
|
|
2162
|
+ const byte DET_TableMaxLength = 128 + 6; // Header + Type + Length + CRCINDEX + TableIndex + ..... + CRC
|
|
2163
|
+ const byte ATT_TableMaxLength = 64 + 6; // Header + Type + Length + CRCINDEX + TableIndex + ..... + CRC
|
2074
|
2164
|
|
2075
|
2165
|
private void button_FileSave_Click(object sender, EventArgs e)
|
2076
|
2166
|
{
|
2077
|
|
- byte[] temp_buf = new byte[TableMaxLength];
|
2078
|
|
- byte tmp_h = 0 , tmp_l = 0;
|
2079
|
|
- Int16 ret = 0;
|
2080
|
|
- //temp_buf[] = dataGridView_TableSetting.Rows[r - 1].Cells[1].Value
|
|
2167
|
+ byte[] temp_buf = new byte[DET_TableMaxLength];
|
|
2168
|
+ string tempstr;
|
|
2169
|
+ Int16 detret;
|
|
2170
|
+ byte tmp_h, tmp_l, attret;
|
|
2171
|
+ try
|
|
2172
|
+ {
|
|
2173
|
+
|
|
2174
|
+ ComboBox cb = (ComboBox)comboBox_TableName;
|
|
2175
|
+ tempstr = cb.Text;
|
|
2176
|
+ }
|
|
2177
|
+ catch { tempstr = comboBox_TableName.Text; }
|
|
2178
|
+ byte type = 0;
|
|
2179
|
+ switch (tempstr)
|
|
2180
|
+ {
|
|
2181
|
+ case "ATT_DL1": type = (byte)MBIC_TableNumber.DLI_P1_ATT_Accuracy_Table_Number; break;
|
|
2182
|
+ case "ATT_DL2": type = (byte)MBIC_TableNumber.DLI_P2_ATT_Accuracy_Table_Number; break;
|
|
2183
|
+ case "ATT_DL3": type = (byte)MBIC_TableNumber.DLI_P3_ATT_Accuracy_Table_Number; break;
|
|
2184
|
+ case "ATT_DL4": type = (byte)MBIC_TableNumber.DLI_P4_ATT_Accuracy_Table_Number; break;
|
|
2185
|
+ case "ATT_UL1": type = (byte)MBIC_TableNumber.ULO_P1_ATT_Accuracy_Table_Number; break;
|
|
2186
|
+ case "ATT_UL2": type = (byte)MBIC_TableNumber.ULO_P2_ATT_Accuracy_Table_Number; break;
|
|
2187
|
+ case "ATT_UL3": type = (byte)MBIC_TableNumber.ULO_P3_ATT_Accuracy_Table_Number; break;
|
|
2188
|
+ case "ATT_UL4": type = (byte)MBIC_TableNumber.ULO_P4_ATT_Accuracy_Table_Number; break;
|
|
2189
|
+ case "DET_DL1": type = (byte)MBIC_TableNumber.DLI_P1_Level_Table_Number; break;
|
|
2190
|
+ case "DET_DL2": type = (byte)MBIC_TableNumber.DLI_P2_Level_Table_Number; break;
|
|
2191
|
+ case "DET_DL3": type = (byte)MBIC_TableNumber.DLI_P3_Level_Table_Number; break;
|
|
2192
|
+ case "DET_DL4": type = (byte)MBIC_TableNumber.DLI_P4_Level_Table_Number; break;
|
|
2193
|
+ case "DET_UL1": type = (byte)MBIC_TableNumber.ULO_P1_Level_Table_Number; break;
|
|
2194
|
+ case "DET_UL2": type = (byte)MBIC_TableNumber.ULO_P2_Level_Table_Number; break;
|
|
2195
|
+ case "DET_UL3": type = (byte)MBIC_TableNumber.ULO_P3_Level_Table_Number; break;
|
|
2196
|
+ case "DET_UL4": type = (byte)MBIC_TableNumber.ULO_P4_Level_Table_Number; break;
|
|
2197
|
+ case "TEMP_DL1": type = (byte)MBIC_TableNumber.DLI_P1_ATT_Temp_guarantee_Table_Number; break;
|
|
2198
|
+ case "TEMP_DL2": type = (byte)MBIC_TableNumber.DLI_P2_ATT_Temp_guarantee_Table_Number; break;
|
|
2199
|
+ case "TEMP_DL3": type = (byte)MBIC_TableNumber.DLI_P3_ATT_Temp_guarantee_Table_Number; break;
|
|
2200
|
+ case "TEMP_DL4": type = (byte)MBIC_TableNumber.DLI_P4_ATT_Temp_guarantee_Table_Number; break;
|
|
2201
|
+ case "TEMP_UL1": type = (byte)MBIC_TableNumber.ULO_P1_ATT_Temp_guarantee_Table_Number; break;
|
|
2202
|
+ case "TEMP_UL2": type = (byte)MBIC_TableNumber.ULO_P2_ATT_Temp_guarantee_Table_Number; break;
|
|
2203
|
+ case "TEMP_UL3": type = (byte)MBIC_TableNumber.ULO_P3_ATT_Temp_guarantee_Table_Number; break;
|
|
2204
|
+ case "TEMP_UL4": type = (byte)MBIC_TableNumber.ULO_P4_ATT_Temp_guarantee_Table_Number; break;
|
|
2205
|
+
|
|
2206
|
+ default:
|
|
2207
|
+ MessageBox.Show("존재하지 않는 ComboBox 입니다.\r\n 확인해주세요.");
|
|
2208
|
+ break;
|
|
2209
|
+ }
|
|
2210
|
+ //temp_buf[] = dataGridView_TableSetting.Rows[r - 1].Cells[1].Value
|
2081
|
2211
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
2082
|
2212
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type] = (byte)Bluecell_BootProtocol.DATATYPE.ATT_TableSet;
|
2083
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] = TableMaxLength - 2;
|
2084
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableMaxLength - 2;
|
2085
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)comboBox_TableName.SelectedIndex;
|
|
2213
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] = DET_TableMaxLength - 2;
|
|
2214
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = DET_TableMaxLength - 2;
|
|
2215
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)type;
|
2086
|
2216
|
|
2087
|
|
- for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
|
|
2217
|
+ if (comboBox_TableName.Text.Contains("DET") == true)
|
2088
|
2218
|
{
|
2089
|
|
- if (comboBox_TableName.Text.Contains("DET") == true)
|
2090
|
|
- ret = Convert.ToInt16(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 1000);
|
2091
|
|
- else {
|
2092
|
|
- ret = Convert.ToInt16(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 100);
|
2093
|
|
- }
|
2094
|
|
- tmp_h = Convert.ToByte((ret & 0xFF00) >> 8);
|
2095
|
|
- tmp_l = Convert.ToByte((ret & 0x00FF));
|
2096
|
|
- temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i * 2 ] = tmp_h;
|
2097
|
|
- temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + (i * 2) + 1] = tmp_l;
|
|
2219
|
+ for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
|
|
2220
|
+ {
|
|
2221
|
+ detret = Convert.ToInt16(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 1000);
|
|
2222
|
+ tmp_h = Convert.ToByte((detret & 0xFF00) >> 8);
|
|
2223
|
+ tmp_l = Convert.ToByte((detret & 0x00FF));
|
|
2224
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i * 2] = tmp_h;
|
|
2225
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + (i * 2) + 1] = tmp_l;
|
|
2226
|
+ }
|
|
2227
|
+ serial.Serial_DataSend(temp_buf, DET_TableMaxLength);
|
2098
|
2228
|
}
|
|
2229
|
+ else
|
|
2230
|
+ {
|
|
2231
|
+ for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
|
|
2232
|
+ {
|
|
2233
|
+ attret = Convert.ToByte(Convert.ToSByte(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 2) & 0xFF);
|
|
2234
|
+
|
|
2235
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i] = (attret);
|
|
2236
|
+ }
|
|
2237
|
+ serial.Serial_DataSend(temp_buf, ATT_TableMaxLength);
|
2099
|
2238
|
|
|
2239
|
+ }
|
2100
|
2240
|
|
2101
|
|
- serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
2241
|
+
|
2102
|
2242
|
ReqTimer_Cnt = 0;
|
2103
|
2243
|
}
|
2104
|
2244
|
const byte TableGetMaxLength = 1 + 6;
|
|
2245
|
+
|
|
2246
|
+
|
2105
|
2247
|
private void button_FileLoad_Click(object sender, EventArgs e)
|
2106
|
2248
|
{
|
2107
|
2249
|
byte[] temp_buf = new byte[TableGetMaxLength];
|
|
2250
|
+ string tempstr;
|
|
2251
|
+ try
|
|
2252
|
+ {
|
|
2253
|
+
|
|
2254
|
+ ComboBox cb = (ComboBox)sender;
|
|
2255
|
+ tempstr = cb.Text;
|
|
2256
|
+ }
|
|
2257
|
+ catch { tempstr = comboBox_TableName.Text; }
|
|
2258
|
+ byte type = 0;
|
|
2259
|
+ switch (tempstr)
|
|
2260
|
+ {
|
|
2261
|
+ case "ATT_DL1": type = (byte)MBIC_TableNumber.DLI_P1_ATT_Accuracy_Table_Number; break;
|
|
2262
|
+ case "ATT_DL2": type = (byte)MBIC_TableNumber.DLI_P2_ATT_Accuracy_Table_Number; break;
|
|
2263
|
+ case "ATT_DL3": type = (byte)MBIC_TableNumber.DLI_P3_ATT_Accuracy_Table_Number; break;
|
|
2264
|
+ case "ATT_DL4": type = (byte)MBIC_TableNumber.DLI_P4_ATT_Accuracy_Table_Number; break;
|
|
2265
|
+ case "ATT_UL1": type = (byte)MBIC_TableNumber.ULO_P1_ATT_Accuracy_Table_Number; break;
|
|
2266
|
+ case "ATT_UL2": type = (byte)MBIC_TableNumber.ULO_P2_ATT_Accuracy_Table_Number; break;
|
|
2267
|
+ case "ATT_UL3": type = (byte)MBIC_TableNumber.ULO_P3_ATT_Accuracy_Table_Number; break;
|
|
2268
|
+ case "ATT_UL4": type = (byte)MBIC_TableNumber.ULO_P4_ATT_Accuracy_Table_Number; break;
|
|
2269
|
+ case "DET_DL1": type = (byte)MBIC_TableNumber.DLI_P1_Level_Table_Number; break;
|
|
2270
|
+ case "DET_DL2": type = (byte)MBIC_TableNumber.DLI_P2_Level_Table_Number; break;
|
|
2271
|
+ case "DET_DL3": type = (byte)MBIC_TableNumber.DLI_P3_Level_Table_Number; break;
|
|
2272
|
+ case "DET_DL4": type = (byte)MBIC_TableNumber.DLI_P4_Level_Table_Number; break;
|
|
2273
|
+ case "DET_UL1": type = (byte)MBIC_TableNumber.ULO_P1_Level_Table_Number; break;
|
|
2274
|
+ case "DET_UL2": type = (byte)MBIC_TableNumber.ULO_P2_Level_Table_Number; break;
|
|
2275
|
+ case "DET_UL3": type = (byte)MBIC_TableNumber.ULO_P3_Level_Table_Number; break;
|
|
2276
|
+ case "DET_UL4": type = (byte)MBIC_TableNumber.ULO_P4_Level_Table_Number; break;
|
|
2277
|
+ case "TEMP_DL1": type = (byte)MBIC_TableNumber.DLI_P1_ATT_Temp_guarantee_Table_Number; break;
|
|
2278
|
+ case "TEMP_DL2": type = (byte)MBIC_TableNumber.DLI_P2_ATT_Temp_guarantee_Table_Number; break;
|
|
2279
|
+ case "TEMP_DL3": type = (byte)MBIC_TableNumber.DLI_P3_ATT_Temp_guarantee_Table_Number; break;
|
|
2280
|
+ case "TEMP_DL4": type = (byte)MBIC_TableNumber.DLI_P4_ATT_Temp_guarantee_Table_Number; break;
|
|
2281
|
+ case "TEMP_UL1": type = (byte)MBIC_TableNumber.ULO_P1_ATT_Temp_guarantee_Table_Number; break;
|
|
2282
|
+ case "TEMP_UL2": type = (byte)MBIC_TableNumber.ULO_P2_ATT_Temp_guarantee_Table_Number; break;
|
|
2283
|
+ case "TEMP_UL3": type = (byte)MBIC_TableNumber.ULO_P3_ATT_Temp_guarantee_Table_Number; break;
|
|
2284
|
+ case "TEMP_UL4": type = (byte)MBIC_TableNumber.ULO_P4_ATT_Temp_guarantee_Table_Number; break;
|
|
2285
|
+
|
|
2286
|
+ default:
|
|
2287
|
+ MessageBox.Show("존재하지 않는 ComboBox 입니다.\r\n 확인해주세요.");
|
|
2288
|
+ break;
|
|
2289
|
+ }
|
|
2290
|
+
|
2108
|
2291
|
|
2109
|
2292
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
2110
|
2293
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type] = (byte)Bluecell_BootProtocol.DATATYPE.ATT_TableGet;
|
2111
|
2294
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] = TableGetMaxLength - 2;
|
2112
|
2295
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableGetMaxLength - 2;
|
2113
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)comboBox_TableName.SelectedIndex;
|
|
2296
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = type;
|
2114
|
2297
|
serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
2115
|
2298
|
ReqTimer_Cnt = 0;
|
2116
|
2299
|
}
|
|
@@ -2144,14 +2327,42 @@ namespace Jdas_Mbic
|
2144
|
2327
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
2145
|
2328
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] = TableGetMaxLength - 3;
|
2146
|
2329
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableGetMaxLength - 2;
|
2147
|
|
- Int16 UserData = Convert.ToInt16(numeric.Value * 100);
|
2148
|
2330
|
|
2149
|
|
- tmp_H = Convert.ToByte((UserData & 0xFF00) >> 8);
|
2150
|
|
- tmp_L = Convert.ToByte((UserData & 0x00FF));
|
2151
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = tmp_H;
|
2152
|
|
- temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 1] = tmp_L;
|
|
2331
|
+ if ( numeric.Name == "numericUpDown_Temp_Threshold"
|
|
2332
|
+ || numeric.Name == "numericUpDown_Temp_Threshold_Default"
|
|
2333
|
+ || numeric.Name == "numericUpDown_Temperature_Offset"
|
|
2334
|
+ || numeric.Name.Contains("Default") == true)
|
|
2335
|
+ {
|
|
2336
|
+ Int16 UserData = Convert.ToInt16(numeric.Value);
|
|
2337
|
+ //tmp_H = Convert.ToByte((UserData & 0xFF00) >> 8);
|
|
2338
|
+ tmp_L = Convert.ToByte((UserData & 0x00FF));
|
|
2339
|
+ //temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = tmp_H;
|
|
2340
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = tmp_L;
|
|
2341
|
+ }
|
|
2342
|
+ else
|
|
2343
|
+ {
|
|
2344
|
+ Int16 UserData = Convert.ToInt16(numeric.Value * 10);
|
|
2345
|
+ tmp_H = Convert.ToByte((UserData & 0xFF00) >> 8);
|
|
2346
|
+ tmp_L = Convert.ToByte((UserData & 0x00FF));
|
|
2347
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = tmp_H;
|
|
2348
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 1] = tmp_L;
|
|
2349
|
+ }
|
|
2350
|
+
|
2153
|
2351
|
switch (numeric.Name)
|
2154
|
2352
|
{
|
|
2353
|
+ case "numericUpDown_Temp_Threshold":
|
|
2354
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2355
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_Temp_High_Threshold;
|
|
2356
|
+ break;
|
|
2357
|
+ case "numericUpDown_Temp_Threshold_Default":
|
|
2358
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2359
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_Temp_High_Threshold_Default;
|
|
2360
|
+ break;
|
|
2361
|
+ case "numericUpDown_Temperature_Offset":
|
|
2362
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2363
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_Temperature_Offset;
|
|
2364
|
+ break;
|
|
2365
|
+
|
2155
|
2366
|
case "numericUpDown_DL1_User":
|
2156
|
2367
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
2157
|
2368
|
= (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DL1_USER;
|
|
@@ -2190,6 +2401,60 @@ namespace Jdas_Mbic
|
2190
|
2401
|
temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
2191
|
2402
|
= (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_TEMP_USER;
|
2192
|
2403
|
break;
|
|
2404
|
+ case "numericUpDown_DLI_Level_High_Threshold":
|
|
2405
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2406
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_Level_High_Threshold;
|
|
2407
|
+ break;
|
|
2408
|
+ case "numericUpDown_DLI_Level_Low_Threshold":
|
|
2409
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2410
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_Level_Low_Threshold;
|
|
2411
|
+ break;
|
|
2412
|
+ case "numericUpDown_DLI_Level_High_Low_Threshold_default":
|
|
2413
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2414
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_Level_High_Low_Threshold_default;
|
|
2415
|
+ break;
|
|
2416
|
+ case "numericUpDown_DLI_AGC_Threshold":
|
|
2417
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2418
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_AGC_Threshold;
|
|
2419
|
+ break;
|
|
2420
|
+ case "numericUpDown_DLI_AGC_Threshold_Default":
|
|
2421
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2422
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_AGC_Threshold_Default;
|
|
2423
|
+ break;
|
|
2424
|
+ case "numericUpDown_DLI_Shutdown_Threshold":
|
|
2425
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2426
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_Shutdown_Threshold;
|
|
2427
|
+ break;
|
|
2428
|
+ case "numericUpDown_DLI_Shutdown_Threshold_Default":
|
|
2429
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2430
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_Shutdown_Threshold_Default;
|
|
2431
|
+ break;
|
|
2432
|
+ case "numericUpDown_ULO_Level_High_Threshold":
|
|
2433
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2434
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_ULO_Level_High_Threshold;
|
|
2435
|
+ break;
|
|
2436
|
+ case "numericUpDown_DLI_Level_High_Threshold_default":
|
|
2437
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2438
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_DLI_Level_High_Low_Threshold_default;
|
|
2439
|
+ break;
|
|
2440
|
+ case "numericUpDown_ULO_ALC_Threshold":
|
|
2441
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2442
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_ULO_ALC_Threshold;
|
|
2443
|
+ break;
|
|
2444
|
+ case "numericUpDown_ULO_ALC_Threshold_Default":
|
|
2445
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2446
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_ULO_ALC_Threshold_Default;
|
|
2447
|
+ break;
|
|
2448
|
+ case "numericUpDown_ULO_Shutdown_Threshold":
|
|
2449
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2450
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_ULO_Shutdown_Threshold;
|
|
2451
|
+ break;
|
|
2452
|
+ case "numericUpDown_ULO_Shutdown_Threshold_Default":
|
|
2453
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type]
|
|
2454
|
+ = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_ULO_Shutdown_Threshold_Default;
|
|
2455
|
+ break;
|
|
2456
|
+
|
|
2457
|
+ default:break;
|
2193
|
2458
|
}
|
2194
|
2459
|
serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
2195
|
2460
|
ReqTimer_Cnt = 0;
|
|
@@ -2205,5 +2470,23 @@ namespace Jdas_Mbic
|
2205
|
2470
|
return;
|
2206
|
2471
|
}
|
2207
|
2472
|
}
|
|
2473
|
+
|
|
2474
|
+ private void button_Reset_Click(object sender, EventArgs e)
|
|
2475
|
+ {
|
|
2476
|
+ byte[] temp_buf = new byte[TableGetMaxLength];
|
|
2477
|
+
|
|
2478
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
|
|
2479
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type] = (byte)Bluecell_BootProtocol.DATATYPE.BLUECELL_SOFTWARERESET;
|
|
2480
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length] = TableGetMaxLength - 2;
|
|
2481
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = TableGetMaxLength - 2;
|
|
2482
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = (byte)1;
|
|
2483
|
+ serial.Serial_DataSend(temp_buf, temp_buf.Length);
|
|
2484
|
+ ReqTimer_Cnt = 0;
|
|
2485
|
+ }
|
|
2486
|
+
|
|
2487
|
+ private void numericUpDown_ATT_DL1_ValueChanged(object sender, EventArgs e)
|
|
2488
|
+ {
|
|
2489
|
+
|
|
2490
|
+ }
|
2208
|
2491
|
}
|
2209
|
2492
|
}
|