소스 검색

NessLab Table Load 기능 추가

PYJ 4 년 전
부모
커밋
964e4e60da
4개의 변경된 파일200개의 추가작업 그리고 137개의 파일을 삭제
  1. 41 6
      DataRequest/Func/Etc_Function.cs
  2. 18 1
      DataRequest/Func/Serial.cs
  3. 114 114
      DataRequest/Main.Designer.cs
  4. 27 16
      DataRequest/Table.cs

+ 41 - 6
DataRequest/Func/Etc_Function.cs

@@ -73,15 +73,50 @@ namespace DataRequest.Func
73 73
 
74 74
             return resultHex;
75 75
         }
76
-        public enum NessLab_Protocol_Index
76
+        public enum NessLab_Protocol_CMD_Index
77 77
         {
78
+            NessLab_STATUS_RES = 101,
78 79
             NessLab_Table_Req = 201,
79
-            NessLab_TableSet_Req = 202,
80
-            NessLab_TableSet_Res = 203,
80
+            NessLab_Table_Res ,
81
+            NessLab_TableSet_Req ,
82
+            NessLab_TableSet_Res ,
83
+        };
84
+        public enum NessLab_Protocol_Index
85
+        {
86
+            NessLab_Header0,
87
+            NessLab_Header1,
88
+            NessLab_MsgID0,
89
+            NessLab_MsgSN0,
90
+            NessLab_MsgSN1,
91
+            NessLab_Reserve0,
92
+            NessLab_DataLength,
93
+            NessLab_Data_ADC1_H,
94
+            NessLab_Data_ADC1_L,
95
+            NessLab_Data_ADC1_Table_Value,
96
+            NessLab_DC_FAIL_ALARM,
97
+            NessLab_DownLink_Status,
98
+            NessLab_Over_Power_Alarm,
99
+            NessLab_VSWR_ALARM,
100
+            NessLab_Over_Input_Alarm,
101
+            NessLab_Over_Temp_Alarm,
102
+            NessLab_Temp_Monitor,
103
+            NessLab_ALC_ALARM,
104
+            NessLab_ChecksumVal,
105
+            NessLab_Tail0,
106
+            NessLab_Tail1,
107
+            NessLab_MAX_INDEX,
81 108
         };
82 109
         public byte[] NessLab_Protocol_Create(double[] data, int mode)
