package com.dev.fbs9600_zdhj;
|
|
import java.awt.Color;
|
import java.awt.Font;
|
import java.awt.GridLayout;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.util.Date;
|
|
import javax.swing.BoxLayout;
|
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.JButton;
|
import javax.swing.JComboBox;
|
import javax.swing.JOptionPane;
|
import javax.swing.JPanel;
|
import javax.swing.JTextField;
|
import javax.swing.UIManager;
|
import javax.swing.border.TitledBorder;
|
|
import com.Com;
|
import com.LimitedDocument;
|
|
import java.awt.BorderLayout;
|
import java.awt.FlowLayout;
|
|
public class zdhj_page_param extends JPanel {
|
public static int LANG_TYPE_CN = 0;
|
public static int LANG_TYPE_EN = 1;
|
public static int LANG_TYPE = LANG_TYPE_CN;
|
private SPCommZDHJ SerialComm_ZDHJ = null;
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
private JTextField tf_zdhj_ch1_cnt;
|
private JTextField tf_zdhj_ch2_cnt;
|
private JTextField tf_zdhj_ch3_cnt;
|
private JTextField tf_zdhj_ch4_cnt;
|
private JTextField tf_zdhj_ch5_cnt;
|
private JTextField tf_zdhj_devaddr;
|
private JTextField tf_zdhj_curr_range;
|
private JTextField tf_zdhj_volcal_source;
|
private JTextField tf_zdhj_volcal_slope;
|
private JTextField tf_zdhj_currcal_source;
|
private JTextField tf_zdhj_currcal_slope;
|
private JButton btn_zdhj_volcal_offset;
|
private JButton btn_zdhj_volcal_slope;
|
private JButton btn_zdhj_volcal_reset;
|
private JButton btn_zdhj_currcal_offset;
|
private JButton btn_zdhj_currcal_slope;
|
private JButton btn_zdhj_currcal_reset;
|
private JButton btn_zdhj_param_read;
|
private JButton btn_zdhj_param_write;
|
private JTextField tf_zdhj_tmp_cal;
|
private JButton btn_zdhj_temp_cal_reset;
|
private JButton btn_zdhj_temp_cal;
|
private JTextField tf_zdhj_autores_interval;
|
private JTextField tf_zdhj_wenbo_curr_lev;
|
private JComboBox<String> cb_zdhj_res_testtype;
|
private JTextField tf_param_set_inf;
|
private JTextField tf_zdhj_res_dis_slope;
|
private JTextField tf_zdhj_mon_stdcap;
|
private JTextField tf_zdhj_res_wenbo_slope;
|
private JComboBox<String> cb_zdhj_res_dis_mode;
|
private JTextField tf_zdhj_temp;
|
private JTextField tf_zdhj_batt_floatcurr_lev;
|
private JComboBox<String> cb_monnum_setmode;
|
private JButton btn_restart_dev;
|
private JTextField tf_zdhj_devid;
|
private JTextField tf_respm_d1;
|
private JTextField tf_respm_d2;
|
private JTextField tf_respm_d3;
|
private JTextField tf_respm_d4;
|
private JTextField tf_respm_s1;
|
private JTextField tf_respm_s2;
|
private JTextField tf_respm_s3;
|
private JTextField tf_respm_s4;
|
private JPanel panel;
|
private JPanel panel_1;
|
private JPanel panel_2;
|
private JPanel panel_3;
|
private JPanel panel_4;
|
private JPanel panel_5;
|
private JPanel panel_6;
|
private JPanel panel_7;
|
private JPanel panel_8;
|
private JPanel panel_9;
|
private JPanel panel_10;
|
private JPanel panel_11;
|
private JPanel panel_12;
|
private JPanel panel_13;
|
private JPanel panel_14;
|
private JPanel panel_15;
|
private JPanel panel_16;
|
/**
|
* Create the panel.
|
*/
|
public zdhj_page_param() {
|
JPanel panel_48 = new JPanel();
|
String zdhj_title = "Ä£¿é²ÎÊý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Module Param Setup";
|
}
|
setLayout(new BorderLayout(0, 0));
|
add(panel_48, BorderLayout.NORTH);
|
panel_48.setLayout(new GridLayout(7, 1, 0, 0));
|
|
JPanel panel_49 = new JPanel();
|
zdhj_title = "Ä£¿éµØÖ· / µçÁ÷Á¿³Ì(A) / ÄÚ×èÖÜÆÚ(H) / ÄÚ×èÀàÐÍ / ÄÚ×è²É¼¯·§Öµ(A) / ÄÚ×è²É¼¯Aģʽ / ÄÚ×è²É¼¯AϵÊý / ÄÚ×è²É¼¯BϵÊý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Module Addr / Curr Range(A) / ResTestTimeInt(H) / ResTestType / Ripple Wave Level(A) / Discharge Mode / Discharge Param / Ripple Wave Param";
|
}
|
panel_48.add(panel_49);
|
panel_49.setLayout(new GridLayout(0, 8, 2, 0));
|
|
panel = new JPanel();
|
panel.setBorder(new TitledBorder(null, "\u6A21\u5757\u5730\u5740", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel);
|
panel.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_devaddr = new JTextField();
|
panel.add(tf_zdhj_devaddr, BorderLayout.CENTER);
|
tf_zdhj_devaddr.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_devaddr.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_zdhj_devaddr.setColumns(10);
|
|
panel_1 = new JPanel();
|
panel_1.setBorder(new TitledBorder(null, "\u7535\u6D41\u91CF\u7A0B(A)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_1);
|
panel_1.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_curr_range = new JTextField();
|
panel_1.add(tf_zdhj_curr_range, BorderLayout.CENTER);
|
tf_zdhj_curr_range.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_curr_range.setDocument(new LimitedDocument(4, "0123456789"));
|
tf_zdhj_curr_range.setColumns(10);
|
|
panel_2 = new JPanel();
|
panel_2.setBorder(new TitledBorder(null, "\u5185\u963B\u5468\u671F(H)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_2);
|
panel_2.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_autores_interval = new JTextField();
|
panel_2.add(tf_zdhj_autores_interval, BorderLayout.CENTER);
|
tf_zdhj_autores_interval.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_autores_interval.setDocument(new LimitedDocument(4, "0123456789"));
|
tf_zdhj_autores_interval.setColumns(10);
|
|
panel_3 = new JPanel();
|
panel_3.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5185\u963B\u65B9\u6CD5", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_49.add(panel_3);
|
panel_3.setLayout(new BorderLayout(0, 0));
|
|
cb_zdhj_res_testtype = new JComboBox<String>();
|
panel_3.add(cb_zdhj_res_testtype, BorderLayout.CENTER);
|
cb_zdhj_res_testtype.setFont(new Font("Dialog", Font.PLAIN, 14));
|
cb_zdhj_res_testtype.setModel(new DefaultComboBoxModel<String>(new String[] {"\u653E\u7535", "\u5F55\u64AD", "\u81EA\u52A8"}));
|
cb_zdhj_res_testtype.setSelectedIndex(0);
|
|
panel_4 = new JPanel();
|
panel_4.setBorder(new TitledBorder(null, "\u5185\u963B\u9608\u503C(A)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_4);
|
panel_4.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_wenbo_curr_lev = new JTextField();
|
panel_4.add(tf_zdhj_wenbo_curr_lev, BorderLayout.CENTER);
|
tf_zdhj_wenbo_curr_lev.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_wenbo_curr_lev.setDocument(new LimitedDocument(4, "0123456789."));
|
tf_zdhj_wenbo_curr_lev.setColumns(10);
|
String[] zdhj_title_str = new String[]{"ÄÚ×è²É¼¯A", "ÄÚ×è²É¼¯B", "×Ô¶¯"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Discharge", "Ripple Wave", "Auto"};
|
}
|
|
panel_5 = new JPanel();
|
panel_5.setBorder(new TitledBorder(null, "\u5185\u963B\u6A21\u5F0F", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_5);
|
panel_5.setLayout(new BorderLayout(0, 0));
|
|
cb_zdhj_res_dis_mode = new JComboBox<String>();
|
panel_5.add(cb_zdhj_res_dis_mode, BorderLayout.CENTER);
|
cb_zdhj_res_dis_mode.setFont(new Font("Dialog", Font.PLAIN, 14));
|
cb_zdhj_res_dis_mode.setModel(new DefaultComboBoxModel<String>(new String[] {"\u5355\u8282\u6D4B\u8BD5", "\u540C\u65F6\u6D4B\u8BD5"}));
|
cb_zdhj_res_dis_mode.setSelectedIndex(0);
|
zdhj_title_str = new String[]{"Òì²½²âÊÔ", "ͬ²½²âÊÔ"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Single Discharge", "BroadCast Discharge"};
|
}
|
|
panel_6 = new JPanel();
|
panel_6.setBorder(new TitledBorder(null, "\u6A21\u5F0FA\u7CFB\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_6);
|
panel_6.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_res_dis_slope = new JTextField();
|
panel_6.add(tf_zdhj_res_dis_slope, BorderLayout.CENTER);
|
tf_zdhj_res_dis_slope.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_res_dis_slope.setDocument(new LimitedDocument(6, "0123456789."));
|
tf_zdhj_res_dis_slope.setColumns(10);
|
|
panel_7 = new JPanel();
|
panel_7.setBorder(new TitledBorder(null, "\u6A21\u5F0FB\u7CFB\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_7);
|
panel_7.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_res_wenbo_slope = new JTextField();
|
panel_7.add(tf_zdhj_res_wenbo_slope, BorderLayout.CENTER);
|
tf_zdhj_res_wenbo_slope.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_res_wenbo_slope.setDocument(new LimitedDocument(6, "0123456789."));
|
tf_zdhj_res_wenbo_slope.setColumns(10);
|
|
JPanel panel_51 = new JPanel();
|
zdhj_title = "Îå·µ¥ÌåͨµÀ¸÷×Ôµ¥ÌåÊý(1/2/3/4/5) / ±ê³ÆÈÝÁ¿(AH) / ¸¡³äµçÁ÷·§Öµ(A) / µ¥Ìå±àºÅģʽ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "5Channels Each Channel Mon Count(1/2/3/4/5) / Stander Batt Cap(AH) / Float Charge Vol Lev(A) / Mon Numbered mode";
|
}
|
panel_48.add(panel_51);
|
panel_51.setLayout(new GridLayout(0, 9, 2, 0));
|
|
panel_8 = new JPanel();
|
panel_8.setBorder(new TitledBorder(null, "#1\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_51.add(panel_8);
|
panel_8.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch1_cnt = new JTextField();
|
panel_8.add(tf_zdhj_ch1_cnt, BorderLayout.CENTER);
|
tf_zdhj_ch1_cnt.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_ch1_cnt.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_zdhj_ch1_cnt.setColumns(10);
|
|
panel_9 = new JPanel();
|
panel_9.setBorder(new TitledBorder(null, "#2\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_51.add(panel_9);
|
panel_9.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch2_cnt = new JTextField();
|
panel_9.add(tf_zdhj_ch2_cnt, BorderLayout.CENTER);
|
tf_zdhj_ch2_cnt.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_ch2_cnt.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_zdhj_ch2_cnt.setColumns(10);
|
|
panel_10 = new JPanel();
|
panel_10.setBorder(new TitledBorder(null, "#3\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_51.add(panel_10);
|
panel_10.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch3_cnt = new JTextField();
|
panel_10.add(tf_zdhj_ch3_cnt, BorderLayout.CENTER);
|
tf_zdhj_ch3_cnt.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_ch3_cnt.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_zdhj_ch3_cnt.setColumns(10);
|
|
panel_11 = new JPanel();
|
panel_11.setBorder(new TitledBorder(null, "#4\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_51.add(panel_11);
|
panel_11.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch4_cnt = new JTextField();
|
panel_11.add(tf_zdhj_ch4_cnt, BorderLayout.CENTER);
|
tf_zdhj_ch4_cnt.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_ch4_cnt.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_zdhj_ch4_cnt.setColumns(10);
|
|
panel_12 = new JPanel();
|
panel_12.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "#5\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_12);
|
panel_12.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch5_cnt = new JTextField();
|
panel_12.add(tf_zdhj_ch5_cnt, BorderLayout.CENTER);
|
tf_zdhj_ch5_cnt.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_ch5_cnt.setDocument(new LimitedDocument(5, "0123456789"));
|
tf_zdhj_ch5_cnt.setColumns(10);
|
|
panel_13 = new JPanel();
|
panel_13.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6807\u79F0\u5BB9\u91CF(AH)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_13);
|
panel_13.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_mon_stdcap = new JTextField();
|
panel_13.add(tf_zdhj_mon_stdcap, BorderLayout.CENTER);
|
tf_zdhj_mon_stdcap.setDocument(new LimitedDocument(4, "0123456789"));
|
tf_zdhj_mon_stdcap.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_mon_stdcap.setColumns(10);
|
|
panel_14 = new JPanel();
|
panel_14.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6D6E\u5145\u7535\u6D41(A)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_14);
|
panel_14.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_batt_floatcurr_lev = new JTextField();
|
panel_14.add(tf_zdhj_batt_floatcurr_lev, BorderLayout.CENTER);
|
tf_zdhj_batt_floatcurr_lev.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_batt_floatcurr_lev.setDocument(new LimitedDocument(4, "0123456789."));
|
tf_zdhj_batt_floatcurr_lev.setColumns(10);
|
zdhj_title_str = new String[]{"µ÷ÊÔģʽ", "Õý³£Ä£Ê½"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Debug Mode", "Normal Mode"};
|
}
|
|
panel_15 = new JPanel();
|
panel_15.setBorder(new TitledBorder(null, "\u7F16\u53F7\u6A21\u5F0F", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_51.add(panel_15);
|
panel_15.setLayout(new BorderLayout(0, 0));
|
|
cb_monnum_setmode = new JComboBox<String>();
|
panel_15.add(cb_monnum_setmode, BorderLayout.CENTER);
|
cb_monnum_setmode.setFont(new Font("Dialog", Font.PLAIN, 14));
|
cb_monnum_setmode.setModel(new DefaultComboBoxModel<String>(zdhj_title_str));
|
cb_monnum_setmode.setSelectedIndex(0);
|
|
panel_16 = new JPanel();
|
panel_16.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5747\u8861\u7535\u538B(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_16);
|
panel_16.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_devid = new JTextField();
|
tf_zdhj_devid.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_16.add(tf_zdhj_devid, BorderLayout.CENTER);
|
tf_zdhj_devid.setDocument(new LimitedDocument(5, "0123456789"));
|
tf_zdhj_devid.setColumns(10);
|
|
JPanel panel_54 = new JPanel();
|
zdhj_title = "²ÎÊýÉèÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Param Set";
|
}
|
|
JPanel panel_80 = new JPanel();
|
panel_80.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7EBF\u7F06\u8865\u507F(D1,D2,D3,D4 / S1,S2,S3,S4)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_48.add(panel_80);
|
panel_80.setLayout(new GridLayout(0, 8, 2, 0));
|
|
tf_respm_d1 = new JTextField();
|
tf_respm_d1.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_d1.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_d1);
|
tf_respm_d1.setColumns(10);
|
|
tf_respm_d2 = new JTextField();
|
tf_respm_d2.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_d2.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_d2);
|
tf_respm_d2.setColumns(10);
|
|
tf_respm_d3 = new JTextField();
|
tf_respm_d3.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_d3.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_d3);
|
tf_respm_d3.setColumns(10);
|
|
tf_respm_d4 = new JTextField();
|
tf_respm_d4.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_d4.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_d4);
|
tf_respm_d4.setColumns(10);
|
|
tf_respm_s1 = new JTextField();
|
tf_respm_s1.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_s1.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_s1);
|
tf_respm_s1.setColumns(10);
|
|
tf_respm_s2 = new JTextField();
|
tf_respm_s2.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_s2.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_s2);
|
tf_respm_s2.setColumns(10);
|
|
tf_respm_s3 = new JTextField();
|
tf_respm_s3.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_s3.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_s3);
|
tf_respm_s3.setColumns(10);
|
|
tf_respm_s4 = new JTextField();
|
tf_respm_s4.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_respm_s4.setDocument(new LimitedDocument(6, "0123456789."));
|
panel_80.add(tf_respm_s4);
|
tf_respm_s4.setColumns(10);
|
panel_54.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_48.add(panel_54);
|
panel_54.setLayout(new BoxLayout(panel_54, BoxLayout.X_AXIS));
|
|
tf_param_set_inf = new JTextField();
|
tf_param_set_inf.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_54.add(tf_param_set_inf);
|
tf_param_set_inf.setColumns(10);
|
|
JPanel panel_65 = new JPanel();
|
panel_54.add(panel_65);
|
panel_65.setLayout(new GridLayout(0, 3, 4, 0));
|
|
zdhj_title = "²ÎÊý¶ÁÈ¡";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Param Read";
|
}
|
btn_zdhj_param_read = new JButton(zdhj_title);
|
panel_65.add(btn_zdhj_param_read);
|
btn_zdhj_param_read.setEnabled(false);
|
btn_zdhj_param_read.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
SerialComm_ZDHJ.setCommCmd(SPCommZDHJ.CMD_TYPE_READ, SPCommZDHJ.ZDHJ_PARAM_RegAddr_Start, null, 0);
|
}
|
});
|
btn_zdhj_param_read.setFont(new Font("ËÎÌå", Font.PLAIN, 14));
|
|
zdhj_title = "²ÎÊýÉèÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Param Write";
|
}
|
btn_zdhj_param_write = new JButton(zdhj_title);
|
panel_65.add(btn_zdhj_param_write);
|
btn_zdhj_param_write.setEnabled(false);
|
btn_zdhj_param_write.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
short[] zdhj_param_data = new short[25];
|
try {
|
zdhj_param_data[0] = (short) Integer.parseInt(tf_zdhj_devaddr.getText());
|
|
short ch1_cnt = (short) Integer.parseInt(tf_zdhj_ch1_cnt.getText());
|
short ch2_cnt = (short) Integer.parseInt(tf_zdhj_ch2_cnt.getText());
|
short ch3_cnt = (short) Integer.parseInt(tf_zdhj_ch3_cnt.getText());
|
short ch4_cnt = (short) Integer.parseInt(tf_zdhj_ch4_cnt.getText());
|
short ch5_cnt = (short) Integer.parseInt(tf_zdhj_ch5_cnt.getText());
|
|
if((ch1_cnt + ch2_cnt + ch3_cnt + ch4_cnt/* + ch5_cnt*/) > SPCommZDHJ.ZDHJ_MON_COUNT_MAX) {
|
String tmp_str = "ËùÓÐͨµÀµ¥Ìå×ÜÊý²»Äܳ¬¹ý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "All channels Mon count must not exceed ";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str + SPCommZDHJ.ZDHJ_MON_COUNT_MAX);
|
return;
|
}
|
|
zdhj_param_data[1] = ch1_cnt;
|
zdhj_param_data[2] = ch2_cnt;
|
zdhj_param_data[3] = ch3_cnt;
|
zdhj_param_data[4] = ch4_cnt;
|
zdhj_param_data[5] = ch5_cnt;
|
|
zdhj_param_data[6] = (short) Integer.parseInt(tf_zdhj_curr_range.getText());
|
zdhj_param_data[7] = (short) (Double.parseDouble(tf_zdhj_batt_floatcurr_lev.getText())*10);
|
zdhj_param_data[8] = (short) (Double.parseDouble(tf_zdhj_wenbo_curr_lev.getText())*100);
|
zdhj_param_data[9] = (short) Integer.parseInt(tf_zdhj_autores_interval.getText());
|
zdhj_param_data[10] = (short) cb_zdhj_res_testtype.getSelectedIndex();
|
|
zdhj_param_data[11] = (short) cb_zdhj_res_dis_mode.getSelectedIndex();
|
zdhj_param_data[12] = (short) Integer.parseInt(tf_zdhj_mon_stdcap.getText());
|
zdhj_param_data[13] = (short) (Double.parseDouble(tf_zdhj_res_dis_slope.getText())*10000);
|
zdhj_param_data[14] = (short) (Double.parseDouble(tf_zdhj_res_wenbo_slope.getText())*10000);
|
zdhj_param_data[15] = (short) cb_monnum_setmode.getSelectedIndex();
|
zdhj_param_data[16] = (short) Integer.parseInt(tf_zdhj_devid.getText());
|
|
zdhj_param_data[17] = (short) (Double.parseDouble(tf_respm_d1.getText())*10000);
|
zdhj_param_data[18] = (short) (Double.parseDouble(tf_respm_d2.getText())*10000);
|
zdhj_param_data[19] = (short) (Double.parseDouble(tf_respm_d3.getText())*10000);
|
zdhj_param_data[20] = (short) (Double.parseDouble(tf_respm_d4.getText())*10000);
|
zdhj_param_data[21] = (short) (Double.parseDouble(tf_respm_s1.getText())*10000);
|
zdhj_param_data[22] = (short) (Double.parseDouble(tf_respm_s2.getText())*10000);
|
zdhj_param_data[23] = (short) (Double.parseDouble(tf_respm_s3.getText())*10000);
|
zdhj_param_data[24] = (short) (Double.parseDouble(tf_respm_s4.getText())*10000);
|
//--------------------------------------------------------------------------------//
|
String tmp_str = "È·¶¨ÒªÉèÖà 'ÅäÖòÎÊý' Âð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to write param ?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
//--------------------------------------------------------------------------------//
|
//frmSerialport.setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
SerialComm_ZDHJ.setCommCmd(SPCommZDHJ.CMD_TYPE_WRITE_MULTY, SPCommZDHJ.ZDHJ_PARAM_RegAddr_Start,
|
zdhj_param_data, zdhj_param_data.length);
|
Thread.sleep(1000);
|
SerialComm_ZDHJ.setCommCmd(SPCommZDHJ.CMD_TYPE_READ, SPCommZDHJ.ZDHJ_PARAM_RegAddr_Start, null, 0);
|
//frmSerialport.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
//--------------------------------------------------------------------------------//
|
} catch (Exception e1) {
|
// e1.printStackTrace();
|
String tmp_str = "ÇëÊäÈëºÏ·¨µÄ 'Ä£¿é²ÎÊý' Öµ!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Please input the rightful param values!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
}
|
}
|
});
|
btn_zdhj_param_write.setFont(new Font("ËÎÌå", Font.PLAIN, 14));
|
|
zdhj_title = "Ä£¿éÖØÆô";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Module Restart";
|
}
|
btn_restart_dev = new JButton(zdhj_title);
|
btn_restart_dev.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "È·¶¨ÒªÖØÆôÄ£¿éÂð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to restart this module?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = 10000;
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_ResStart_System_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_restart_dev.setEnabled(false);
|
panel_65.add(btn_restart_dev);
|
btn_restart_dev.setFont(new Font("ËÎÌå", Font.PLAIN, 14));
|
|
JPanel panel_52 = new JPanel();
|
zdhj_title = "ʵ²âµçѹ(V) / У׼µçѹ(V)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Measure Vol(V) / Standerd Vol(V)";
|
}
|
panel_52.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_48.add(panel_52);
|
panel_52.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
|
|
tf_zdhj_volcal_source = new JTextField();
|
tf_zdhj_volcal_source.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_volcal_source.setText("0.0");
|
tf_zdhj_volcal_source.setEditable(false);
|
panel_52.add(tf_zdhj_volcal_source);
|
tf_zdhj_volcal_source.setColumns(10);
|
|
tf_zdhj_volcal_slope = new JTextField();
|
tf_zdhj_volcal_slope.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_volcal_slope.setDocument(new LimitedDocument(5, "0123456789."));
|
panel_52.add(tf_zdhj_volcal_slope);
|
tf_zdhj_volcal_slope.setColumns(10);
|
|
zdhj_title = "Æ«ÒÆÐ£×¼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "OffSet Cal";
|
}
|
btn_zdhj_volcal_offset = new JButton(zdhj_title);
|
btn_zdhj_volcal_offset.setEnabled(false);
|
btn_zdhj_volcal_offset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = (short)((Double.parseDouble(tf_zdhj_volcal_source.getText()))*10);
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_AdjVolOffset_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_volcal_offset.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
panel_52.add(btn_zdhj_volcal_offset);
|
|
zdhj_title = "бÂÊУ׼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Slope Cal";
|
}
|
btn_zdhj_volcal_slope = new JButton(zdhj_title);
|
btn_zdhj_volcal_slope.setEnabled(false);
|
btn_zdhj_volcal_slope.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "У׼µçѹǰÇëÏÈÖØÖÃУ׼²ÎÊý, È·¶¨ÒªÐ£×¼µçѹÂð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to calibration group vol?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null,
|
tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
|
if(tf_zdhj_volcal_slope.getText().trim().length() < 1) {
|
tmp_str = "ÇëÊäÈëÐèҪУ׼µÄµçѹ!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Please input standerd group vol first!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
short[] res_type_tag = new short[1];
|
double vol_dev = Double.parseDouble(tf_zdhj_volcal_source.getText());
|
if(vol_dev < 1) {
|
tmp_str = "ʵ²âµçѹ̫С,ÇÒ²»ÄÜΪÁã!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "The standerd group vol too low!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
double vol_set = Double.parseDouble(tf_zdhj_volcal_slope.getText());
|
res_type_tag[0] = (short)((vol_set/vol_dev)*10000);
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_AdjVolSlope_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_volcal_slope.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
panel_52.add(btn_zdhj_volcal_slope);
|
|
zdhj_title = "ÖØÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Reset Cal";
|
}
|
btn_zdhj_volcal_reset = new JButton(zdhj_title);
|
btn_zdhj_volcal_reset.setEnabled(false);
|
btn_zdhj_volcal_reset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "È·¶¨ÒªÖØÖõçѹУ׼²ÎÊýÂð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to reset group vol calibration?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = 10000;
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_AdjVolSlope_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_volcal_reset.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
panel_52.add(btn_zdhj_volcal_reset);
|
|
JPanel panel_53 = new JPanel();
|
zdhj_title = "ʵ²âµçÁ÷(A) / У׼µçÁ÷(A)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Measure Curr(A) / Standerd Curr(A)";
|
}
|
panel_53.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_48.add(panel_53);
|
panel_53.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
|
|
tf_zdhj_currcal_source = new JTextField();
|
tf_zdhj_currcal_source.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_currcal_source.setText("0.0");
|
tf_zdhj_currcal_source.setEditable(false);
|
panel_53.add(tf_zdhj_currcal_source);
|
tf_zdhj_currcal_source.setColumns(10);
|
|
tf_zdhj_currcal_slope = new JTextField();
|
tf_zdhj_currcal_slope.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_currcal_slope.setDocument(new LimitedDocument(5, "0123456789."));
|
panel_53.add(tf_zdhj_currcal_slope);
|
tf_zdhj_currcal_slope.setColumns(10);
|
|
zdhj_title = "ÇåÁã";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Clear";
|
}
|
btn_zdhj_currcal_offset = new JButton("\u7535\u6D41\u6E05\u96F6");
|
btn_zdhj_currcal_offset.setEnabled(false);
|
btn_zdhj_currcal_offset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "ÇëÈ·±£Ä£¿éÒѾÁ¬½ÓµçÁ÷ǯ, "
|
+ "²¢ÇÒµçÁ÷ǯ²»¿¨ÈκιýµçÁ÷µÄÏßÀÂ, "
|
+ "È·¶¨ÒªÇåÁãµçÁ÷Âð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to clear offset curr?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = 0x0000;
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_SetCurrZero_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_currcal_offset.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
panel_53.add(btn_zdhj_currcal_offset);
|
|
zdhj_title = "У׼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Calibrate";
|
}
|
btn_zdhj_currcal_slope = new JButton("\u7535\u6D41\u6821\u51C6");
|
btn_zdhj_currcal_slope.setEnabled(false);
|
btn_zdhj_currcal_slope.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "У׼µçÁ÷ǰÇëÏÈÖØÖÃУ׼²ÎÊý, È·¶¨ÒªÐ£×¼µçÁ÷Âð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to calibration curr?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
|
if(tf_zdhj_currcal_slope.getText().trim().length() < 1) {
|
tmp_str = "ÇëÊäÈëÐèҪУ׼µÄµçÁ÷!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Please input standerd curr!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
short[] res_type_tag = new short[1];
|
double curr_dev = Double.parseDouble(tf_zdhj_currcal_source.getText());
|
if(curr_dev < 1) {
|
tmp_str = "ʵ²âµçÁ÷̫С,ÇÒ²»ÄÜΪÁã!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "The standerd curr too low!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
double curr_set = Double.parseDouble(tf_zdhj_currcal_slope.getText());
|
res_type_tag[0] = (short)((curr_set/curr_dev)*10000);
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_AdjCurrSlope_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_currcal_slope.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
panel_53.add(btn_zdhj_currcal_slope);
|
|
zdhj_title = "ÖØÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Reset Cal";
|
}
|
btn_zdhj_currcal_reset = new JButton(zdhj_title);
|
btn_zdhj_currcal_reset.setEnabled(false);
|
btn_zdhj_currcal_reset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "È·¶¨ÒªÖØÖõçÁ÷У׼²ÎÊýÂð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to reset curr calibration?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = 10000;
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_AdjCurrSlope_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_currcal_reset.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
panel_53.add(btn_zdhj_currcal_reset);
|
|
JPanel panel_82 = new JPanel();
|
panel_82.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u73AF\u5883\u6E29\u5EA6(\u2103) / \u6821\u51C6\u6E29\u5EA6(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_48.add(panel_82);
|
panel_82.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
|
|
tf_zdhj_temp = new JTextField();
|
tf_zdhj_temp.setText("0.0");
|
tf_zdhj_temp.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_temp.setEditable(false);
|
panel_82.add(tf_zdhj_temp);
|
tf_zdhj_temp.setColumns(10);
|
|
tf_zdhj_tmp_cal = new JTextField();
|
tf_zdhj_tmp_cal.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_82.add(tf_zdhj_tmp_cal);
|
tf_zdhj_tmp_cal.setColumns(10);
|
tf_zdhj_currcal_slope.setDocument(new LimitedDocument(4, "0123456789."));
|
|
btn_zdhj_temp_cal = new JButton("\u6E29\u5EA6\u6821\u51C6");
|
btn_zdhj_temp_cal.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
btn_zdhj_temp_cal.setEnabled(false);
|
btn_zdhj_temp_cal.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "";
|
double temp_dev = Double.parseDouble(tf_zdhj_temp.getText());
|
if(temp_dev < 2.0) {
|
tmp_str = "ʵ²âζÈÌ«µÍ,²»ÄÜУ׼!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "The real temp too low!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
if(temp_dev > 60.0) {
|
tmp_str = "ʵ²âζÈÌ«¸ß,²»ÄÜУ׼!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "The real temp too high!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
|
double temp_std = 0;
|
try {
|
temp_std = Double.parseDouble(tf_zdhj_tmp_cal.getText());
|
} catch (Exception e1) {
|
tmp_str = "ÊäÈëζÈÊý¾Ý¸ñʽ´íÎó,ÇëÊäÈëÓÐЧµÄÕûÊý»ò¸¡µãÊý!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "input temp value format error!";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
}
|
if((temp_std < 2.0) || (temp_std > 60.0)) {
|
tmp_str = "±ê׼ζȵÍÓÚ2.0¡æ»ò¸ßÓÚ60.0¡æ,²»ÄÜУ׼!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "The cal temp is too low or too high!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
|
tmp_str = "È·¶¨ÒªÐ£×¼Î¶ÈÂð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to reset the temp calibration?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
|
short[] res_type_tag = new short[1];
|
int slop = (int)((temp_std/temp_dev)*10000);
|
if(slop > 15000) {
|
slop = 15000;
|
}
|
if(slop < 5000) {
|
slop = 5000;
|
}
|
res_type_tag[0] = (short)slop;
|
SerialComm_ZDHJ.setCommCmd(SPCommZDHJ.CMD_TYPE_WRITE_STD, SPCommZDHJ.ZDHJ_AdjTempSlope_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
panel_82.add(btn_zdhj_temp_cal);
|
|
btn_zdhj_temp_cal_reset = new JButton("\u6E29\u5EA6\u91CD\u7F6E");
|
btn_zdhj_temp_cal_reset.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
btn_zdhj_temp_cal_reset.setEnabled(false);
|
btn_zdhj_temp_cal_reset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null == SerialComm_ZDHJ) {
|
return;
|
}
|
|
String tmp_str = "È·¶¨ÒªÖØÖÃζÈУ׼²ÎÊýÂð?";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Are you sure to reset the temp calibration?";
|
}
|
if(JOptionPane.NO_OPTION
|
== JOptionPane.showConfirmDialog(null, tmp_str,
|
"Information",
|
JOptionPane.YES_NO_OPTION)) {
|
return;
|
}
|
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = 10000;
|
SerialComm_ZDHJ.setCommCmd(SPCommZDHJ.CMD_TYPE_WRITE_STD, SPCommZDHJ.ZDHJ_AdjTempSlope_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
panel_82.add(btn_zdhj_temp_cal_reset);
|
/**************************************************************************/
|
|
setButttonState(false);
|
}
|
|
public void setSerialComm_ZDHJ(SPCommZDHJ sz) {
|
SerialComm_ZDHJ = sz;
|
}
|
|
public void setButttonState(boolean state) {
|
btn_zdhj_param_read.setEnabled(state);
|
btn_zdhj_param_write.setEnabled(state);
|
btn_restart_dev.setEnabled(state);
|
|
btn_zdhj_currcal_offset.setEnabled(state);
|
btn_zdhj_volcal_slope.setEnabled(state);
|
btn_zdhj_volcal_reset.setEnabled(state);
|
btn_zdhj_currcal_slope.setEnabled(state);
|
btn_zdhj_currcal_reset.setEnabled(state);
|
btn_zdhj_temp_cal.setEnabled(state);
|
btn_zdhj_temp_cal_reset.setEnabled(state);
|
}
|
|
public void updateData() {
|
if(null != SerialComm_ZDHJ) {
|
tf_zdhj_volcal_source.setText(String.format("%1.1f", SerialComm_ZDHJ.GroupVol));
|
tf_zdhj_temp.setText(String.format("%1.1f", SerialComm_ZDHJ.ExTemp));
|
//System.out.println("SerialComm_ZDHJ.dev_stat_state:" + SerialComm_ZDHJ.dev_stat_state);
|
tf_zdhj_currcal_source.setText(String.format("%1.1f", SerialComm_ZDHJ.BattCurr));
|
|
if(SPCommZDHJ.DEV_PARAM_DATA_STATE_UPDATE == SerialComm_ZDHJ.dev_param_data_state) {
|
SerialComm_ZDHJ.dev_param_data_state = SPCommZDHJ.DEV_PARAM_DATA_STATE_NULL;
|
|
tf_zdhj_devaddr.setText(String.format("%d", SerialComm_ZDHJ.dev_param_addr));
|
tf_zdhj_curr_range.setText(String.format("%d", SerialComm_ZDHJ.dev_param_curr_range));
|
tf_zdhj_autores_interval.setText(String.format("%d", SerialComm_ZDHJ.dev_param_auto_restest_interval));
|
tf_zdhj_wenbo_curr_lev.setText(String.format("%1.2f", SerialComm_ZDHJ.dev_param_wenbo_curr_lev));
|
cb_zdhj_res_testtype.setSelectedIndex(SerialComm_ZDHJ.dev_param_res_test_type);
|
cb_zdhj_res_dis_mode.setSelectedIndex(SerialComm_ZDHJ.dev_param_ResDisTestMethod);
|
tf_zdhj_res_dis_slope.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_res_dis_slope));
|
tf_zdhj_res_wenbo_slope.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_res_wenbo_slope));
|
|
tf_zdhj_ch1_cnt.setText(String.format("%d", SerialComm_ZDHJ.dev_param_ch_mon_cnt[0]));
|
tf_zdhj_ch2_cnt.setText(String.format("%d", SerialComm_ZDHJ.dev_param_ch_mon_cnt[1]));
|
tf_zdhj_ch3_cnt.setText(String.format("%d", SerialComm_ZDHJ.dev_param_ch_mon_cnt[2]));
|
tf_zdhj_ch4_cnt.setText(String.format("%d", SerialComm_ZDHJ.dev_param_ch_mon_cnt[3]));
|
tf_zdhj_ch5_cnt.setText(String.format("%d", SerialComm_ZDHJ.dev_param_ch_mon_cnt[4]));
|
tf_zdhj_mon_stdcap.setText(String.format("%d", SerialComm_ZDHJ.dev_param_Batt_StdCap));
|
tf_zdhj_batt_floatcurr_lev.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_param_FloatCurrLev));
|
cb_monnum_setmode.setSelectedIndex(SerialComm_ZDHJ.dev_param_monnum_setmode);
|
tf_zdhj_devid.setText(String.format("%d", SerialComm_ZDHJ.dev_param_devid));
|
|
tf_respm_d1.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_d[0]));
|
tf_respm_d2.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_d[1]));
|
tf_respm_d3.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_d[2]));
|
tf_respm_d4.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_d[3]));
|
|
tf_respm_s1.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[0]));
|
tf_respm_s2.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[1]));
|
tf_respm_s3.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[2]));
|
tf_respm_s4.setText(String.format("%1.4f", SerialComm_ZDHJ.dev_param_resparam_s[3]));
|
}
|
|
String inf_t = "";
|
if(Math.abs(new Date().getTime() - SerialComm_ZDHJ.dt_cmd_ack_time.getTime()) < (1000*5)) {
|
inf_t = SPCommZDHJ.ZDHJ_OP_REST_INF_TEXT[SerialComm_ZDHJ.dt_cmd_ack]
|
+ " @ " + Com.get_DTF(SerialComm_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_param_set_inf.setText(inf_t);
|
}
|
}
|
}
|