|
@@ -87,7 +87,7 @@ namespace Jdas_Mbic
|
87
|
87
|
dataGridView_TableSetting.Rows.Add();
|
88
|
88
|
tempstr = string.Format("{0:0}", Temp_Data);
|
89
|
89
|
dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " ℃";
|
90
|
|
- Temp_Data = Temp_Data - 5;
|
|
90
|
+ Temp_Data = Temp_Data + 5;
|
91
|
91
|
dataGridView_TableSetting[1, i].Value = "0";
|
92
|
92
|
|
93
|
93
|
}
|
|
@@ -290,7 +290,42 @@ namespace Jdas_Mbic
|
290
|
290
|
temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + a + 3] = Convert.ToByte(CRCRET & 0x00FF);
|
291
|
291
|
((JdasMbic)(this.Owner)).serial.Serial_DataSend(temp_buf, JdasMbic.DET_TableMaxLength);
|
292
|
292
|
}
|
293
|
|
- else
|
|
293
|
+ else if (comboBox_TableName.Text.Contains("TEMP") == true)
|
|
294
|
+ {
|
|
295
|
+ Length = Convert.ToByte(JdasMbic.ATT_TableMaxLength - 4);
|
|
296
|
+
|
|
297
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_H] = Convert.ToByte((Length & 0xFF00) >> 8);
|
|
298
|
+ temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L] = Convert.ToByte((Length & 0x00FF));
|
|
299
|
+ //for (i = 0; i < dataGridView_TableSetting.RowCount; i++)
|
|
300
|
+ for (i = 0; i < 0x40; i++)
|
|
301
|
+ {
|
|
302
|
+ try
|
|
303
|
+ {
|
|
304
|
+ attret = Convert.ToByte(Convert.ToSByte(Convert.ToDouble(dataGridView_TableSetting[1, i].Value) * 4) & 0xFF);
|
|
305
|
+
|
|
306
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i] = (attret);
|
|
307
|
+ }
|
|
308
|
+ catch { }
|
|
309
|
+ }
|
|
310
|
+
|
|
311
|
+ for (a = i; a < i + 30; a++)
|
|
312
|
+ {
|
|
313
|
+ attret = 0;
|
|
314
|
+
|
|
315
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i] = (attret);
|
|
316
|
+ }
|
|
317
|
+ sbyte tmpdata = (sbyte)(numericUpDown_TableRef.Value);
|
|
318
|
+ byte data = Convert.ToByte(tmpdata & 0xFF);
|
|
319
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + a + 0] = data;
|
|
320
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + a + 1] = Convert.ToByte(numericUpDown_TableLength.Value);
|
|
321
|
+
|
|
322
|
+ UInt16 CRCRET = ((JdasMbic)(this.Owner)).crc.CRC16_Generate(temp_buf, temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L]);
|
|
323
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + a + 2] = Convert.ToByte((CRCRET & 0xFF00) >> 8);
|
|
324
|
+ temp_buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + a + 3] = Convert.ToByte(CRCRET & 0x00FF);
|
|
325
|
+ ((JdasMbic)(this.Owner)).serial.Serial_DataSend(temp_buf, JdasMbic.ATT_TableMaxLength);
|
|
326
|
+
|
|
327
|
+ }
|
|
328
|
+ else
|
294
|
329
|
{
|
295
|
330
|
Length = Convert.ToByte(JdasMbic.ATT_TableMaxLength - 4);
|
296
|
331
|
|
|
@@ -445,6 +480,12 @@ namespace Jdas_Mbic
|
445
|
480
|
|
446
|
481
|
|
447
|
482
|
|
|
483
|
+ }
|
|
484
|
+ else if (data.Contains("TEMP") == true)
|
|
485
|
+ {
|
|
486
|
+ tempdata = (SByte)((buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i]));//Convert.ToSByte((buf[(int)(Bluecell_ProtIndex_p.Bluecell_data + 1) + i]));
|
|
487
|
+
|
|
488
|
+ ret = Convert.ToDouble(tempdata) / 4;
|
448
|
489
|
}
|
449
|
490
|
else
|
450
|
491
|
{
|