83 110
         {
84
-            byte[] tmpdata = new byte[(data.Length * 2) + 10];
111
+            int Length;
112
+            if (data == null)
113
+                Length = 10;
114
+            else
115
+                Length = (data.Length * 2) + 10;
116
+
117
+            byte[] tmpdata = new byte[Length];
118
+             
119
+
85 120
             int index = 0;
86 121
             crc Nesslab_crc = new crc();
87 122
             tmpdata[index++] = 0x7E;
@@ -90,9 +125,9 @@ namespace DataRequest.Func
90 125
             tmpdata[index++] = 0;          //MSG SN0
91 126
             tmpdata[index++] = 0;          //MSG SN1
92 127
             tmpdata[index++] = 0xFF;//Reserve
93
-            tmpdata[index++] = (byte)(data.Length * 2);
128
+            tmpdata[index++] = (byte)(Length - 10);
94 129
 
95
-            if (mode == (int)NessLab_Protocol_Index.NessLab_TableSet_Req)
130
+            if (data != null)
96 131
             {
97 132
                 for(int i = 0; i < data.Length; i++)
98 133
                 {

+ 18 - 1
DataRequest/Func/Serial.cs

@@ -112,7 +112,23 @@ namespace DataRequest.Func
112 112
             if(serialPort.IsOpen == true)
113 113
                 serialPort.Write(buffer, 0, Length);
114 114
         }
115
+        private void NessLab_OperateList(byte[] data)
116
+        {
117
+            switch (data[(int)Etc_Function.NessLab_Protocol_Index.NessLab_MsgID0])
118
+            {
119
+                case (int)Etc_Function.NessLab_Protocol_CMD_Index.NessLab_STATUS_RES:
120
+                    ((Main)main_form).subMain.NessLab_Adc_Value_Set(data[7] << 8 | data[8]);
121
+                    break;
122
+                case (int)Etc_Function.NessLab_Protocol_CMD_Index.NessLab_TableSet_Res:
123
+                    ((Main)main_form).table.Table_Setting(data);
124
+                    break;
125
+                case (int)Etc_Function.NessLab_Protocol_CMD_Index.NessLab_Table_Res:
126
+                    ((Main)main_form).table.Table_Setting(data);
127
+                    break;
128
+                    
129
+            }
115 130
 
131
+        }
116 132
         // Reader thread for Serial port
117 133
 #if true
118 134
         public void Read()
@@ -132,7 +148,8 @@ namespace DataRequest.Func
132 148
                     // ((Main)main_form).table.Table_Setting(btdata);
133 149
                     try
134 150
                     {
135
-                        ((Main)main_form).subMain.NessLab_Adc_Value_Set(btdata[7] << 8 | btdata[8]);
151
+                        NessLab_OperateList(btdata);
152
+                        //((Main)main_form).subMain.NessLab_Adc_Value_Set(btdata[7] << 8 | btdata[8]);
136 153
                         if (etc_Function.OverLap_Window_Find("Debug_Console") == false)
137 154
                         {
138 155
                             string data = Encoding.Default.GetString(btdata);

+ 114 - 114
DataRequest/Main.Designer.cs

@@ -30,36 +30,36 @@
30 30
         {
31 31
             this.components = new System.ComponentModel.Container();
32 32
             this.panel1 = new System.Windows.Forms.Panel();
33
-            this.panel4 = new System.Windows.Forms.Panel();
34
-            this.comboBox_Baudrate = new System.Windows.Forms.ComboBox();
35
-            this.comboBox_Port = new System.Windows.Forms.ComboBox();
36
-            this.panel3 = new System.Windows.Forms.Panel();
37
-            this.panel2 = new System.Windows.Forms.Panel();
38
-            this.panel_ChildForm = new System.Windows.Forms.Panel();
39
-            this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
40
-            this.timer1 = new System.Windows.Forms.Timer(this.components);
41
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
33
+            this.pictureBox3 = new System.Windows.Forms.PictureBox();
34
+            this.pictureBox5 = new System.Windows.Forms.PictureBox();
42 35
             this.pictureBox4 = new System.Windows.Forms.PictureBox();
43 36
             this.pictureBox_Tx = new System.Windows.Forms.PictureBox();
37
+            this.panel4 = new System.Windows.Forms.Panel();
44 38
             this.button_SerialConnect = new System.Windows.Forms.Button();
39
+            this.comboBox_Baudrate = new System.Windows.Forms.ComboBox();
40
+            this.comboBox_Port = new System.Windows.Forms.ComboBox();
45 41
             this.button_Serial = new System.Windows.Forms.Button();
46 42
             this.button_Table = new System.Windows.Forms.Button();
47 43
             this.button_Console = new System.Windows.Forms.Button();
48 44
             this.button_Main = new System.Windows.Forms.Button();
45
+            this.panel3 = new System.Windows.Forms.Panel();
49 46
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
50
-            this.pictureBox3 = new System.Windows.Forms.PictureBox();
51
-            this.pictureBox5 = new System.Windows.Forms.PictureBox();
47
+            this.panel2 = new System.Windows.Forms.Panel();
48
+            this.panel_ChildForm = new System.Windows.Forms.Panel();
49
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
50
+            this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
51
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
52 52
             this.panel1.SuspendLayout();
53
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
54
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
55
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
56
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Tx)).BeginInit();
53 57
             this.panel4.SuspendLayout();
54 58
             this.panel3.SuspendLayout();
59
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
55 60
             this.panel2.SuspendLayout();
56 61
             this.panel_ChildForm.SuspendLayout();
57 62
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
58
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
59
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Tx)).BeginInit();
60
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
61
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
62
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
63 63
             this.SuspendLayout();
64 64
             // 
65 65
             // panel1
@@ -83,6 +83,42 @@
83 83
             this.panel1.Size = new System.Drawing.Size(200, 541);
84 84
             this.panel1.TabIndex = 0;
85 85
             // 
86
+            // pictureBox3
87
+            // 
88
+            this.pictureBox3.Image = global::DataRequest.Properties.Resources.green_s;
89
+            this.pictureBox3.Location = new System.Drawing.Point(137, 498);
90
+            this.pictureBox3.Name = "pictureBox3";
91
+            this.pictureBox3.Size = new System.Drawing.Size(25, 20);
92
+            this.pictureBox3.TabIndex = 12;
93
+            this.pictureBox3.TabStop = false;
94
+            // 
95
+            // pictureBox5
96
+            // 
97
+            this.pictureBox5.Image = global::DataRequest.Properties.Resources.red_s;
98
+            this.pictureBox5.Location = new System.Drawing.Point(106, 498);
99
+            this.pictureBox5.Name = "pictureBox5";
100
+            this.pictureBox5.Size = new System.Drawing.Size(25, 20);
101
+            this.pictureBox5.TabIndex = 11;
102
+            this.pictureBox5.TabStop = false;
103
+            // 
104
+            // pictureBox4
105
+            // 
106
+            this.pictureBox4.Image = global::DataRequest.Properties.Resources.green_s;
107
+            this.pictureBox4.Location = new System.Drawing.Point(55, 498);
108
+            this.pictureBox4.Name = "pictureBox4";
109
+            this.pictureBox4.Size = new System.Drawing.Size(25, 20);
110
+            this.pictureBox4.TabIndex = 10;
111
+            this.pictureBox4.TabStop = false;
112
+            // 
113
+            // pictureBox_Tx
114
+            // 
115
+            this.pictureBox_Tx.Image = global::DataRequest.Properties.Resources.red_s;
116
+            this.pictureBox_Tx.Location = new System.Drawing.Point(24, 498);
117
+            this.pictureBox_Tx.Name = "pictureBox_Tx";
118
+            this.pictureBox_Tx.Size = new System.Drawing.Size(25, 20);
119
+            this.pictureBox_Tx.TabIndex = 9;
120
+            this.pictureBox_Tx.TabStop = false;
121
+            // 
86 122
             // panel4
87 123
             // 
88 124
             this.panel4.Controls.Add(this.button_SerialConnect);
@@ -94,6 +130,22 @@
94 130
             this.panel4.Size = new System.Drawing.Size(198, 145);
95 131
             this.panel4.TabIndex = 5;
96 132
             // 
133
+            // button_SerialConnect
134
+            // 
135
+            this.button_SerialConnect.Dock = System.Windows.Forms.DockStyle.Bottom;
136
+            this.button_SerialConnect.FlatAppearance.BorderSize = 0;
137
+            this.button_SerialConnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
138
+            this.button_SerialConnect.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
139
+            this.button_SerialConnect.Image = global::DataRequest.Properties.Resources.connected_50px;
140
+            this.button_SerialConnect.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
141
+            this.button_SerialConnect.Location = new System.Drawing.Point(0, 102);
142
+            this.button_SerialConnect.Name = "button_SerialConnect";
143
+            this.button_SerialConnect.Size = new System.Drawing.Size(198, 43);
144
+            this.button_SerialConnect.TabIndex = 2;
145
+            this.button_SerialConnect.Text = "Connect";
146
+            this.button_SerialConnect.UseVisualStyleBackColor = true;
147
+            this.button_SerialConnect.Click += new System.EventHandler(this.button_SerialConnect_Click);
148
+            // 
97 149
             // comboBox_Baudrate
98 150
             // 
99 151
             this.comboBox_Baudrate.Dock = System.Windows.Forms.DockStyle.Top;
@@ -112,7 +164,7 @@
112 164
             this.comboBox_Baudrate.Name = "comboBox_Baudrate";
113 165
             this.comboBox_Baudrate.Size = new System.Drawing.Size(198, 22);
114 166
             this.comboBox_Baudrate.TabIndex = 1;
115
-            this.comboBox_Baudrate.Text = "57600";
167
+            this.comboBox_Baudrate.Text = "115200";
116 168
             // 
117 169
             // comboBox_Port
118 170
             // 
@@ -124,84 +176,6 @@
124 176
             this.comboBox_Port.Size = new System.Drawing.Size(198, 22);
125 177
             this.comboBox_Port.TabIndex = 0;
126 178
             // 
127
-            // panel3
128
-            // 
129
-            this.panel3.Controls.Add(this.pictureBox2);
130
-            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
131
-            this.panel3.Location = new System.Drawing.Point(0, 0);
132
-            this.panel3.Name = "panel3";
133
-            this.panel3.Size = new System.Drawing.Size(198, 100);
134
-            this.panel3.TabIndex = 0;
135
-            // 
136
-            // panel2
137
-            // 
138
-            this.panel2.BackColor = System.Drawing.Color.White;
139
-            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
140
-            this.panel2.Controls.Add(this.panel_ChildForm);
141
-            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
142
-            this.panel2.Location = new System.Drawing.Point(200, 0);
143
-            this.panel2.Name = "panel2";
144
-            this.panel2.Size = new System.Drawing.Size(802, 541);
145
-            this.panel2.TabIndex = 1;
146
-            // 
147
-            // panel_ChildForm
148
-            // 
149
-            this.panel_ChildForm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
150
-            this.panel_ChildForm.Controls.Add(this.pictureBox1);
151
-            this.panel_ChildForm.Dock = System.Windows.Forms.DockStyle.Fill;
152
-            this.panel_ChildForm.Location = new System.Drawing.Point(0, 0);
153
-            this.panel_ChildForm.Name = "panel_ChildForm";
154
-            this.panel_ChildForm.Size = new System.Drawing.Size(800, 539);
155
-            this.panel_ChildForm.TabIndex = 1;
156
-            // 
157
-            // timer1
158
-            // 
159
-            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
160
-            // 
161
-            // pictureBox1
162
-            // 
163
-            this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None;
164
-            this.pictureBox1.Image = global::DataRequest.Properties.Resources.bluecell_logo;
165
-            this.pictureBox1.Location = new System.Drawing.Point(348, 211);
166
-            this.pictureBox1.Name = "pictureBox1";
167
-            this.pictureBox1.Size = new System.Drawing.Size(150, 42);
168
-            this.pictureBox1.TabIndex = 0;
169
-            this.pictureBox1.TabStop = false;
170
-            // 
171
-            // pictureBox4
172
-            // 
173
-            this.pictureBox4.Image = global::DataRequest.Properties.Resources.green_s;
174
-            this.pictureBox4.Location = new System.Drawing.Point(55, 498);
175
-            this.pictureBox4.Name = "pictureBox4";
176
-            this.pictureBox4.Size = new System.Drawing.Size(25, 20);
177
-            this.pictureBox4.TabIndex = 10;
178
-            this.pictureBox4.TabStop = false;
179
-            // 
180
-            // pictureBox_Tx
181
-            // 
182
-            this.pictureBox_Tx.Image = global::DataRequest.Properties.Resources.red_s;
183
-            this.pictureBox_Tx.Location = new System.Drawing.Point(24, 498);
184
-            this.pictureBox_Tx.Name = "pictureBox_Tx";
185
-            this.pictureBox_Tx.Size = new System.Drawing.Size(25, 20);
186
-            this.pictureBox_Tx.TabIndex = 9;
187
-            this.pictureBox_Tx.TabStop = false;
188
-            // 
189
-            // button_SerialConnect
190
-            // 
191
-            this.button_SerialConnect.Dock = System.Windows.Forms.DockStyle.Bottom;
192
-            this.button_SerialConnect.FlatAppearance.BorderSize = 0;
193
-            this.button_SerialConnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
194
-            this.button_SerialConnect.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
195
-            this.button_SerialConnect.Image = global::DataRequest.Properties.Resources.connected_50px;
196
-            this.button_SerialConnect.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
197
-            this.button_SerialConnect.Location = new System.Drawing.Point(0, 102);
198
-            this.button_SerialConnect.Name = "button_SerialConnect";
199
-            this.button_SerialConnect.Size = new System.Drawing.Size(198, 43);
200
-            this.button_SerialConnect.TabIndex = 2;
201
-            this.button_SerialConnect.Text = "Connect";
202
-            this.button_SerialConnect.UseVisualStyleBackColor = true;
203
-            this.button_SerialConnect.Click += new System.EventHandler(this.button_SerialConnect_Click);
204
-            // 
205 179
             // button_Serial
206 180
             // 
207 181
             this.button_Serial.Dock = System.Windows.Forms.DockStyle.Top;
@@ -266,6 +240,15 @@
266 240
             this.button_Main.UseVisualStyleBackColor = true;
267 241
             this.button_Main.Click += new System.EventHandler(this.button_Main_Click);
268 242
             // 
243
+            // panel3
244
+            // 
245
+            this.panel3.Controls.Add(this.pictureBox2);
246
+            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
247
+            this.panel3.Location = new System.Drawing.Point(0, 0);
248
+            this.panel3.Name = "panel3";
249
+            this.panel3.Size = new System.Drawing.Size(198, 100);
250
+            this.panel3.TabIndex = 0;
251
+            // 
269 252
             // pictureBox2
270 253
             // 
271 254
             this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.None;
@@ -276,23 +259,40 @@
276 259
             this.pictureBox2.TabIndex = 1;
277 260
             this.pictureBox2.TabStop = false;
278 261
             // 
279
-            // pictureBox3
262
+            // panel2
280 263
             // 
281
-            this.pictureBox3.Image = global::DataRequest.Properties.Resources.green_s;
282
-            this.pictureBox3.Location = new System.Drawing.Point(137, 498);
283
-            this.pictureBox3.Name = "pictureBox3";
284
-            this.pictureBox3.Size = new System.Drawing.Size(25, 20);
285
-            this.pictureBox3.TabIndex = 12;
286
-            this.pictureBox3.TabStop = false;
264
+            this.panel2.BackColor = System.Drawing.Color.White;
265
+            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
266
+            this.panel2.Controls.Add(this.panel_ChildForm);
267
+            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
268
+            this.panel2.Location = new System.Drawing.Point(200, 0);
269
+            this.panel2.Name = "panel2";
270
+            this.panel2.Size = new System.Drawing.Size(802, 541);
271
+            this.panel2.TabIndex = 1;
287 272
             // 
288
-            // pictureBox5
273
+            // panel_ChildForm
289 274
             // 
290
-            this.pictureBox5.Image = global::DataRequest.Properties.Resources.red_s;
291
-            this.pictureBox5.Location = new System.Drawing.Point(106, 498);
292
-            this.pictureBox5.Name = "pictureBox5";
293
-            this.pictureBox5.Size = new System.Drawing.Size(25, 20);
294
-            this.pictureBox5.TabIndex = 11;
295
-            this.pictureBox5.TabStop = false;
275
+            this.panel_ChildForm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
276
+            this.panel_ChildForm.Controls.Add(this.pictureBox1);
277
+            this.panel_ChildForm.Dock = System.Windows.Forms.DockStyle.Fill;
278
+            this.panel_ChildForm.Location = new System.Drawing.Point(0, 0);
279
+            this.panel_ChildForm.Name = "panel_ChildForm";
280
+            this.panel_ChildForm.Size = new System.Drawing.Size(800, 539);
281
+            this.panel_ChildForm.TabIndex = 1;
282
+            // 
283
+            // pictureBox1
284
+            // 
285
+            this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None;
286
+            this.pictureBox1.Image = global::DataRequest.Properties.Resources.bluecell_logo;
287
+            this.pictureBox1.Location = new System.Drawing.Point(348, 211);
288
+            this.pictureBox1.Name = "pictureBox1";
289
+            this.pictureBox1.Size = new System.Drawing.Size(150, 42);
290
+            this.pictureBox1.TabIndex = 0;
291
+            this.pictureBox1.TabStop = false;
292
+            // 
293
+            // timer1
294
+            // 
295
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
296 296
             // 
297 297
             // Main
298 298
             // 
@@ -306,16 +306,16 @@
306 306
             this.Text = "Form1";
307 307
             this.Load += new System.EventHandler(this.Main_Load);
308 308
             this.panel1.ResumeLayout(false);
309
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
310
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
311
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
312
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Tx)).EndInit();
309 313
             this.panel4.ResumeLayout(false);
