package main;
|
import java.awt.EventQueue;
|
|
import javax.swing.JFrame;
|
|
import java.awt.Cursor;
|
import java.awt.Dimension;
|
import java.awt.Panel;
|
import java.awt.BorderLayout;
|
|
import javax.swing.JComboBox;
|
|
import java.awt.GridLayout;
|
|
import javax.swing.JPanel;
|
import javax.swing.border.TitledBorder;
|
import javax.swing.filechooser.FileFilter;
|
import javax.swing.JButton;
|
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.JFileChooser;
|
import javax.swing.JMenuItem;
|
import javax.swing.JOptionPane;
|
import javax.swing.JPopupMenu;
|
import javax.swing.Timer;
|
|
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.awt.Toolkit;
|
|
import javax.swing.JTextField;
|
import javax.swing.UIManager;
|
|
import java.awt.Color;
|
import java.io.File;
|
import java.nio.ByteBuffer;
|
import java.util.Date;
|
import java.util.Vector;
|
|
import javax.swing.JTabbedPane;
|
import javax.swing.JTextArea;
|
import javax.swing.JScrollPane;
|
|
import java.awt.Font;
|
import java.awt.event.FocusAdapter;
|
import java.awt.event.FocusEvent;
|
|
import sp_comm.SPCommZDHJ;
|
import sp_comm.SPCommZDHJ_9800;
|
|
import com.Com;
|
import com.LimitedDocument;
|
import com.teechart.TBarChart;
|
|
import javax.swing.JTable;
|
import javax.swing.table.DefaultTableModel;
|
import javax.swing.BoxLayout;
|
|
public class main_window {
|
public static final int CommDevType_MON = 0;
|
public static final int CommDevType_ZDHJ = 1;
|
public static final float BattResLowLimit = (float) 0.95;
|
public static final float BattResHighLimit = (float) 1.05;
|
|
public static int LANG_TYPE_CN = 0;
|
public static int LANG_TYPE_EN = 1;
|
|
public String mTitle = "ALI_9800HJ_V1.323";
|
|
public static int LANG_TYPE = LANG_TYPE_CN;
|
public static int APP_ZDHJ_ONLY = 0;
|
|
public int CommDevType = CommDevType_MON;
|
public int main_TabbedPane_SelIndex = 0;
|
|
public boolean MonVol_Is_Adj = false;
|
public boolean MonRes_Is_Test = false;
|
public boolean MonBianHao_Is_Test = false;
|
public String mLastTestID = "";
|
|
private JFrame frmSerialport;
|
private JButton btn_connet;
|
private JButton btn_break;
|
private JComboBox<String> cb_commport;
|
private SPCommZDHJ_9800 SerialComm_ZDHJ;
|
private JTextField tf_target_addr;
|
private JTextField tf_txcnt;
|
private JTextField tf_rxcnt;
|
|
private Timer mMainFormTimer = null;
|
static private ByteBuffer DataBuffer = ByteBuffer.allocate(256);
|
|
private JTabbedPane main_TabbedPane;
|
private JPanel panel_38;
|
private JPanel panel_39;
|
private JPanel panel_40;
|
private JPanel panel_41;
|
private JTextField tf_zdhj_zdvol;
|
private JTextField tf_zdhj_curr;
|
private JTextField tf_wenbo_curr_avg;
|
private JPanel panel_43;
|
private JPanel panel_44;
|
private JComboBox<String> cb_bitrate;
|
|
private JPanel panel_mon_base_inf;
|
|
private JTabbedPane tab_panel_zdhj;
|
private JPanel panel_ZDHJ;
|
private JPanel panel_ZDHJ_Param;
|
private JPanel panel_ZDHJ_AutoSaveData;
|
|
private JPanel panel_47;
|
private JTextField tf_zdhj_version;
|
private JTextField tf_wenbo_curr_peak;
|
private JPanel panel_48;
|
private JTextField tf_zdhj_moncount;
|
private JPanel panel_49;
|
private JPanel panel_51;
|
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_mon_stdvol;
|
private JPanel panel_52;
|
private JPanel panel_54;
|
private JScrollPane scrollPane_2;
|
|
private JTable table_zdhj_data;
|
private Vector<String> columnVector;
|
private Vector<Vector<String>> dataRow;
|
public TBarChart m_TBarMonVolChart;
|
public TBarChart m_TBarMonTmpChart;
|
public TBarChart m_TBarMonResChart;
|
|
public TBarChart m_TBarGroupVolChart;
|
public TBarChart m_TBarGroupCurrChart;
|
|
public TBarChart m_TBarMonRealCapChart;
|
public TBarChart m_TBarMonRestCapChart;
|
|
public TBarChart m_TBarMonCommErrCntChart;
|
|
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 JButton btn_zdhj_restest_start;
|
private JButton btn_zdhj_restest_stop;
|
private JPanel panel_monvol_chart;
|
private JPanel panel_monres_chart;
|
private JPanel panel_montmp_chart;
|
private JTextField tf_zdhj_autores_interval;
|
private JTextField tf_zdhj_wenbo_curr_lev;
|
private JPanel panel_42;
|
private JTextField tf_op_rest_inf;
|
private JComboBox<String> cb_zdhj_res_testtype;
|
private JComboBox<String> cb_zdhj_state;
|
private JPanel panel_45;
|
private JTextField tf_param_set_inf;
|
private JPanel panel_46;
|
private JPanel panel_50;
|
private JPanel panel_56;
|
private JPanel panel_57;
|
private JPanel panel_58;
|
private JPanel panel_59;
|
private JButton btn_zdhj_new_savefile;
|
private JButton btn_zdhj_start_record;
|
private JButton btn_zdhj_stop_record;
|
private JTextField tf_zdhj_save_filename;
|
private JFileChooser fc_zdhj_save_data;
|
private String filename_zdhj_save_data = "";
|
private JPanel panel_60;
|
private JPanel panel_61;
|
private JTextField tf_zdhj_record_state;
|
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_monitor_en;
|
private JTextField tf_zdhj_res_test_count;
|
private JTextArea textArea_zdhj;
|
private JComboBox<String> cb_zdhj_batt_state;
|
private JComboBox<String> cb_zdhj_current_res_test_mode;
|
private JTextField tf_zdhj_batt_floatcurr_lev;
|
private JButton btn_restart_dev;
|
private JPanel panel_65;
|
private JPanel panel_3;
|
private JTextField tf_groupvol_alarm_high;
|
private JTextField tf_groupvol_alarm_low;
|
private JTextField tf_monvol_alarm_high;
|
private JTextField tf_monvol_alarm_low;
|
private JTextField tf_montmp_alarm_high;
|
private JTextField tf_montmp_alarm_low;
|
private JTextField tf_monres_alarm_high;
|
private JTextField tf_monres_alarm_low;
|
private JPanel panel_4;
|
private JTextField tf_zdhj_mon_stdres;
|
private JPanel panel_5;
|
private JPanel panel_6;
|
private JPanel panel_7;
|
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;
|
private JPanel panel_17;
|
private JPanel panel_18;
|
private JPanel panel_19;
|
private JPanel panel_20;
|
private JPanel panel_21;
|
private JPanel panel_22;
|
private JPanel panel_23;
|
private JPanel panel_24;
|
private JPanel panel_25;
|
private JPanel panel_26;
|
private JPanel panel_27;
|
private JPanel panel_28;
|
private JPanel panel_29;
|
private JPanel panel_30;
|
private JPanel panel_31;
|
private JPanel panel_32;
|
private JPanel panel_34;
|
private JPanel panel_33;
|
private JPanel panel_35;
|
private JPanel panel_36;
|
private JPanel panel_37;
|
private JTabbedPane tabbedPane_commtype;
|
private JPanel panel_55;
|
private JPanel panel_62;
|
private JPanel panel_63;
|
private JPanel panel_64;
|
private JTextField tf_ip;
|
private JTextField tf_ipport;
|
private JTextField tf_modbus_addr;
|
private JPanel panel;
|
private JPanel panel_2;
|
private JPanel panel_66;
|
private JPanel panel_67;
|
private JTextField tf_charge_curr_lev;
|
private JTextField tf_discharge_curr_lev;
|
private JTextField tf_monvol_noavg_lev;
|
private JTextField tf_monres_noavg_lev;
|
private JPanel panel_53;
|
private JComboBox<?> cb_restest_speed;
|
private JScrollPane scrollPane;
|
|
/**
|
* Launch the application.
|
*/
|
public static void main(String[] args) {
|
EventQueue.invokeLater(new Runnable() {
|
public void run() {
|
try {
|
main_window window = new main_window();
|
window.frmSerialport.setVisible(true);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
});
|
}
|
|
/**
|
* Create the application.
|
*/
|
public main_window() {
|
initialize();
|
}
|
|
/**
|
* Initialize the contents of the frame.
|
*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
private void initialize() {
|
frmSerialport = new JFrame();
|
frmSerialport.setMinimumSize(new Dimension(1000,532));
|
frmSerialport.setTitle(this.mTitle);
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
frmSerialport.setTitle(this.mTitle + "_EN");
|
}
|
frmSerialport.setIconImage(Toolkit.getDefaultToolkit().getImage(main_window.class.getResource("/main/12164006.png")));
|
frmSerialport.setBounds(100, 100, 1000, 620);
|
frmSerialport.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frmSerialport.setLocationRelativeTo(null);
|
|
tabbedPane_commtype = new JTabbedPane(JTabbedPane.TOP);
|
Panel panel_head = new Panel();
|
frmSerialport.getContentPane().add(panel_head, BorderLayout.NORTH);
|
panel_head.setLayout(new BoxLayout(panel_head, BoxLayout.X_AXIS));
|
panel_head.add(tabbedPane_commtype);
|
|
Panel panel_comm = new Panel();
|
panel_comm.setLayout(new GridLayout(0, 2, 0, 0));
|
JPanel panel_8 = new JPanel();
|
tabbedPane_commtype.add("´®¿ÚͨÐÅ", panel_comm);
|
panel_comm.add(panel_8);
|
String comm_title = "ͨÐŵØÖ· / ²¨ÌØÂÊ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Comm Addr / Bit Rate";
|
}
|
panel_8.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), comm_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
//panel_8.setFont(arg0);
|
//panel_8.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
//panel_comm.add(panel_8);
|
panel_8.setLayout(new GridLayout(0, 2, 0, 0));
|
|
tf_target_addr = new JTextField();
|
tf_target_addr.addFocusListener(new FocusAdapter() {
|
@Override
|
public void focusLost(FocusEvent e) {
|
if(tf_target_addr.getText().trim().length() < 1) {
|
tf_target_addr.setText("255");
|
}
|
}
|
});
|
tf_target_addr.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_target_addr.setText("255");
|
panel_8.add(tf_target_addr);
|
tf_target_addr.setColumns(10);
|
|
cb_bitrate = new JComboBox();
|
cb_bitrate.setModel(new DefaultComboBoxModel(new String[] {"9600", "19200", "38400", "57600", "115200"}));
|
panel_8.add(cb_bitrate);
|
|
JPanel panel_1 = new JPanel();
|
comm_title = "´®¿ÚºÅ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Comm Port";
|
}
|
panel_1.setBorder(new TitledBorder(null, comm_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_comm.add(panel_1);
|
cb_commport = new JComboBox<String>();
|
//cb_commport.setModel(new DefaultComboBoxModel<String>(new String[] {"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "COM10", "COM11", "COM12"}));
|
SPCommZDHJ_9800.searchCommPort(cb_commport);
|
if(cb_commport.getItemCount() > 0) {
|
cb_commport.setSelectedIndex(0);
|
}
|
panel_1.setLayout(new GridLayout(0, 2, 0, 0));
|
|
comm_title = "Ë¢ÐÂ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Reflesh";
|
}
|
JButton btn_renew_commport = new JButton(comm_title);
|
btn_renew_commport.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
btn_renew_commport.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
SPCommZDHJ_9800.searchCommPort(cb_commport);
|
if(cb_commport.getItemCount() > 0) {
|
cb_commport.setSelectedIndex(0);
|
}
|
}
|
});
|
panel_1.add(btn_renew_commport);
|
panel_1.add(cb_commport);
|
|
panel_55 = new JPanel();
|
tabbedPane_commtype.addTab("Íø¿ÚͨÐÅ", null, panel_55, null);
|
panel_55.setLayout(new GridLayout(0, 3, 0, 0));
|
tabbedPane_commtype.setSelectedIndex(1);
|
|
panel_62 = new JPanel();
|
panel_62.setBorder(new TitledBorder(null, "IP\u5730\u5740", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_55.add(panel_62);
|
panel_62.setLayout(new BorderLayout(0, 0));
|
|
tf_ip = new JTextField();
|
tf_ip.setDocument(new LimitedDocument(18, "0123456789."));
|
tf_ip.setText("192.168.3.48");
|
panel_62.add(tf_ip);
|
tf_ip.setColumns(10);
|
|
panel_63 = new JPanel();
|
panel_63.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "IP\u7AEF\u53E3\u53F7", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_55.add(panel_63);
|
panel_63.setLayout(new BorderLayout(0, 0));
|
|
tf_ipport = new JTextField();
|
tf_ipport.setDocument(new LimitedDocument(6, "0123456789"));
|
tf_ipport.setText("9800");
|
panel_63.add(tf_ipport, BorderLayout.CENTER);
|
tf_ipport.setColumns(10);
|
|
panel_64 = new JPanel();
|
panel_64.setBorder(new TitledBorder(null, "MODBUS\u5730\u5740", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_55.add(panel_64);
|
panel_64.setLayout(new BorderLayout(0, 0));
|
|
tf_modbus_addr = new JTextField();
|
tf_modbus_addr.setDocument(new LimitedDocument(3, "0123456789"));
|
tf_modbus_addr.setText("1");
|
panel_64.add(tf_modbus_addr, BorderLayout.CENTER);
|
tf_modbus_addr.setColumns(10);
|
comm_title = "²Ù×÷";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Operation";
|
}
|
|
comm_title = "Á¬½Ó";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Connect";
|
}
|
|
comm_title = "¶Ï¿ª";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Break";
|
}
|
|
JPanel panel_9 = new JPanel();
|
comm_title = "ͨÐżÆÊý(TX / RX)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Comm Count(TX / RX)";
|
}
|
panel_9.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), comm_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_head.add(panel_9);
|
panel_9.setLayout(new GridLayout(0, 2, 0, 0));
|
|
tf_txcnt = new JTextField();
|
panel_9.add(tf_txcnt);
|
tf_txcnt.setColumns(10);
|
|
tf_rxcnt = new JTextField();
|
panel_9.add(tf_rxcnt);
|
tf_rxcnt.setColumns(10);
|
btn_connet = new JButton("\u8FDE\u63A5");
|
panel_9.add(btn_connet);
|
btn_connet.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
btn_connet.setEnabled(true);
|
btn_break = new JButton("\u65AD\u5F00");
|
panel_9.add(btn_break);
|
btn_break.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
btn_break.setEnabled(false);
|
btn_break.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
mMainFormTimer.stop();
|
if(null != SerialComm_ZDHJ) {
|
SerialComm_ZDHJ.CloseCommPort();
|
}
|
tf_target_addr.setEditable(true);
|
btn_renew_commport.setEnabled(true);
|
cb_commport.setEnabled(true);
|
btn_connet.setEnabled(true);
|
btn_break.setEnabled(false);
|
|
btn_zdhj_param_read.setEnabled(false);
|
btn_zdhj_param_write.setEnabled(false);
|
btn_restart_dev.setEnabled(true);
|
|
btn_zdhj_currcal_offset.setEnabled(false);
|
btn_zdhj_volcal_slope.setEnabled(false);
|
btn_zdhj_volcal_reset.setEnabled(false);
|
btn_zdhj_currcal_slope.setEnabled(false);
|
btn_zdhj_currcal_reset.setEnabled(false);
|
|
btn_zdhj_new_savefile.setEnabled(false);
|
btn_zdhj_start_record.setEnabled(false);
|
btn_zdhj_stop_record.setEnabled(false);
|
|
tf_ip.setEnabled(true);
|
tf_ipport.setEnabled(true);
|
tf_modbus_addr.setEnabled(true);
|
|
tabbedPane_commtype.setEnabled(true);
|
}
|
});
|
btn_connet.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
byte comm_type = (byte) (tabbedPane_commtype.getSelectedIndex() + 1);
|
String comm_str = "COM??";
|
boolean comm_open_res = true;
|
{
|
short addr_485 = (short) Integer.parseInt(tf_target_addr.getText().trim());
|
if(SPCommZDHJ_9800.COMM_TYPE_COMM == comm_type) {
|
if(cb_commport.getSelectedIndex() < 0) {
|
Toolkit.getDefaultToolkit().beep();
|
JOptionPane.showMessageDialog(frmSerialport, "ÕÒ²»µ½Èκδ®¿Ú!");
|
return;
|
}
|
comm_str = cb_commport.getSelectedItem().toString();
|
} else {
|
addr_485 = (short) Integer.parseInt(tf_modbus_addr.getText().trim());
|
}
|
String dev_ip = tf_ip.getText();
|
int dev_ipport = Integer.parseInt(tf_ipport.getText());
|
int bitrate = Integer.parseInt(cb_bitrate.getSelectedItem().toString());
|
SerialComm_ZDHJ = new SPCommZDHJ_9800(addr_485, bitrate, dev_ip, dev_ipport, comm_type);
|
boolean open_comm_res = false;
|
//System.out.println("comm_type=" + comm_type);
|
if(SPCommZDHJ_9800.COMM_TYPE_COMM == comm_type) {
|
open_comm_res = SerialComm_ZDHJ.OpenCommPort(comm_str);
|
} else {
|
open_comm_res = true;
|
}
|
if(true == open_comm_res) {
|
CommDevType = CommDevType_ZDHJ;
|
Thread spcommThread = new Thread(SerialComm_ZDHJ);
|
spcommThread.start();
|
} else {
|
comm_open_res = false;
|
}
|
}
|
|
if(true == comm_open_res) {
|
tabbedPane_commtype.setEnabled(false);
|
tf_target_addr.setEditable(false);
|
btn_renew_commport.setEnabled(false);
|
cb_commport.setEnabled(false);
|
btn_connet.setEnabled(false);
|
btn_break.setEnabled(true);
|
|
btn_zdhj_restest_start.setEnabled(true);
|
btn_zdhj_restest_stop.setEnabled(true);
|
btn_zdhj_param_read.setEnabled(true);
|
btn_zdhj_param_write.setEnabled(true);
|
btn_restart_dev.setEnabled(true);
|
|
btn_zdhj_currcal_offset.setEnabled(true);
|
btn_zdhj_volcal_slope.setEnabled(true);
|
btn_zdhj_volcal_reset.setEnabled(true);
|
btn_zdhj_currcal_slope.setEnabled(true);
|
btn_zdhj_currcal_reset.setEnabled(true);
|
|
btn_zdhj_new_savefile.setEnabled(true);
|
btn_zdhj_start_record.setEnabled(true);
|
btn_zdhj_stop_record.setEnabled(true);
|
|
tf_ip.setEnabled(false);
|
tf_ipport.setEnabled(false);
|
tf_modbus_addr.setEnabled(false);
|
|
mMainFormTimer.start();
|
} else {
|
Toolkit.getDefaultToolkit().beep();
|
JOptionPane.showMessageDialog(frmSerialport, comm_str + "²»´æÔÚ»ò±»ÆäËûÓ¦ÓóÌÐòÕ¼ÓÃ!");
|
}
|
}
|
});
|
|
panel_mon_base_inf = new JPanel();
|
panel_mon_base_inf.setLayout(new GridLayout(5, 0, 0, 0));
|
|
tab_panel_zdhj = new JTabbedPane(JTabbedPane.TOP);
|
frmSerialport.getContentPane().add(tab_panel_zdhj, BorderLayout.CENTER);
|
|
/**************************************************************************/
|
/*****************************"±àºÅÉèÖÃ"***********************************/
|
/**************************************************************************/
|
String zdhj_title = "×é¶Ë»ã¼¯Ä£¿é";
|
String zdhj_base_test_title = "»ù±¾²âÊÔ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_base_test_title = "Main Test";
|
}
|
panel_ZDHJ = new JPanel();
|
tab_panel_zdhj.add(zdhj_base_test_title, panel_ZDHJ);
|
panel_ZDHJ.setVisible(false);
|
panel_ZDHJ.setLayout(new BorderLayout(0, 0));
|
|
panel_43 = new JPanel();
|
panel_ZDHJ.add(panel_43);
|
|
panel_44 = new JPanel();
|
zdhj_title = "µ¥Ìåµç³ØÊý¾Ý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "MonVol(V) / MonRes(m¦¸) / MonTmp(¡æ)";
|
}
|
panel_43.setLayout(new BorderLayout(0, 0));
|
panel_44.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_43.add(panel_44);
|
panel_44.setLayout(new GridLayout(0, 1, 0, 0));
|
|
scrollPane_2 = new JScrollPane();
|
panel_44.add(scrollPane_2);
|
|
table_zdhj_data = new JTable();
|
columnVector = new Vector<String>();
|
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 = "µçѹ²»¾ù";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "VolNoAvg";
|
}
|
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 = "ResNoAvg";
|
}
|
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 = "ʵ¼ÊÈÝÁ¿(AH)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "MonRealCap";
|
}
|
columnVector.add(zdhj_title);
|
zdhj_title = "Ê£ÓàÈÝÁ¿(AH)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "MonRestCap";
|
}
|
columnVector.add(zdhj_title);
|
|
dataRow = new Vector<Vector<String>>();
|
table_zdhj_data.setModel(new DefaultTableModel(dataRow, columnVector));
|
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 = frmSerialport.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());
|
}
|
}
|
};
|
|
table_zdhj_data.addMouseListener(m_a);
|
scrollPane_2.setViewportView(table_zdhj_data);
|
|
panel_57 = new JPanel();
|
panel_43.add(panel_57, BorderLayout.EAST);
|
panel_57.setLayout(new BorderLayout(0, 0));
|
|
panel_38 = new JPanel();
|
panel_57.add(panel_38, BorderLayout.NORTH);
|
//panel_ZDHJ.add(panel_38, BorderLayout.NORTH);
|
panel_38.setLayout(new GridLayout(4, 2, 0, 0));
|
|
panel_47 = new JPanel();
|
zdhj_title = "Ä£¿é°æ±¾";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Module Version";
|
}
|
panel_47.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_38.add(panel_47);
|
panel_47.setLayout(new GridLayout(0, 1, 8, 0));
|
|
tf_zdhj_version = new JTextField();
|
tf_zdhj_version.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_47.add(tf_zdhj_version);
|
tf_zdhj_version.setColumns(10);
|
|
panel_46 = new JPanel();
|
panel_38.add(panel_46);
|
zdhj_title = "µ¥Ìå×ÜÊý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Mon Sum";
|
}
|
panel_46.setBorder(new TitledBorder(null, zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_46.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_moncount = new JTextField();
|
tf_zdhj_moncount.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_46.add(tf_zdhj_moncount);
|
tf_zdhj_moncount.setColumns(10);
|
|
panel_39 = new JPanel();
|
zdhj_title = "×é¶Ëµçѹ(V) / µçÁ÷(A)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Group Vol(V) / Curr(A)";
|
}
|
panel_39.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7EC4\u7AEF\u7535\u538B(V)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_38.add(panel_39);
|
panel_39.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_zdvol = new JTextField();
|
tf_zdhj_zdvol.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_39.add(tf_zdhj_zdvol);
|
tf_zdhj_zdvol.setColumns(10);
|
zdhj_title = "Ä£¿é״̬";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Module State";
|
}
|
|
panel_50 = new JPanel();
|
panel_50.setBorder(new TitledBorder(null, zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_38.add(panel_50);
|
panel_50.setLayout(new BorderLayout(0, 0));
|
|
String zdhj_title_str[] = new String[]{"Õý³£²É¼¯", "ÄÚ×è²âÊÔ", "µ¥Ìå±àºÅ"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Normal Work", "Res Test", "Mon Numberd"};
|
}
|
cb_zdhj_state = new JComboBox();
|
panel_50.add(cb_zdhj_state);
|
cb_zdhj_state.setModel(new DefaultComboBoxModel(zdhj_title_str));
|
cb_zdhj_state.setSelectedIndex(0);
|
|
panel_6 = new JPanel();
|
panel_6.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u6D41(A)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_38.add(panel_6);
|
panel_6.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_curr = new JTextField();
|
panel_6.add(tf_zdhj_curr, BorderLayout.CENTER);
|
tf_zdhj_curr.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_zdhj_curr.setColumns(10);
|
|
panel_40 = new JPanel();
|
zdhj_title = "µç³Ø×´Ì¬";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Batt State";
|
}
|
panel_40.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_38.add(panel_40);
|
panel_40.setLayout(new GridLayout(0, 1, 8, 0));
|
|
cb_zdhj_batt_state = new JComboBox();
|
zdhj_title_str = new String[]{"¸¡³ä", "·Åµç", "³äµç"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Float Charge", "Discharge", "Charge"};
|
}
|
cb_zdhj_batt_state.setModel(new DefaultComboBoxModel(zdhj_title_str));
|
cb_zdhj_batt_state.setSelectedIndex(0);
|
panel_40.add(cb_zdhj_batt_state);
|
|
panel_41 = new JPanel();
|
zdhj_title = "ƽ¾ùÒò×Ó";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Ripple Wave AVG Curr(A)";
|
}
|
panel_41.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_38.add(panel_41);
|
panel_41.setLayout(new GridLayout(0, 1, 8, 0));
|
|
tf_wenbo_curr_avg = new JTextField();
|
tf_wenbo_curr_avg.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_41.add(tf_wenbo_curr_avg);
|
tf_wenbo_curr_avg.setColumns(10);
|
|
panel_56 = new JPanel();
|
zdhj_title = "¼«ÏÞÒò×Ó";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Ripple Wave PPM Curr(A)";
|
}
|
panel_56.setBorder(new TitledBorder(null, zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_38.add(panel_56);
|
panel_56.setLayout(new BorderLayout(0, 0));
|
|
tf_wenbo_curr_peak = new JTextField();
|
tf_wenbo_curr_peak.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_56.add(tf_wenbo_curr_peak);
|
tf_wenbo_curr_peak.setColumns(10);
|
|
panel_58 = new JPanel();
|
panel_57.add(panel_58, BorderLayout.SOUTH);
|
panel_58.setLayout(new GridLayout(3, 1, 0, 0));
|
|
panel_45 = new JPanel();
|
panel_58.add(panel_45);
|
zdhj_title = "µ±Ç°ÄÚ×è²âÊÔ·½·¨ / ÄÚ×èÒѲâÊÔ´ÎÊý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Res Test Type / Res Test Count";
|
}
|
panel_45.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_45.setLayout(new GridLayout(0, 2, 4, 0));
|
|
cb_zdhj_current_res_test_mode = new JComboBox();
|
zdhj_title_str = new String[]{"ÄÚ×è²É¼¯AÒì²½", "ÄÚ×è²É¼¯B"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Single Discharge","Ripple Wave Test"};
|
}
|
cb_zdhj_current_res_test_mode.setModel(new DefaultComboBoxModel(new String[] {"\u5185\u963B\u91C7\u96C6A\u5355\u8282", "\u5185\u963B\u91C7\u96C6B", "\u5185\u963B\u91C7\u96C6A\u6279\u91CF"}));
|
cb_zdhj_current_res_test_mode.setSelectedIndex(0);
|
panel_45.add(cb_zdhj_current_res_test_mode);
|
|
tf_zdhj_res_test_count = new JTextField();
|
tf_zdhj_res_test_count.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_45.add(tf_zdhj_res_test_count);
|
tf_zdhj_res_test_count.setColumns(10);
|
|
panel_5 = new JPanel();
|
panel_5.setBorder(new TitledBorder(null, "\u5185\u963B\u6D4B\u8BD5\u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_58.add(panel_5);
|
panel_5.setLayout(new GridLayout(0, 2, 4, 0));
|
btn_zdhj_restest_start = new JButton("\u542F\u52A8");
|
panel_5.add(btn_zdhj_restest_start);
|
btn_zdhj_restest_start.setEnabled(false);
|
btn_zdhj_restest_start.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = 0x0000;
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_ResTest_Start_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_restest_start.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
|
btn_zdhj_restest_stop = new JButton("\u505C\u6B62");
|
panel_5.add(btn_zdhj_restest_stop);
|
btn_zdhj_restest_stop.setEnabled(false);
|
btn_zdhj_restest_stop.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
short[] res_type_tag = new short[1];
|
res_type_tag[0] = (short) 0x0000;
|
SerialComm_ZDHJ.setCommCmd(SerialComm_ZDHJ.m_CMD_TYPE_WRITE, SPCommZDHJ.ZDHJ_ResTest_Stop_RegAddr,
|
res_type_tag, res_type_tag.length);
|
}
|
});
|
btn_zdhj_restest_stop.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
|
tf_op_rest_inf = new JTextField();
|
tf_op_rest_inf.setColumns(10);
|
panel_42 = new JPanel();
|
panel_58.add(panel_42);
|
zdhj_title = "²Ù×÷½á¹ûÐÅÏ¢";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Operation Result Inf";
|
}
|
panel_42.setBorder(new TitledBorder(null, zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_42.setLayout(new BorderLayout(0, 0));
|
panel_42.add(tf_op_rest_inf, BorderLayout.CENTER);
|
|
/**************************************************************************/
|
//JSplitPane panel_ZDHJ_Chart = new JSplitPane();
|
JPanel panel_ZDHJ_Chart = new JPanel();
|
zdhj_title = "ͼÐÍÊý¾Ý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Chart & Data";
|
}
|
tab_panel_zdhj.add(zdhj_title, panel_ZDHJ_Chart);
|
|
panel_monvol_chart = new JPanel();
|
zdhj_title = "µ¥Ìåµçѹ(V)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "MonVol(V)";
|
}
|
panel_ZDHJ_Chart.setLayout(new GridLayout(0, 2, 0, 0));
|
panel_monvol_chart.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_monvol_chart.setLayout(new BorderLayout(0, 0));
|
m_TBarMonVolChart = new TBarChart(TBarChart.Bar_Type_MonVol);
|
panel_monvol_chart.add(m_TBarMonVolChart, BorderLayout.CENTER);
|
panel_ZDHJ_Chart.add(panel_monvol_chart);
|
|
panel_33 = new JPanel();
|
panel_ZDHJ_Chart.add(panel_33);
|
panel_33.setLayout(new GridLayout(0, 2, 0, 0));
|
|
panel_35 = new JPanel();
|
panel_35.setBorder(new TitledBorder(null, "\u7EC4\u7AEF\u7535\u538B(V)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_33.add(panel_35);
|
panel_35.setLayout(new BorderLayout(0, 0));
|
m_TBarGroupVolChart = new TBarChart(TBarChart.Bar_Type_MonVol);
|
panel_35.add(m_TBarGroupVolChart, BorderLayout.CENTER);
|
|
panel_36 = new JPanel();
|
panel_36.setBorder(new TitledBorder(null, "\u7EC4\u7AEF\u7535\u6D41(A)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_33.add(panel_36);
|
panel_36.setLayout(new BorderLayout(0, 0));
|
m_TBarGroupCurrChart = new TBarChart(TBarChart.Bar_Type_BattCurr);
|
panel_36.add(m_TBarGroupCurrChart, BorderLayout.CENTER);
|
|
zdhj_title = "µ¥ÌåζÈ(¡æ)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "MonTmp(¡æ)";
|
}
|
panel_montmp_chart = new JPanel();
|
panel_ZDHJ_Chart.add(panel_montmp_chart);
|
panel_montmp_chart.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_montmp_chart.setLayout(new BorderLayout(0, 0));
|
m_TBarMonTmpChart = new TBarChart(TBarChart.Bar_Type_MonTmp);
|
panel_montmp_chart.add(m_TBarMonTmpChart, BorderLayout.CENTER);
|
|
panel_32 = new JPanel();
|
panel_32.setBorder(new TitledBorder(null, "\u5355\u4F53\u5B9E\u9645\u5BB9\u91CF(AH)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_ZDHJ_Chart.add(panel_32);
|
panel_32.setLayout(new BorderLayout(0, 0));
|
m_TBarMonRealCapChart = new TBarChart(TBarChart.Bar_Type_MonRealCap);
|
panel_32.add(m_TBarMonRealCapChart, BorderLayout.CENTER);
|
|
zdhj_title = "µ¥ÌåÄÚ×è(m¦¸)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "MonRes(m¦¸)";
|
}
|
panel_monres_chart = new JPanel();
|
panel_monres_chart.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_monres_chart.setLayout(new BorderLayout(0, 0));
|
m_TBarMonResChart = new TBarChart(TBarChart.Bar_Type_MonRes);
|
panel_monres_chart.add(m_TBarMonResChart, BorderLayout.CENTER);
|
panel_ZDHJ_Chart.add(panel_monres_chart);
|
|
panel_34 = new JPanel();
|
panel_34.setBorder(new TitledBorder(null, "\u5355\u4F53\u5269\u4F59\u5BB9\u91CF(AH)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_ZDHJ_Chart.add(panel_34);
|
panel_34.setLayout(new BorderLayout(0, 0));
|
m_TBarMonRestCapChart = new TBarChart(TBarChart.Bar_Type_MonRestCap);
|
panel_34.add(m_TBarMonRestCapChart, BorderLayout.CENTER);
|
/**************************************************************************/
|
panel_ZDHJ_Param = new JPanel();
|
zdhj_title = "²ÎÊýÉèÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Param Setup";
|
}
|
tab_panel_zdhj.add(zdhj_title, panel_ZDHJ_Param);
|
panel_48 = new JPanel();
|
zdhj_title = "Ä£¿é²ÎÊý";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Module Param Setup";
|
}
|
panel_ZDHJ_Param.setLayout(new BorderLayout(0, 0));
|
panel_48.setBorder(new TitledBorder(null, zdhj_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_ZDHJ_Param.add(panel_48, BorderLayout.NORTH);
|
panel_48.setLayout(new GridLayout(7, 1, 0, 4));
|
|
panel_49 = new JPanel();
|
zdhj_title = "Ä£¿éµØÖ· / ËÄ·µ¥ÌåͨµÀ¸÷×Ôµ¥ÌåÊý(1/2/3/4)";
|
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, 5, 4, 0));
|
|
panel_7 = new JPanel();
|
panel_7.setBorder(new TitledBorder(null, "\u6A21\u5757\u5730\u5740", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_7);
|
panel_7.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_devaddr = new JTextField();
|
panel_7.add(tf_zdhj_devaddr, BorderLayout.CENTER);
|
tf_zdhj_devaddr.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_devaddr.setDocument(new LimitedDocument(2, "0123456789"));
|
tf_zdhj_devaddr.setColumns(10);
|
|
panel_10 = new JPanel();
|
panel_10.setBorder(new TitledBorder(null, "\u901A\u9053\u4E00\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_10);
|
panel_10.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch1_cnt = new JTextField();
|
panel_10.add(tf_zdhj_ch1_cnt);
|
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_11 = new JPanel();
|
panel_11.setBorder(new TitledBorder(null, "\u901A\u9053\u4E8C\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_11);
|
panel_11.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch2_cnt = new JTextField();
|
panel_11.add(tf_zdhj_ch2_cnt);
|
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_12 = new JPanel();
|
panel_12.setBorder(new TitledBorder(null, "\u901A\u9053\u4E09\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_12);
|
panel_12.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch3_cnt = new JTextField();
|
panel_12.add(tf_zdhj_ch3_cnt);
|
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_13 = new JPanel();
|
panel_13.setBorder(new TitledBorder(null, "\u901A\u9053\u56DB\u5355\u4F53\u6570", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_49.add(panel_13);
|
panel_13.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_ch4_cnt = new JTextField();
|
panel_13.add(tf_zdhj_ch4_cnt);
|
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);
|
zdhj_title_str = new String[]{"Òì²½²âÊÔ", "ͬ²½²âÊÔ"};
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title_str = new String[]{"Single Discharge", "BroadCast Discharge"};
|
}
|
|
panel_51 = new JPanel();
|
zdhj_title = "µçÁ÷Á¿³Ì(A) / ±ê³ÆÈÝÁ¿(AH) / ±ê³Æµçѹ(V) / ±ê³ÆÄÚ×è(u¦¸) / ¸¡³äµçÁ÷·§Öµ(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, 5, 4, 0));
|
|
panel_14 = new JPanel();
|
panel_14.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u6D41\u91CF\u7A0B(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_curr_range = new JTextField();
|
panel_14.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_15 = new JPanel();
|
panel_15.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_15);
|
panel_15.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_mon_stdcap = new JTextField();
|
panel_15.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_16 = new JPanel();
|
panel_16.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6807\u79F0\u7535\u538B(V)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_16);
|
panel_16.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_mon_stdvol = new JTextField();
|
panel_16.add(tf_zdhj_mon_stdvol, BorderLayout.CENTER);
|
tf_zdhj_mon_stdvol.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_mon_stdvol.setDocument(new LimitedDocument(5, "0123456789"));
|
tf_zdhj_mon_stdvol.setColumns(10);
|
|
panel_17 = new JPanel();
|
panel_17.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6807\u79F0\u5185\u963B(m\u03A9)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_17);
|
panel_17.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_mon_stdres = new JTextField();
|
tf_zdhj_mon_stdres.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_17.add(tf_zdhj_mon_stdres, BorderLayout.CENTER);
|
tf_zdhj_mon_stdres.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_zdhj_mon_stdres.setColumns(10);
|
|
panel_18 = new JPanel();
|
panel_18.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6D6E\u5145\u7535\u6D41\u9600\u503C(A)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_51.add(panel_18);
|
panel_18.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_batt_floatcurr_lev = new JTextField();
|
panel_18.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_54 = new JPanel();
|
zdhj_title = "²ÎÊýÉèÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Param Set";
|
}
|
|
panel_3 = new JPanel();
|
panel_48.add(panel_3);
|
panel_3.setLayout(new GridLayout(0, 4, 4, 0));
|
|
panel_19 = new JPanel();
|
panel_19.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7EC4\u7AEF\u7535\u538B\u544A\u8B66 (\u9AD8 / \u4F4E) \u9600\u503C(V)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_3.add(panel_19);
|
panel_19.setLayout(new GridLayout(0, 2, 4, 0));
|
|
tf_groupvol_alarm_high = new JTextField();
|
tf_groupvol_alarm_high.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_19.add(tf_groupvol_alarm_high);
|
tf_groupvol_alarm_high.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_groupvol_alarm_high.setColumns(10);
|
|
tf_groupvol_alarm_low = new JTextField();
|
tf_groupvol_alarm_low.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_19.add(tf_groupvol_alarm_low);
|
tf_groupvol_alarm_low.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_groupvol_alarm_low.setColumns(10);
|
|
panel_20 = new JPanel();
|
panel_20.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5355\u4F53\u7535\u538B\u544A\u8B66 (\u9AD8 / \u4F4E) \u9600\u503C(V)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_3.add(panel_20);
|
panel_20.setLayout(new GridLayout(0, 2, 4, 0));
|
|
tf_monvol_alarm_high = new JTextField();
|
tf_monvol_alarm_high.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_20.add(tf_monvol_alarm_high);
|
tf_monvol_alarm_high.setDocument(new LimitedDocument(6, "0123456789."));
|
tf_monvol_alarm_high.setColumns(10);
|
|
tf_monvol_alarm_low = new JTextField();
|
tf_monvol_alarm_low.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_20.add(tf_monvol_alarm_low);
|
tf_monvol_alarm_low.setDocument(new LimitedDocument(6, "0123456789."));
|
tf_monvol_alarm_low.setColumns(10);
|
|
panel_21 = new JPanel();
|
panel_21.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5355\u4F53\u6E29\u5EA6\u544A\u8B66 (\u9AD8 / \u4F4E) \u9600\u503C(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_3.add(panel_21);
|
panel_21.setLayout(new GridLayout(0, 2, 4, 0));
|
|
tf_montmp_alarm_high = new JTextField();
|
tf_montmp_alarm_high.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_21.add(tf_montmp_alarm_high);
|
tf_montmp_alarm_high.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_montmp_alarm_high.setColumns(10);
|
|
tf_montmp_alarm_low = new JTextField();
|
tf_montmp_alarm_low.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_21.add(tf_montmp_alarm_low);
|
tf_montmp_alarm_low.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_montmp_alarm_low.setColumns(10);
|
|
panel_22 = new JPanel();
|
panel_22.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5355\u4F53\u5185\u963B\u544A\u8B66 (\u9AD8 / \u4F4E) \u9600\u503C(m\u03A9)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_3.add(panel_22);
|
panel_22.setLayout(new GridLayout(0, 2, 4, 0));
|
|
tf_monres_alarm_high = new JTextField();
|
tf_monres_alarm_high.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_22.add(tf_monres_alarm_high);
|
tf_monres_alarm_high.setDocument(new LimitedDocument(6, "0123456789."));
|
tf_monres_alarm_high.setColumns(10);
|
|
tf_monres_alarm_low = new JTextField();
|
tf_monres_alarm_low.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_22.add(tf_monres_alarm_low);
|
tf_monres_alarm_low.setDocument(new LimitedDocument(6, "0123456789."));
|
tf_monres_alarm_low.setColumns(10);
|
|
panel_4 = new JPanel();
|
panel_48.add(panel_4);
|
panel_4.setLayout(new GridLayout(0, 6, 4, 0));
|
|
panel_23 = new JPanel();
|
panel_23.setBorder(new TitledBorder(null, "\u81EA\u52A8\u6D4B\u5185\u963B\u5468\u671F(H)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_4.add(panel_23);
|
panel_23.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_autores_interval = new JTextField();
|
panel_23.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_24 = new JPanel();
|
panel_24.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5185\u963B\u6D4B\u8BD5\u65B9\u6CD5", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_24);
|
panel_24.setLayout(new BorderLayout(0, 0));
|
|
cb_zdhj_res_testtype = new JComboBox();
|
panel_24.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(new String[] {"\u81EA\u52A8", "\u5185\u963B\u91C7\u96C6A", "\u5185\u963B\u91C7\u96C6B"}));
|
cb_zdhj_res_testtype.setSelectedIndex(0);
|
|
panel_25 = new JPanel();
|
panel_25.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5185\u963B\u91C7\u96C6\u9600\u503C(1\u4F4D\u5C0F\u6570)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_25);
|
panel_25.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_wenbo_curr_lev = new JTextField();
|
panel_25.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);
|
|
panel_26 = new JPanel();
|
panel_26.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5185\u963B\u91C7\u96C6A\u7CFB\u6570(4\u4F4D\u5C0F\u6570)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_26);
|
panel_26.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_res_dis_slope = new JTextField();
|
panel_26.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_27 = new JPanel();
|
panel_27.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5185\u963B\u91C7\u96C6B\u7CFB\u6570(4\u4F4D\u5C0F\u6570)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_27);
|
panel_27.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_res_wenbo_slope = new JTextField();
|
panel_27.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);
|
|
panel_28 = new JPanel();
|
panel_28.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u81EA\u52A8\u76D1\u6D4B\u4F7F\u80FD", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_28);
|
panel_28.setLayout(new BorderLayout(0, 0));
|
|
cb_zdhj_monitor_en = new JComboBox();
|
panel_28.add(cb_zdhj_monitor_en, BorderLayout.CENTER);
|
cb_zdhj_monitor_en.setFont(new Font("Dialog", Font.PLAIN, 14));
|
cb_zdhj_monitor_en.setModel(new DefaultComboBoxModel(new String[] {"\u7981\u7528", "\u542F\u7528"}));
|
cb_zdhj_monitor_en.setSelectedIndex(0);
|
|
panel_29 = new JPanel();
|
panel_48.add(panel_29);
|
panel_29.setLayout(new GridLayout(0, 5, 0, 0));
|
|
panel = new JPanel();
|
panel.setBorder(new TitledBorder(null, "\u5145\u7535\u7535\u6D41\u9600\u503C(A)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_29.add(panel);
|
panel.setLayout(new BorderLayout(0, 0));
|
|
tf_charge_curr_lev = new JTextField();
|
tf_charge_curr_lev.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel.add(tf_charge_curr_lev, BorderLayout.CENTER);
|
tf_charge_curr_lev.setColumns(10);
|
|
panel_2 = new JPanel();
|
panel_2.setBorder(new TitledBorder(null, "\u653E\u7535\u7535\u6D41\u9600\u503C(A)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_29.add(panel_2);
|
panel_2.setLayout(new BorderLayout(0, 0));
|
|
tf_discharge_curr_lev = new JTextField();
|
tf_discharge_curr_lev.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_2.add(tf_discharge_curr_lev, BorderLayout.CENTER);
|
tf_discharge_curr_lev.setColumns(10);
|
|
panel_66 = new JPanel();
|
panel_66.setBorder(new TitledBorder(null, "\u7535\u538B\u504F\u79BB\u9600\u503C(V)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_29.add(panel_66);
|
panel_66.setLayout(new BorderLayout(0, 0));
|
|
tf_monvol_noavg_lev = new JTextField();
|
tf_monvol_noavg_lev.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_66.add(tf_monvol_noavg_lev, BorderLayout.CENTER);
|
tf_monvol_noavg_lev.setColumns(10);
|
|
panel_67 = new JPanel();
|
panel_67.setBorder(new TitledBorder(null, "\u5185\u963B\u504F\u79BB\u9600\u503C(m\u03A9)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_29.add(panel_67);
|
panel_67.setLayout(new BorderLayout(0, 0));
|
|
tf_monres_noavg_lev = new JTextField();
|
tf_monres_noavg_lev.setFont(new Font("Dialog", Font.PLAIN, 18));
|
panel_67.add(tf_monres_noavg_lev, BorderLayout.CENTER);
|
tf_monres_noavg_lev.setColumns(10);
|
|
panel_53 = new JPanel();
|
panel_53.setBorder(new TitledBorder(null, "\u5185\u963B\u6D4B\u8BD5\u901F\u5EA6", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_29.add(panel_53);
|
panel_53.setLayout(new BorderLayout(0, 0));
|
|
cb_restest_speed = new JComboBox();
|
cb_restest_speed.setModel(new DefaultComboBoxModel(new String[] {"\u5355\u8282", "\u5E7F\u64AD"}));
|
cb_restest_speed.setSelectedIndex(0);
|
panel_53.add(cb_restest_speed);
|
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();
|
panel_54.add(tf_param_set_inf);
|
tf_param_set_inf.setColumns(10);
|
|
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("\u53C2\u6570\u8BFB\u53D6");
|
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) {
|
SerialComm_ZDHJ.setCommCmd(SPCommZDHJ.CMD_TYPE_READ, SPCommZDHJ.ZDHJ_PARAM_RegAddr_Start, null, 0);
|
}
|
});
|
btn_zdhj_param_read.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
|
zdhj_title = "²ÎÊýÉèÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Param Write";
|
}
|
btn_zdhj_param_write = new JButton("\u53C2\u6570\u8BBE\u7F6E");
|
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) {
|
short[] zdhj_param_data = new short[64];
|
try {
|
int d_index = 0;
|
zdhj_param_data[d_index++] = (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());
|
|
if((ch1_cnt + ch2_cnt + ch3_cnt + ch4_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[d_index++] = ch1_cnt;
|
zdhj_param_data[d_index++] = ch2_cnt;
|
zdhj_param_data[d_index++] = ch3_cnt;
|
zdhj_param_data[d_index++] = ch4_cnt;
|
|
zdhj_param_data[d_index++] = (short) Integer.parseInt(tf_zdhj_curr_range.getText());
|
zdhj_param_data[d_index++] = (short) Integer.parseInt(tf_zdhj_mon_stdcap.getText());
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_zdhj_mon_stdvol.getText())*10);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_zdhj_mon_stdres.getText())*1000);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_zdhj_batt_floatcurr_lev.getText())*10);
|
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_groupvol_alarm_high.getText())*10);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_groupvol_alarm_low.getText())*10);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_monvol_alarm_high.getText())*1000);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_monvol_alarm_low.getText())*1000);
|
zdhj_param_data[d_index++] = (short) ((Double.parseDouble(tf_montmp_alarm_high.getText())+10.0)*10);
|
zdhj_param_data[d_index++] = (short) ((Double.parseDouble(tf_montmp_alarm_low.getText())+10.0)*10);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_monres_alarm_high.getText())*1000);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_monres_alarm_low.getText())*1000);
|
|
zdhj_param_data[d_index++] = (short) Integer.parseInt(tf_zdhj_autores_interval.getText());
|
zdhj_param_data[d_index++] = (short) cb_zdhj_res_testtype.getSelectedIndex();
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_zdhj_wenbo_curr_lev.getText())*100);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_zdhj_res_dis_slope.getText())*10000);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_zdhj_res_wenbo_slope.getText())*10000);
|
zdhj_param_data[d_index++] = (short) cb_zdhj_monitor_en.getSelectedIndex();
|
|
for(int n=0; n<SerialComm_ZDHJ.dev_param_bakeup.length; n++) {
|
if(9 == n) {
|
zdhj_param_data[d_index++] = (short) cb_restest_speed.getSelectedIndex();
|
} else {
|
zdhj_param_data[d_index++] = SerialComm_ZDHJ.dev_param_bakeup[n];
|
}
|
}
|
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_charge_curr_lev.getText())*10);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_discharge_curr_lev.getText())*10);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_monvol_noavg_lev.getText())*1000);
|
zdhj_param_data[d_index++] = (short) (Double.parseDouble(tf_monres_noavg_lev.getText())*1000);
|
//--------------------------------------------------------------------------------//
|
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, d_index);
|
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, 12));
|
|
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) {
|
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));
|
|
panel_52 = new JPanel();
|
zdhj_title = "ʵ²â×é¶Ëµçѹ(V) / У׼×é¶Ëµçѹ(V)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Measure Vol(V) / Standerd Vol(V)";
|
}
|
|
panel_48.add(panel_52);
|
panel_52.setLayout(new GridLayout(0, 2, 16, 0));
|
|
zdhj_title = "Æ«ÒÆÐ£×¼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "OffSet Cal";
|
}
|
|
zdhj_title = "бÂÊУ׼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Slope Cal";
|
}
|
|
zdhj_title = "ÖØÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Reset Cal";
|
}
|
|
panel_30 = new JPanel();
|
panel_30.setBorder(new TitledBorder(null, "\u5B9E\u6D4B\u7EC4\u7AEF\u7535\u538B(V) / \u6821\u51C6\u7EC4\u7AEF\u7535\u538B(V)", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_52.add(panel_30);
|
panel_30.setLayout(new GridLayout(0, 5, 2, 0));
|
|
tf_zdhj_volcal_source = new JTextField();
|
panel_30.add(tf_zdhj_volcal_source);
|
tf_zdhj_volcal_source.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_volcal_source.setText("0.0");
|
tf_zdhj_volcal_source.setEditable(false);
|
tf_zdhj_volcal_source.setColumns(10);
|
|
tf_zdhj_volcal_slope = new JTextField();
|
panel_30.add(tf_zdhj_volcal_slope);
|
tf_zdhj_volcal_slope.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_volcal_slope.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_zdhj_volcal_slope.setColumns(10);
|
btn_zdhj_volcal_offset = new JButton("\u504F\u79FB");
|
panel_30.add(btn_zdhj_volcal_offset);
|
btn_zdhj_volcal_offset.setEnabled(false);
|
btn_zdhj_volcal_offset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
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));
|
btn_zdhj_volcal_slope = new JButton("\u659C\u7387");
|
panel_30.add(btn_zdhj_volcal_slope);
|
btn_zdhj_volcal_slope.setEnabled(false);
|
btn_zdhj_volcal_slope.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
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));
|
btn_zdhj_volcal_reset = new JButton(zdhj_title);
|
panel_30.add(btn_zdhj_volcal_reset);
|
btn_zdhj_volcal_reset.setEnabled(false);
|
btn_zdhj_volcal_reset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
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_31 = new JPanel();
|
panel_31.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u5B9E\u6D4B\u7535\u6D41(A) / \u6821\u51C6\u7535\u6D41(A)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_52.add(panel_31);
|
panel_31.setLayout(new GridLayout(0, 5, 2, 0));
|
|
tf_zdhj_currcal_source = new JTextField();
|
panel_31.add(tf_zdhj_currcal_source);
|
tf_zdhj_currcal_source.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_currcal_source.setText("0.0");
|
tf_zdhj_currcal_source.setEditable(false);
|
tf_zdhj_currcal_source.setColumns(10);
|
|
tf_zdhj_currcal_slope = new JTextField();
|
panel_31.add(tf_zdhj_currcal_slope);
|
tf_zdhj_currcal_slope.setFont(new Font("Dialog", Font.PLAIN, 18));
|
tf_zdhj_currcal_slope.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_zdhj_currcal_slope.setColumns(10);
|
btn_zdhj_currcal_offset = new JButton("\u504F\u79FB");
|
panel_31.add(btn_zdhj_currcal_offset);
|
btn_zdhj_currcal_offset.setEnabled(false);
|
btn_zdhj_currcal_offset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
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));
|
btn_zdhj_currcal_slope = new JButton("\u659C\u7387");
|
panel_31.add(btn_zdhj_currcal_slope);
|
btn_zdhj_currcal_slope.setEnabled(false);
|
btn_zdhj_currcal_slope.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
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));
|
btn_zdhj_currcal_reset = new JButton(zdhj_title);
|
panel_31.add(btn_zdhj_currcal_reset);
|
btn_zdhj_currcal_reset.setEnabled(false);
|
btn_zdhj_currcal_reset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
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));
|
zdhj_title = "ʵ²âµçÁ÷(A) / У׼µçÁ÷(A)";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Measure Curr(A) / Standerd Curr(A)";
|
}
|
|
zdhj_title = "ÇåÁã";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Clear";
|
}
|
|
zdhj_title = "У׼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Calibrate";
|
}
|
|
zdhj_title = "ÖØÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Reset Cal";
|
}
|
/**************************************************************************/
|
/**************************************************************************/
|
panel_ZDHJ_AutoSaveData = new JPanel();
|
zdhj_title = "Êý¾Ý¼Ç¼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Data Record";
|
}
|
tab_panel_zdhj.add(zdhj_title, panel_ZDHJ_AutoSaveData);
|
panel_ZDHJ_AutoSaveData.setLayout(new BorderLayout(0, 0));
|
|
panel_59 = new JPanel();
|
panel_ZDHJ_AutoSaveData.add(panel_59, BorderLayout.NORTH);
|
panel_59.setLayout(new BoxLayout(panel_59, BoxLayout.X_AXIS));
|
|
zdhj_title = "н¨";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "New";
|
}
|
btn_zdhj_new_savefile = new JButton(zdhj_title);
|
btn_zdhj_new_savefile.setEnabled(false);
|
btn_zdhj_new_savefile.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
fc_zdhj_save_data = new JFileChooser();
|
fc_zdhj_save_data.setFileFilter(new FileFilter() {
|
@Override
|
public boolean accept(File f) {
|
if (f.isDirectory())
|
return true;
|
|
return (f.getName().toUpperCase().endsWith(".CSV"));
|
}
|
|
@Override
|
public String getDescription() {
|
return "*.CSV";
|
}
|
});
|
int value = fc_zdhj_save_data.showSaveDialog(null);
|
if(value == JFileChooser.APPROVE_OPTION) {
|
filename_zdhj_save_data = fc_zdhj_save_data.getSelectedFile().getAbsolutePath();
|
} else {
|
filename_zdhj_save_data = "";
|
}
|
if(false == filename_zdhj_save_data.toUpperCase().endsWith(".CSV")) {
|
filename_zdhj_save_data += ".CSV";
|
}
|
|
tf_zdhj_save_filename.setText(filename_zdhj_save_data);
|
}
|
});
|
panel_59.add(btn_zdhj_new_savefile);
|
|
zdhj_title = "¿ªÊ¼";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Start";
|
}
|
btn_zdhj_start_record = new JButton(zdhj_title);
|
btn_zdhj_start_record.setEnabled(false);
|
btn_zdhj_start_record.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(filename_zdhj_save_data.length() < 1) {
|
String tmp_str = "ÇëÏÈÊäÈëÒª±£´æµÄÊý¾ÝÎļþÃû!";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
tmp_str = "Please input the filename first!";
|
}
|
JOptionPane.showMessageDialog(null, tmp_str);
|
return;
|
}
|
SerialComm_ZDHJ.setAutoStartRestTest(filename_zdhj_save_data, SPCommZDHJ.ZDHJ_ResTest_Start_RegAddr, true);
|
btn_zdhj_new_savefile.setEnabled(false);
|
btn_zdhj_start_record.setEnabled(false);
|
}
|
});
|
panel_59.add(btn_zdhj_start_record);
|
|
zdhj_title = "Í£Ö¹";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Stop";
|
}
|
btn_zdhj_stop_record = new JButton(zdhj_title);
|
btn_zdhj_stop_record.setEnabled(false);
|
btn_zdhj_stop_record.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
SerialComm_ZDHJ.setAutoStartRestTest(filename_zdhj_save_data, SPCommZDHJ.ZDHJ_ResTest_Start_RegAddr, false);
|
btn_zdhj_new_savefile.setEnabled(true);
|
btn_zdhj_start_record.setEnabled(true);
|
}
|
});
|
panel_59.add(btn_zdhj_stop_record);
|
|
tf_zdhj_save_filename = new JTextField();
|
tf_zdhj_save_filename.setEditable(false);
|
panel_59.add(tf_zdhj_save_filename);
|
tf_zdhj_save_filename.setColumns(10);
|
|
panel_60 = new JPanel();
|
panel_ZDHJ_AutoSaveData.add(panel_60, BorderLayout.CENTER);
|
panel_60.setLayout(new BorderLayout(0, 0));
|
|
panel_61 = new JPanel();
|
panel_60.add(panel_61, BorderLayout.NORTH);
|
panel_61.setLayout(new BorderLayout(0, 0));
|
|
tf_zdhj_record_state = new JTextField();
|
tf_zdhj_record_state.setEditable(false);
|
panel_61.add(tf_zdhj_record_state);
|
tf_zdhj_record_state.setColumns(10);
|
|
panel_37 = new JPanel();
|
panel_60.add(panel_37, BorderLayout.CENTER);
|
panel_37.setLayout(new GridLayout(2, 1, 0, 0));
|
|
m_TBarMonCommErrCntChart = new TBarChart(TBarChart.Bar_Type_MonSer);
|
panel_37.add(m_TBarMonCommErrCntChart);
|
|
scrollPane = new JScrollPane();
|
panel_37.add(scrollPane);
|
textArea_zdhj = new JTextArea();
|
scrollPane.setViewportView(textArea_zdhj);
|
/**************************************************************************/
|
/**************************************************************************/
|
if((LANG_TYPE_EN == LANG_TYPE) || (1 == APP_ZDHJ_ONLY)) {
|
main_TabbedPane.setSelectedIndex(1);
|
main_TabbedPane.setEnabled(false);
|
}
|
/**************************************************************************/
|
/**************************************************************************/
|
mMainFormTimer = new Timer(200, new ActionListener() {
|
@Override
|
public void actionPerformed(ActionEvent arg0) {
|
updateData();
|
}
|
});
|
/**************************************************************************/
|
}
|
|
public static void setCommData(ByteBuffer bf) {
|
DataBuffer.position(0);
|
DataBuffer.put(bf.array());
|
}
|
|
private void updateData() {
|
try{
|
if(null != SerialComm_ZDHJ) {
|
tf_txcnt.setText(String.format("TX:%d", SerialComm_ZDHJ.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", SerialComm_ZDHJ.comm_rx_cnt));
|
tf_zdhj_version.setText(String.format("V%1.2f", SerialComm_ZDHJ.dev_stat_version));
|
tf_zdhj_moncount.setText(String.format("%d", SerialComm_ZDHJ.ZDHJ_BattCount));
|
tf_zdhj_zdvol.setText(String.format("%1.1f", SerialComm_ZDHJ.GroupVol));
|
tf_zdhj_volcal_source.setText(String.format("%1.1f", SerialComm_ZDHJ.GroupVol));
|
//System.out.println("SerialComm_ZDHJ.dev_stat_state:" + SerialComm_ZDHJ.dev_stat_state);
|
cb_zdhj_state.setSelectedIndex(SerialComm_ZDHJ.dev_stat_state);
|
tf_zdhj_curr.setText(String.format("%1.1f", SerialComm_ZDHJ.BattCurr));
|
tf_zdhj_currcal_source.setText(String.format("%1.1f", SerialComm_ZDHJ.BattCurr));
|
//cb_zdhj_curr_dir.setSelectedIndex(SerialComm_ZDHJ.BattCurrDir);
|
tf_wenbo_curr_avg.setText(String.format("%1.2f", SerialComm_ZDHJ.AvgWenBoCurr));
|
tf_wenbo_curr_peak.setText(String.format("%1.2f", SerialComm_ZDHJ.PeakWenBoCurr));
|
cb_zdhj_batt_state.setSelectedIndex(SerialComm_ZDHJ.BattState
|
%cb_zdhj_batt_state.getItemCount());
|
cb_zdhj_current_res_test_mode.setSelectedIndex(SerialComm_ZDHJ.CurentResTestMode
|
%cb_zdhj_current_res_test_mode.getItemCount());
|
tf_zdhj_res_test_count.setText(String.format("%d", SerialComm_ZDHJ.ResTestCount));
|
String str = String.format("Com1-ECnt: %d\nCom2-ECnt: %d\nCom3-ECnt: %d\nCom4-ECnt: %d\n",
|
SerialComm_ZDHJ.MonCHCommErrCount[0],
|
SerialComm_ZDHJ.MonCHCommErrCount[1],
|
SerialComm_ZDHJ.MonCHCommErrCount[2],
|
SerialComm_ZDHJ.MonCHCommErrCount[3]);
|
str += String.format("SPI-ECnt: %d\n", SerialComm_ZDHJ.SpiCommErrCount);
|
str += String.format("\nÕû×éÊ£ÓàÈÝÁ¿: %1.1fAH\n", SerialComm_ZDHJ.mGroupRestCap);
|
str += String.format("Õû×éʵ¼ÊÈÝÁ¿: %1.1fAH\n", SerialComm_ZDHJ.mGroupRealCap);
|
str += String.format("ºó±¸Ê±¼ä: %d·ÖÖÓ\n", SerialComm_ZDHJ.mHouBeiTimeMinute);
|
str += String.format("·ÅµçµçÁ÷¹ý¸ß¸æ¾¯: %s\n", SerialComm_ZDHJ.mDischargeCurrHighAlarm);
|
str += String.format("Ѳ¼ìÒǹÊÕϸ澯: %s", SerialComm_ZDHJ.mDevErrorAlarm);
|
textArea_zdhj.setText(str);
|
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_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_curr_range.setText(String.format("%d", SerialComm_ZDHJ.dev_param_curr_range));
|
tf_zdhj_mon_stdcap.setText(String.format("%d", SerialComm_ZDHJ.dev_param_Batt_StdCap));
|
tf_zdhj_mon_stdvol.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_param_Batt_StdVol));
|
tf_zdhj_mon_stdres.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_param_Batt_StdRes));
|
tf_zdhj_batt_floatcurr_lev.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_param_FloatCurrLev));
|
|
tf_groupvol_alarm_high.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_alarm_param_GroupVol_High));
|
tf_groupvol_alarm_low.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_alarm_param_GroupVol_Low));
|
tf_monvol_alarm_high.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_alarm_param_MonVol_High));
|
tf_monvol_alarm_low.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_alarm_param_MonVol_Low));
|
tf_montmp_alarm_high.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_alarm_param_MonTmp_High));
|
tf_montmp_alarm_low.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_alarm_param_MonTmp_Low));
|
tf_monres_alarm_high.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_alarm_param_MonRes_High));
|
tf_monres_alarm_low.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_alarm_param_MonRes_Low));
|
|
tf_zdhj_autores_interval.setText(String.format("%d", SerialComm_ZDHJ.dev_param_auto_restest_interval));
|
cb_zdhj_res_testtype.setSelectedIndex(SerialComm_ZDHJ.dev_param_res_test_type);
|
tf_zdhj_wenbo_curr_lev.setText(String.format("%1.2f", SerialComm_ZDHJ.dev_param_wenbo_curr_lev));
|
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));
|
cb_zdhj_monitor_en.setSelectedIndex(SerialComm_ZDHJ.dev_param_monitor_en);
|
|
cb_restest_speed.setSelectedIndex(SerialComm_ZDHJ.dev_res_test_speed%cb_zdhj_monitor_en.getItemCount());
|
|
tf_charge_curr_lev.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_param_charge_curr_alarmlev));
|
tf_discharge_curr_lev.setText(String.format("%1.1f", SerialComm_ZDHJ.dev_param_discharge_curr_alarmlev));
|
tf_monvol_noavg_lev.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_param_monvol_noacg_alarmlev));
|
tf_monres_noavg_lev.setText(String.format("%1.3f", SerialComm_ZDHJ.dev_param_monres_noacg_alarmlev));
|
}
|
|
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_op_rest_inf.setText(inf_t);
|
tf_param_set_inf.setText(inf_t);
|
|
int mon_cnt = SerialComm_ZDHJ.ZDHJ_BattCount;
|
String[] larm_text = {"-", "¸ß", "µÍ"};
|
String[] noavg_text = {"-", "²»¾ù"};
|
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", SerialComm_ZDHJ.monVol[n]));
|
row.addElement(larm_text[SerialComm_ZDHJ.monVolAlarm[n]%larm_text.length]);
|
row.addElement(noavg_text[SerialComm_ZDHJ.monVolNoAvg[n]%noavg_text.length]);
|
row.addElement(String.format("%1.3f", SerialComm_ZDHJ.monRes[n]));
|
row.addElement(larm_text[SerialComm_ZDHJ.monResAlarm[n]%larm_text.length]);
|
row.addElement(noavg_text[SerialComm_ZDHJ.monResNoAvg[n]%noavg_text.length]);
|
row.addElement(String.format("%1.1f", SerialComm_ZDHJ.monTmp[n]));
|
row.addElement(larm_text[SerialComm_ZDHJ.monTmpAlarm[n]%larm_text.length]);
|
row.addElement(String.format("%1.1f", SerialComm_ZDHJ.monRealCap[n]));
|
row.addElement(String.format("%1.1f", SerialComm_ZDHJ.monRestCap[n]));
|
dataRow.add(row);
|
}
|
} else {
|
for(int n=0; n<mon_cnt; n++) {
|
dataRow.get(n).setElementAt(String.format("%1.3f", SerialComm_ZDHJ.monVol[n]), 1);
|
dataRow.get(n).setElementAt(larm_text[SerialComm_ZDHJ.monVolAlarm[n]%larm_text.length], 2);
|
dataRow.get(n).setElementAt(noavg_text[SerialComm_ZDHJ.monVolNoAvg[n]%noavg_text.length], 3);
|
dataRow.get(n).setElementAt(String.format("%1.3f", SerialComm_ZDHJ.monRes[n]), 4);
|
dataRow.get(n).setElementAt(larm_text[SerialComm_ZDHJ.monResAlarm[n]%larm_text.length], 5);
|
dataRow.get(n).setElementAt(noavg_text[SerialComm_ZDHJ.monResNoAvg[n]%noavg_text.length], 6);
|
dataRow.get(n).setElementAt(String.format("%1.1f", SerialComm_ZDHJ.monTmp[n]), 7);
|
dataRow.get(n).setElementAt(larm_text[SerialComm_ZDHJ.monTmpAlarm[n]%larm_text.length], 8);
|
dataRow.get(n).setElementAt(String.format("%1.1f", SerialComm_ZDHJ.monRealCap[n]), 9);
|
dataRow.get(n).setElementAt(String.format("%1.1f", SerialComm_ZDHJ.monRestCap[n]), 10);
|
}
|
}
|
table_zdhj_data.updateUI();
|
|
m_TBarMonVolChart.updateChartData(TBarChart.Bar_Type_MonVol, SerialComm_ZDHJ.monVol, mon_cnt, SerialComm_ZDHJ.monVolAlarm);
|
m_TBarMonResChart.updateChartData(TBarChart.Bar_Type_MonRes, SerialComm_ZDHJ.monRes, mon_cnt, SerialComm_ZDHJ.monResAlarm);
|
m_TBarMonTmpChart.updateChartData(TBarChart.Bar_Type_MonTmp, SerialComm_ZDHJ.monTmp, mon_cnt, SerialComm_ZDHJ.monTmpAlarm);
|
|
double[] group_vol = {SerialComm_ZDHJ.GroupVol};
|
double[] group_curr = {SerialComm_ZDHJ.BattCurr};
|
int[] group_al = {SerialComm_ZDHJ.GroupVolAlarm};
|
m_TBarGroupVolChart.updateChartData(TBarChart.Bar_Type_MonVol, group_vol, 1, group_al);
|
if(mon_cnt > 0) {
|
int[] tmp_al = new int[mon_cnt];
|
m_TBarGroupCurrChart.updateChartData(TBarChart.Bar_Type_BattCurr, group_curr, 1, tmp_al);
|
m_TBarMonRealCapChart.updateChartData(TBarChart.Bar_Type_MonRealCap, SerialComm_ZDHJ.monRealCap, mon_cnt, tmp_al);
|
m_TBarMonRestCapChart.updateChartData(TBarChart.Bar_Type_MonRestCap, SerialComm_ZDHJ.monRestCap, mon_cnt, tmp_al);
|
m_TBarMonCommErrCntChart.updateChartData(TBarChart.Bar_Type_MonSer, SerialComm_ZDHJ.monCommErrCnt, mon_cnt, tmp_al);
|
}
|
|
if(SerialComm_ZDHJ.AutoStartResTestEn) {
|
String text_tt = "";
|
if(SerialComm_ZDHJ.AutoSaveResDataCount > 0) {
|
text_tt += "Òѱ£´æ´ÎÊý: " + SerialComm_ZDHJ.AutoSaveResDataCount
|
+ "; Éϴα£´æÊ±¼ä: " + Com.get_DTF(SerialComm_ZDHJ.AutoSaveResDataTime, Com.DTF_YMDhms)
|
+ "; ";
|
}
|
text_tt += "µÈ´ý±£´æÊý¾Ý @ " + Com.get_DTF(new Date(), Com.DTF_YMDhms);
|
tf_zdhj_record_state.setText(text_tt);
|
}
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
//JOptionPane.showMessageDialog(null, "updateData():" + e.getMessage());
|
}
|
}
|
}
|