mxpopstar
2022-05-03 e75ef5f04f61aa5fbd89fd5c413dcee1819b7a91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
package com.dev.fbs9600_zdhj;
 
import javax.swing.JPanel;
 
import java.awt.GridLayout;
 
import javax.swing.JScrollPane;
 
import java.awt.BorderLayout;
 
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.UIManager;
 
import java.awt.Color;
 
import javax.swing.JButton;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JTable;
 
import com.Com;
 
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Date;
import java.util.Vector;
 
import javax.swing.BoxLayout;
import javax.swing.JTabbedPane;
import javax.swing.ImageIcon;
 
import org.apache.logging.log4j.Logger;
 
import main.page_debug_inf;
 
public class zdhj_page_base extends JPanel {
    public static int LANG_TYPE_CN = 0;
    public static int LANG_TYPE_EN = 1;
    public static int LANG_TYPE    = LANG_TYPE_CN;
    public SPCommZDHJ Comm_ZDHJ = null;
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private JTextField tf_zdhj_res_test_count;
    private JTextField tf_op_rest_inf;
    private JTextField tf_zdhj_version;
    private JTextField tf_zdhj_moncount;
    private JTextField tf_zdhj_zdvol;
    private JTextField tf_wenbo_curr_avg;
    private JTextField tf_wenbo_curr_peak;
    private JTextField tf_zdhj_curr;
 
    private JComboBox<?> cb_zdhj_state;
    private JComboBox<?> cb_zdhj_curr_dir;
    private JComboBox<?> cb_zdhj_batt_state;
    private JComboBox<?> cb_zdhj_current_res_test_mode;
    private JButton btn_zdhj_restest_start;
    private JButton btn_zdhj_restest_stop;
    
    private JTabbedPane tabbedPane = null;
    
    private JTable table_zdhj_data;
    private Vector<String> columnVector;
    private Vector<Vector<String>> dataRow;
    
    private page_debug_inf panel_ZDHJ_debug;
    private zdhj_page_chart panel_ZDHJ_chart;
    private zdhj_page_param panel_ZDHJ_param;
    private zdhj_page_record panel_ZDHJ_record;
    
    /**
     * Create the panel.
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public zdhj_page_base() {
        setLayout(new BorderLayout(0, 0));
        columnVector = new Vector<String>();
        
        String zdhj_title = "µ¥Ìåµçѹ(V) / µ¥ÌåÄÚ×è(m¦¸) / µ¥ÌåζÈ(¡æ)";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "MonVol(V) / MonRes(m¦¸) / MonTmp(¡æ)";
        }
        
        zdhj_title = "µ¥Ìå±àºÅ";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "MonNum";
        }
        columnVector.add(zdhj_title);
        
        zdhj_title = "µçѹ(V)";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Vol(V)";
        }
        columnVector.add(zdhj_title);
        /*zdhj_title = "µçѹ¸æ¾¯";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "VolAlarm";
        }
        columnVector.add(zdhj_title);*/
        