310 314
             this.panel3.ResumeLayout(false);
315
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
311 316
             this.panel2.ResumeLayout(false);
312 317
             this.panel_ChildForm.ResumeLayout(false);
313 318
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
314
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
315
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Tx)).EndInit();
316
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
317
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
318
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
319 319
             this.ResumeLayout(false);
320 320
 
321 321
         }

+ 27 - 16
DataRequest/Table.cs

@@ -16,6 +16,20 @@ namespace DataRequest
16 16
     public partial class Table : Form
17 17
     {
18 18
         public Form main_form;
19
+
20
+        enum NessLab_Index
21
+        {
22
+            NessLab_Header0 = 0,
23
+            NessLab_Header1,
24
+            NessLab_MsgID0,
25
+            NessLab_MsgSN0,
26
+            NessLab_MsgSN1,
27
+            NessLab_Reserve0,
28
+            NessLab_DataLength,
29
+        };
30
+
31
+
32
+
19 33
         public Table()
20 34
         {
21 35
             InitializeComponent();
@@ -238,7 +252,7 @@ namespace DataRequest
238 252
             byte[] ret_array = new byte[temp_array.Length * 2 + 10];
239 253
             Etc_Function etc_Function = new Etc_Function();
240 254
             GridView_array(ref temp_array);
241
-            ret_array = etc_Function.NessLab_Protocol_Create(temp_array, (int)Etc_Function.NessLab_Protocol_Index.NessLab_TableSet_Req);
255
+            ret_array = etc_Function.NessLab_Protocol_Create(temp_array, (int)Etc_Function.NessLab_Protocol_CMD_Index.NessLab_TableSet_Req);
242 256
 
243 257
             ((Main)main_form).serial.Serial_DataSend(ret_array, ret_array.Length);
244 258
             ((Main)main_form).TimerIntervalCnt = 0;
@@ -246,9 +260,15 @@ namespace DataRequest
246 260
 
247 261
         private void button_Dev_Load_Click(object sender, EventArgs e)
248 262
         {
249
-            //byte[] temp_array =
250
-            //((Main)main_form).serial.Serial_DataSend(, temp_array.Length);
251
-            //((Main)main_form).TimerIntervalCnt = 0;
263
+            double[] temp_array = new double[dataGridView_TableSetting.RowCount];
264
+            byte[] ret_array = new byte[temp_array.Length * 2 + 10];
265
+
266
+            Etc_Function etc_Function = new Etc_Function();
267
+
268
+            ret_array = etc_Function.NessLab_Protocol_Create(temp_array, (int)Etc_Function.NessLab_Protocol_CMD_Index.NessLab_Table_Req);
269
+
270
+            ((Main)main_form).serial.Serial_DataSend(ret_array, ret_array.Length);
271
+            ((Main)main_form).TimerIntervalCnt = 0;
252 272
         }
253 273
 
254 274
         private void button_Initialize_Click(object sender, EventArgs e)
@@ -297,24 +317,15 @@ namespace DataRequest
297 317
             }
298 318
             return Tmplist;
299 319
         }
300
-        enum NessLab_Index{
301
-            NessLab_Header0 = 0,
302
-            NessLab_Header1,
303
-            NessLab_MsgID0,
304
-            NessLab_MsgSN0,
305
-            NessLab_MsgSN1,
306
-            NessLab_Reserve0,
307
-            NessLab_DataLength,
308
-        };
309
-        
320
+
310 321
         public void Table_Setting(byte[] data)
311 322
         {
312 323
             //dataGridView_TableSetting.RowCount = data[(int)NessLab_Index.NessLab_DataLength];
313 324
             double ret = 0;
314 325
 
315
-            for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
326
+            for (int i = 0; i < data[(int)NessLab_Index.NessLab_DataLength] / 2; i++)
316 327
             {
317
-                ret = (double)((data[(int)((i * 2) + NessLab_Index.NessLab_DataLength)] << 8) | data[(int)((i * 2) + NessLab_Index.NessLab_DataLength + 1)]) / 1000;
328
+                ret = (double)((data[(int)((i * 2) + (NessLab_Index.NessLab_DataLength + 1))] << 8) | data[(int)((i * 2) + NessLab_Index.NessLab_DataLength + 2)]) / 1000;
318 329
                 dataGridView_TableSetting[1, i].Value = ret;
319 330
             }
320 331