        zdhj_title = "ÄÚ×è(m¦¸)";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Res(m¦¸)";
        }
        columnVector.add(zdhj_title);
        /*zdhj_title = "ÄÚ×è¸æ¾¯";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "ResAlarm";
        }
        columnVector.add(zdhj_title);*/
        
        zdhj_title = "ζÈ(¡æ)";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Tmp(¡æ)";
        }
        columnVector.add(zdhj_title);
        /*zdhj_title = "ζȸ澯";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "TmpAlarm";
        }
        columnVector.add(zdhj_title);*/
        zdhj_title = "¾ùºâµçÁ÷(mA)";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "JHCurr(mA)";
        }
        columnVector.add(zdhj_title);
        
        dataRow = new Vector<Vector<String>>();
        MouseAdapter m_a = new MouseAdapter() {
            public void mouseReleased(MouseEvent e) {
                if(e.getSource() != table_zdhj_data) {
                    return;
                }
                /*
                int selectColumn = m_JTable.columnAtPoint(e.getPoint());
                int selectRow = m_JTable.rowAtPoint(e.getPoint());
                if (selectColumn == mCheckBoxColnumIndex) {
                    boolean value = (boolean) m_JTable.getValueAt(selectRow, selectColumn);
                    m_UI_Monit.m_MonLineChart.getSeries(selectRow+1).setVisible(!value);
                }
                */
            }
            public void mousePressed(MouseEvent evt) {
                if (evt.getButton() == MouseEvent.BUTTON3) {
                    JPopupMenu popupMenu = new JPopupMenu();
                        JMenuItem tableItem_export_data = null;
                    String it_str = "¸´ÖƵ½¼ôÌù°å";
                      if(LANG_TYPE_EN == LANG_TYPE) {
                          it_str = "Copy To Clipboard";
                      }
                    tableItem_export_data = new JMenuItem(it_str);
                    tableItem_export_data.addActionListener(new ActionListener(){
                        @Override
                        public void actionPerformed(ActionEvent arg0) {
                            Clipboard clipboard = getToolkit().getSystemClipboard();
                            String temp = "";
                            for(int c=0; c<columnVector.size(); c++) {
                                temp += columnVector.get(c) + "\t";
                            }
                            temp += "\n";
                            for(int r=0; r<dataRow.size(); r++) {
                                for(int c=0; c<columnVector.size(); c++) {
                                    temp += dataRow.get(r).get(c) + "\t";
                                }
                                temp += "\n";
                            }
                            StringSelection text = new StringSelection(temp);
                            clipboard.setContents(text, null);
                        }
                    });
                    popupMenu.add(tableItem_export_data);
                    popupMenu.show(evt.getComponent(), evt.getX(), evt.getY());
                  }
            }
        };
        
        /*
        zdhj_title = "Ä£¿é°æ±¾";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Module Version";
        }
        zdhj_title = "µ¥Ìå×ÜÊý";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Mon Sum";
        }
        zdhj_title = "×é¶Ëµçѹ(V) / µçÁ÷(A)";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Group Vol(V) / Curr(A)";
        }
        zdhj_title = "Ä£¿é״̬";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Module State";
        }
        String zdhj_title_str[] = new String[]{"Õý³£²É¼¯", "ÄÚ×è²âÊÔ", "µ¥Ìå±àºÅ"};
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title_str = new String[]{"Normal Work", "Res Test", "Mon Numberd"};
        }
        zdhj_title = "µçÁ÷·½Ïò";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Curr Direction";
        }
        zdhj_title_str = new String[]{"³äµç·½Ïò", "·Åµç·½Ïò"};
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title_str = new String[]{"Dir Charge", "Dir Discharge"};
        }
        zdhj_title = "µç³Ø×´Ì¬";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Batt State";
        }
        zdhj_title_str = new String[]{"¸¡³ä", "·Åµç", "³äµç"};
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title_str = new String[]{"Float Charge", "Discharge", "Charge"};
        }
        zdhj_title = "ƽ¾ùÒò×Ó";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Ripple Wave AVG Curr(A)";
        }
        zdhj_title = "¼«ÏÞÒò×Ó";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Ripple Wave PPM Curr(A)";
        }
        zdhj_title = "µ±Ç°ÄÚ×è²âÊÔ·½·¨ / ÄÚ×èÒѲâÊÔ´ÎÊý / ÄÚ×è²âÊÔ²Ù×÷";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Res Test Type / Res Test Count / Res Test Operation";
        }
        zdhj_title_str = new String[]{"ÄÚ×è²É¼¯AÒì²½", "ÄÚ×è²É¼¯Aͬ²½", "ÄÚ×è²É¼¯B"};
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title_str = new String[]{"Single Discharge", "Broadcast Discharge", "Ripple Wave Test"};
        }
        zdhj_title = "²Ù×÷½á¹ûÐÅÏ¢";
        if(LANG_TYPE_EN == LANG_TYPE) {
            zdhj_title = "Operation Result Inf";
        } 
        */
        
        tabbedPane = new JTabbedPane(JTabbedPane.TOP);
        add(tabbedPane, BorderLayout.CENTER);
        
        JPanel panel_11 = new JPanel();
        tabbedPane.addTab("\u57FA\u672C\u6D4B\u8BD5", new ImageIcon(zdhj_page_base.class.getResource("/png_16x16/target.png")), panel_11, null);
        panel_11.setLayout(new BorderLayout(0, 0));
        
        JPanel panel_1 = new JPanel();
        panel_11.add(panel_1, BorderLayout.CENTER);
        panel_1.setLayout(new BorderLayout(0, 0));
        
        JScrollPane scrollPane_2 = new JScrollPane();
        panel_1.add(scrollPane_2);
        
        table_zdhj_data = new JTable();
        table_zdhj_data.setModel(new DefaultTableModel(dataRow, columnVector));
        
        table_zdhj_data.addMouseListener(m_a);
        scrollPane_2.setViewportView(table_zdhj_data);
        
        JPanel panel = new JPanel();
        panel_11.add(panel, BorderLayout.WEST);
        panel.setLayout(new BorderLayout(0, 0));
        
        JPanel panel_2 = new JPanel();
        panel.add(panel_2, BorderLayout.NORTH);
        panel_2.setLayout(new GridLayout(5, 2, 0, 0));
        
        JPanel panel_4 = new JPanel();
        panel_4.setBorder(new TitledBorder(null, "\u6A21\u5757\u7248\u672C", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_4);
        panel_4.setLayout(new BorderLayout(0, 0));
        
        tf_zdhj_version = new JTextField();
        panel_4.add(tf_zdhj_version);
        tf_zdhj_version.setColumns(10);
        
        JPanel panel_3 = new JPanel();
        panel_3.setBorder(new TitledBorder(null, "\u5355\u4F53\u603B\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_3);
        panel_3.setLayout(new BorderLayout(0, 0));
        
        tf_zdhj_moncount = new JTextField();
        panel_3.add(tf_zdhj_moncount);
        tf_zdhj_moncount.setColumns(10);
        
        JPanel panel_5 = new JPanel();
        panel_5.setBorder(new TitledBorder(null, "\u7EC4\u7AEF\u7535\u538B(V) / \u7535\u6D41(A)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_5);
        panel_5.setLayout(new GridLayout(0, 1, 0, 0));
        
        tf_zdhj_zdvol = new JTextField();
        panel_5.add(tf_zdhj_zdvol);
        tf_zdhj_zdvol.setColumns(10);
        
        tf_zdhj_curr = new JTextField();
        panel_5.add(tf_zdhj_curr);
        tf_zdhj_curr.setColumns(10);
        
        JPanel panel_6 = new JPanel();
        panel_6.setBorder(new TitledBorder(null, "\u6A21\u5757\u72B6\u6001", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_6);
        panel_6.setLayout(new BorderLayout(0, 0));
        
        cb_zdhj_state = new JComboBox();
        cb_zdhj_state.setModel(new DefaultComboBoxModel(new String[] {"\u6B63\u5E38\u91C7\u96C6", "\u5185\u963B\u6D4B\u8BD5", "\u5355\u4F53\u7F16\u53F7"}));
        panel_6.add(cb_zdhj_state);
        
        JPanel panel_7 = new JPanel();
        panel_7.setBorder(new TitledBorder(null, "\u7535\u6D41\u65B9\u5411", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_7);
        panel_7.setLayout(new BorderLayout(0, 0));
        
        cb_zdhj_curr_dir = new JComboBox();
        cb_zdhj_curr_dir.setModel(new DefaultComboBoxModel(new String[] {"\u5145\u7535\u65B9\u5411", "\u653E\u7535\u65B9\u5411"}));
        panel_7.add(cb_zdhj_curr_dir);
        
        JPanel panel_8 = new JPanel();
        panel_8.setBorder(new TitledBorder(null, "\u7535\u6C60\u72B6\u6001", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_8);
        panel_8.setLayout(new BorderLayout(0, 0));
        
        cb_zdhj_batt_state = new JComboBox();
        cb_zdhj_batt_state.setModel(new DefaultComboBoxModel(new String[] {"\u6D6E\u5145\u72B6\u6001", "\u653E\u7535\u72B6\u6001", "\u5145\u7535\u72B6\u6001"}));
        panel_8.add(cb_zdhj_batt_state);
        
        JPanel panel_9 = new JPanel();
        panel_9.setBorder(new TitledBorder(null, "\u5E73\u5747\u56E0\u5B50", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_9);
        panel_9.setLayout(new BorderLayout(0, 0));
        
        tf_wenbo_curr_avg = new JTextField();
        panel_9.add(tf_wenbo_curr_avg);
        tf_wenbo_curr_avg.setColumns(10);
        
        JPanel panel_10 = new JPanel();
        panel_10.setBorder(new TitledBorder(null, "\u5CF0\u503C\u56E0\u5B50", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_10);
        panel_10.setLayout(new BorderLayout(0, 0));
        
        tf_wenbo_curr_peak = new JTextField();
        panel_10.add(tf_wenbo_curr_peak);
        tf_wenbo_curr_peak.setColumns(10);
        
        JPanel panel_13 = new JPanel();
        panel.add(panel_13, BorderLayout.SOUTH);
        panel_13.setLayout(new GridLayout(2, 0, 0, 0));
        
        JPanel panel_14 = new JPanel();
        panel_14.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5185\u963B\u6D4B\u8BD5\u65B9\u6CD5 / \u5185\u963B\u5DF2\u6D4B\u6B21\u6570 / \u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
        panel_13.add(panel_14);
        panel_14.setLayout(new BoxLayout(panel_14, BoxLayout.X_AXIS));
        
        cb_zdhj_current_res_test_mode = new JComboBox();
        cb_zdhj_current_res_test_mode.setModel(new DefaultComboBoxModel(new String[] {"\u5355\u8282\u653E\u7535", "\u540C\u65F6\u653E\u7535", "\u5F55\u64AD"}));
        panel_14.add(cb_zdhj_current_res_test_mode);
        
        tf_zdhj_res_test_count = new JTextField();
        panel_14.add(tf_zdhj_res_test_count);
        tf_zdhj_res_test_count.setColumns(10);
        
        btn_zdhj_restest_start = new JButton("\u542F\u52A8");
        btn_zdhj_restest_start.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                if(null == Comm_ZDHJ) {
                    return;
                }
                
                short[] res_type_tag = new short[1];
                res_type_tag[0] = 0x0000;
                Comm_ZDHJ.setCommCmd(Comm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_ResTest_Start_RegAddr, 
                                            res_type_tag, res_type_tag.length);
            }
        });
        panel_14.add(btn_zdhj_restest_start);
        
        btn_zdhj_restest_stop = new JButton("\u505C\u6B62");
        btn_zdhj_restest_stop.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if(null == Comm_ZDHJ) {
                    return;
                }
                
                short[] res_type_tag = new short[1];
                res_type_tag[0] = (short) 0x0000;
                Comm_ZDHJ.setCommCmd(Comm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_ResTest_Stop_RegAddr, 
                                            res_type_tag, res_type_tag.length);
            }
        });
        panel_14.add(btn_zdhj_restest_stop);
        
        JPanel panel_15 = new JPanel();
        panel_15.setBorder(new TitledBorder(null, "\u64CD\u4F5C\u7ED3\u679C\u4FE1\u606F", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_13.add(panel_15);
        panel_15.setLayout(new BorderLayout(0, 0));
        
        tf_op_rest_inf = new JTextField();
        panel_15.add(tf_op_rest_inf);
        tf_op_rest_inf.setColumns(10);
        
        panel_ZDHJ_chart = new zdhj_page_chart();
        tabbedPane.addTab("\u56FE\u5F62\u6570\u636E", new ImageIcon(zdhj_page_base.class.getResource("/png_16x16/chart_bar.png")), panel_ZDHJ_chart, null);
        
        panel_ZDHJ_param = new zdhj_page_param();
        tabbedPane.addTab("\u53C2\u6570\u8BBE\u7F6E", new ImageIcon(zdhj_page_base.class.getResource("/png_16x16/application_edit.png")), panel_ZDHJ_param, null);
        
        panel_ZDHJ_record = new zdhj_page_record();
        tabbedPane.addTab("\u6570\u636E\u8BB0\u5F55", new ImageIcon(zdhj_page_base.class.getResource("/png_16x16/disk.png")), panel_ZDHJ_record, null);
        
        panel_ZDHJ_debug = new page_debug_inf();
        tabbedPane.addTab("\u8C03\u8BD5\u4FE1\u606F", new ImageIcon(zdhj_page_base.class.getResource("/png_16x16/exclamation.png")), panel_ZDHJ_debug, null);
        setButttonState(false);
    }
    
    public boolean openCommPort(int comm_type, String spname_or_ipaddr, 
                                int bitrate_or_ipport, int dev_addr, Logger log) {
        boolean res = false;
        
        Comm_ZDHJ = new SPCommZDHJ(dev_addr, bitrate_or_ipport, panel_ZDHJ_debug, log);
        if(true == Comm_ZDHJ.OpenCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport)) {
            Thread spcommThread = new Thread(Comm_ZDHJ);
            spcommThread.start();
            
            panel_ZDHJ_chart.setSerialComm_ZDHJ(Comm_ZDHJ);
            panel_ZDHJ_param.setSerialComm_ZDHJ(Comm_ZDHJ);
            panel_ZDHJ_record.setSerialComm_ZDHJ(Comm_ZDHJ);
            
            setButttonState(true);
            
            res = true;
        }
        
        return res;
    }
    
    public void closeCommPort() {
        if(null != Comm_ZDHJ) {
            Comm_ZDHJ.CloseCommPort();
            Comm_ZDHJ = null;
            panel_ZDHJ_chart.setSerialComm_ZDHJ(Comm_ZDHJ);
            panel_ZDHJ_param.setSerialComm_ZDHJ(Comm_ZDHJ);
            panel_ZDHJ_record.setSerialComm_ZDHJ(Comm_ZDHJ);
            
            setButttonState(false);
        }
    }
    
    public void setButttonState(boolean state) {
        btn_zdhj_restest_start.setEnabled(state);
        btn_zdhj_restest_stop.setEnabled(state);
        
        panel_ZDHJ_param.setButttonState(state);
        panel_ZDHJ_record.setButttonState(state);
    }
    
    public void updateData() {
        if(null != Comm_ZDHJ) {
            String ver = String.format("V%1.1f", ((double)Comm_ZDHJ.dev_stat_version)/10);
            if(SPCommZDHJ.ZDHJ_SUPPORT_JUHENG_YES == Comm_ZDHJ.dev_is_support_juheng) {
                ver += " (JH Curr)";
            }
            tf_zdhj_version.setText(ver);
            tf_zdhj_moncount.setText(String.format("%d", Comm_ZDHJ.ZDHJ_BattCount));
            tf_zdhj_zdvol.setText(String.format("%1.1f", Comm_ZDHJ.GroupVol));
            cb_zdhj_state.setSelectedIndex(Comm_ZDHJ.dev_stat_state);
            tf_zdhj_curr.setText(String.format("%1.1f", Comm_ZDHJ.BattCurr));
            cb_zdhj_curr_dir.setSelectedIndex(Comm_ZDHJ.BattCurrDir);
            tf_wenbo_curr_avg.setText(String.format("%1.2f", Comm_ZDHJ.AvgWenBoCurr));
            tf_wenbo_curr_peak.setText(String.format("%1.2f", Comm_ZDHJ.PeakWenBoCurr));
            cb_zdhj_batt_state.setSelectedIndex(Comm_ZDHJ.BattState
                                                            %cb_zdhj_batt_state.getItemCount());
            cb_zdhj_current_res_test_mode.setSelectedIndex(Comm_ZDHJ.CurentResTestMode
                                                            %cb_zdhj_current_res_test_mode.getItemCount());
            tf_zdhj_res_test_count.setText(String.format("%d", Comm_ZDHJ.ResTestCount));
            
            String inf_t = "";
            if(Math.abs(new Date().getTime() - Comm_ZDHJ.dt_cmd_ack_time.getTime()) < (1000*5)) {
                inf_t = SPCommZDHJ.ZDHJ_OP_REST_INF_TEXT[Comm_ZDHJ.dt_cmd_ack]
                        + " @ " + Com.get_DTF(Comm_ZDHJ.dt_cmd_ack_time, Com.DTF_YMDhms);
                /*if(LANG_TYPE_EN == LANG_TYPE) {
                    inf_t = SPCommZDHJ.ZDHJ_OP_REST_INF_TEXT_EN[SerialComm_ZDHJ.dt_cmd_ack]
                            + " @ " + Com.get_DTF(SerialComm_ZDHJ.dt_cmd_ack_time, Com.DTF_YMDhms);
                }*/
            }
            tf_op_rest_inf.setText(inf_t);
            
            int mon_cnt = Comm_ZDHJ.ZDHJ_BattCount;
            if(dataRow.size() != mon_cnt)
            {
                dataRow.clear();
                for(int n=0; n<mon_cnt; n++) {
                    Vector<String> row = new Vector<String>();
                    row.addElement(String.format("%03d", n+1));
                    row.addElement(String.format("%1.3f", Comm_ZDHJ.monVol[n]));
                    row.addElement(String.format("%1.3f", Comm_ZDHJ.monRes[n]));
                    row.addElement(String.format("%1.1f", Comm_ZDHJ.monTmp[n]));
                    row.addElement(String.format("%1.0f", Comm_ZDHJ.monJHCurr[n]));
                    dataRow.add(row);
                }
            } else {
                for(int n=0; n<mon_cnt; n++) {
                    dataRow.get(n).setElementAt(String.format("%1.3f", Comm_ZDHJ.monVol[n]), 1);
                    dataRow.get(n).setElementAt(String.format("%1.3f", Comm_ZDHJ.monRes[n]), 2);
                    dataRow.get(n).setElementAt(String.format("%1.1f", Comm_ZDHJ.monTmp[n]), 3);
                    dataRow.get(n).setElementAt(String.format("%1.0f", Comm_ZDHJ.monJHCurr[n]), 4);
                }
            }
            table_zdhj_data.updateUI();
            
            
            panel_ZDHJ_chart.updateDate();
            panel_ZDHJ_param.updateData();
            panel_ZDHJ_record.updateData();
        }
    }
}