package com.dev.fbs9600_groupvol;
|
|
import java.awt.BorderLayout;
|
import java.awt.Color;
|
import java.awt.Font;
|
import java.awt.GridLayout;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
|
import javax.swing.BoxLayout;
|
import javax.swing.JButton;
|
import javax.swing.JOptionPane;
|
import javax.swing.JPanel;
|
import javax.swing.JTextField;
|
import javax.swing.UIManager;
|
import javax.swing.border.TitledBorder;
|
|
import com.LimitedDocument;
|
import com.dev.fbs9600_mon.SPCommMon;
|
|
import java.awt.FlowLayout;
|
|
import javax.swing.JTabbedPane;
|
|
import org.apache.logging.log4j.Logger;
|
|
import main.page_debug_inf;
|
import main.page_dfu;
|
|
public class module_vol_page extends JPanel {
|
public SPCommMon Comm_Vol;
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
private JTextField tf_lockbit;
|
private JTextField tf_ssb;
|
private JTextField tf_addr;
|
private JTextField tf_version;
|
private JTextField tf_vol_1;
|
private JTextField tf_vol_2;
|
private JTextField tf_tmp_1;
|
private JTextField tf_tmp_2;
|
private JTextField tf_vol_offset1;
|
private JTextField tf_vol_slope1;
|
private JTextField tf_vol_offset2;
|
private JTextField tf_vol_slope2;
|
private JTextField tf_tmp_slope1;
|
private JTextField tf_tmp_slope2;
|
|
private JButton btn_tmp_cal1;
|
private JButton btn_tmp_reset1;
|
private JButton btn_tmp_cal2;
|
private JButton btn_tmp_reset2;
|
|
private JButton btn_vol_reset1;
|
private JButton btn_vol_offset1;
|
private JButton btn_vol_slope1;
|
private JButton btn_vol_reset2;
|
private JButton btn_vol_slope2;
|
private JButton btn_vol_offset2;
|
private JPanel panel;
|
private JTabbedPane tabbedPane;
|
|
private page_dfu panel_dfu;
|
private page_debug_inf panel_debug;
|
|
/**
|
* Create the panel.
|
*/
|
public module_vol_page() {
|
setLayout(new BorderLayout(0, 0));
|
|
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
add(tabbedPane, BorderLayout.CENTER);
|
|
panel = new JPanel();
|
tabbedPane.addTab("\u57FA\u672C\u6D4B\u8BD5", null, panel, null);
|
panel.setLayout(new GridLayout(4, 0, 0, 0));
|
|
JPanel panel_4 = new JPanel();
|
panel.add(panel_4);
|
panel_4.setBorder(new TitledBorder(null, "\u6A21\u5757\u4FE1\u606F", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_4.setLayout(new GridLayout(0, 4, 0, 0));
|
|
JPanel panel_5 = new JPanel();
|
panel_5.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6A21\u5757\u5730\u5740", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_5);
|
panel_5.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_addr = new JTextField();
|
tf_addr.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_addr.setEditable(false);
|
panel_5.add(tf_addr);
|
tf_addr.setColumns(10);
|
|
JPanel panel_6 = new JPanel();
|
panel_6.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6A21\u5757\u7248\u672C", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_4.add(panel_6);
|
panel_6.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_version = new JTextField();
|
tf_version.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_version.setEditable(false);
|
panel_6.add(tf_version);
|
tf_version.setColumns(10);
|
|
JPanel panel_62 = new JPanel();
|
panel_62.setBorder(new TitledBorder(null, "\u9501\u5B9A\u4F4D", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_4.add(panel_62);
|
panel_62.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_lockbit = new JTextField();
|
tf_lockbit.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_lockbit.setEditable(false);
|
panel_62.add(tf_lockbit);
|
tf_lockbit.setColumns(10);
|
|
JPanel panel_63 = new JPanel();
|
panel_63.setBorder(new TitledBorder(null, "\u52A0\u5BC6\u4F4D", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
panel_4.add(panel_63);
|
panel_63.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_ssb = new JTextField();
|
tf_ssb.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_ssb.setEditable(false);
|
panel_63.add(tf_ssb);
|
tf_ssb.setColumns(10);
|
|
JPanel panel_10 = new JPanel();
|
panel.add(panel_10);
|
panel_10.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u6D41\u6D4B\u91CF", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_10.setLayout(new GridLayout(0, 4, 0, 0));
|
|
JPanel panel_11 = new JPanel();
|
panel_11.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E00(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_10.add(panel_11);
|
panel_11.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_vol_1 = new JTextField();
|
tf_vol_1.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_11.add(tf_vol_1);
|
tf_vol_1.setColumns(10);
|
|
JPanel panel_22 = new JPanel();
|
panel_22.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6E29\u5EA6\u4E00(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_10.add(panel_22);
|
panel_22.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_tmp_1 = new JTextField();
|
tf_tmp_1.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_tmp_1.setDocument(new LimitedDocument(6, "0123456789"));
|
panel_22.add(tf_tmp_1);
|
tf_tmp_1.setColumns(10);
|
|
JPanel panel_13 = new JPanel();
|
panel_13.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E8C(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_10.add(panel_13);
|
panel_13.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_vol_2 = new JTextField();
|
panel_13.add(tf_vol_2);
|
tf_vol_2.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_vol_2.setDocument(new LimitedDocument(6, "0123456789"));
|
tf_vol_2.setColumns(10);
|
|
JPanel panel_16 = new JPanel();
|
panel_16.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6E29\u5EA6\u4E8C(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_10.add(panel_16);
|
panel_16.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_tmp_2 = new JTextField();
|
panel_16.add(tf_tmp_2);
|
tf_tmp_2.setColumns(10);
|
|
JPanel panel_12 = new JPanel();
|
panel.add(panel_12);
|
panel_12.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u4E00\u901A\u9053\u6821\u51C6\u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_12.setLayout(new BoxLayout(panel_12, BoxLayout.X_AXIS));
|
|
JPanel panel_14 = new JPanel();
|
panel_14.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E00\u504F\u79FB(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_12.add(panel_14);
|
panel_14.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_vol_offset1 = new JTextField();
|
tf_vol_offset1.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
panel_14.add(tf_vol_offset1);
|
tf_vol_offset1.setColumns(10);
|
|
btn_vol_offset1 = new JButton("\u6821\u51C6");
|
btn_vol_offset1.setEnabled(false);
|
btn_vol_offset1.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
if (tf_vol_offset1.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ÇëÊäÈëÐèҪУ׼µÄÆ«ÒÆµçѹֵ!");
|
return;
|
} else {
|
data_flow = (short) (Integer.parseInt(tf_vol_offset1.getText()));
|
}
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonVol1AdjOffset_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_14.add(btn_vol_offset1);
|
|
JPanel panel_24 = new JPanel();
|
panel_24.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E00\u659C\u7387(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_12.add(panel_24);
|
panel_24.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_vol_slope1 = new JTextField();
|
tf_vol_slope1.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_vol_slope1.setDocument(new LimitedDocument(5, "0123456789."));
|
panel_24.add(tf_vol_slope1);
|
tf_vol_slope1.setColumns(10);
|
|
btn_vol_slope1 = new JButton("\u6821\u51C6");
|
btn_vol_slope1.setEnabled(false);
|
btn_vol_slope1.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
if (tf_vol_slope1.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ÇëÊäÈëÐèҪУ׼µÄбÂʵçѹֵ!");
|
return;
|
} else {
|
data_flow = (short) (Integer.parseInt(tf_vol_slope1.getText()));
|
}
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonVol1AdjSlope_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_24.add(btn_vol_slope1);
|
|
JPanel panel_36 = new JPanel();
|
panel_12.add(panel_36);
|
panel_36.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E00\u6821\u51C6\u590D\u4F4D", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
|
btn_vol_reset1 = new JButton("\u7535\u538B\u4E00\u6821\u51C6\u590D\u4F4D");
|
btn_vol_reset1.setEnabled(false);
|
btn_vol_reset1.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonVol1AdjReset_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_36.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
panel_36.add(btn_vol_reset1);
|
|
JPanel panel_77 = new JPanel();
|
panel_77.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6E29\u5EA6\u4E00\u6821\u51C6(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_12.add(panel_77);
|
panel_77.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_tmp_slope1 = new JTextField();
|
panel_77.add(tf_tmp_slope1);
|
tf_tmp_slope1.setColumns(10);
|
tf_tmp_slope1.setDocument(new LimitedDocument(6, "0123456789."));
|
|
btn_tmp_cal1 = new JButton("\u6821\u51C6");
|
btn_tmp_cal1.setEnabled(false);
|
btn_tmp_cal1.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
if (tf_tmp_slope1.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ÇëÊäÈëÐèҪУ׼µÄζÈÖµ!");
|
return;
|
}
|
if(tf_tmp_1.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ʵ¼Ê²âÊÔζÈÖµÎÞЧ!");
|
return;
|
}
|
float set_curr = Float.parseFloat(tf_tmp_slope1.getText())*10 + 100;
|
data_flow = (short) (set_curr);
|
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonTmp1AdjSlope_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_77.add(btn_tmp_cal1);
|
|
btn_tmp_reset1 = new JButton("\u590D\u4F4D");
|
btn_tmp_reset1.setEnabled(false);
|
btn_tmp_reset1.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
short data_flow = (short) 0xFF00;
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonTmp1AdjSlope_RegAddr,
|
data_flow, (short)0xABCD, (short)0xABCD);
|
}
|
});
|
panel_77.add(btn_tmp_reset1);
|
|
JPanel panel_15 = new JPanel();
|
panel.add(panel_15);
|
panel_15.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u4E8C\u901A\u9053\u6821\u51C6\u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_15.setLayout(new BoxLayout(panel_15, BoxLayout.X_AXIS));
|
|
JPanel panel_3 = new JPanel();
|
panel_3.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E8C\u504F\u79FB(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_15.add(panel_3);
|
panel_3.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_vol_offset2 = new JTextField();
|
tf_vol_offset2.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_vol_offset2.setColumns(10);
|
panel_3.add(tf_vol_offset2);
|
|
btn_vol_offset2 = new JButton("\u6821\u51C6");
|
btn_vol_offset2.setEnabled(false);
|
btn_vol_offset2.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
if (tf_vol_offset2.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ÇëÊäÈëÐèҪУ׼µÄÆ«ÒÆµçѹֵ!");
|
return;
|
} else {
|
data_flow = (short) (Integer.parseInt(tf_vol_offset2.getText()));
|
}
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonVol2AdjOffset_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_3.add(btn_vol_offset2);
|
|
JPanel panel_7 = new JPanel();
|
panel_7.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E8C\u659C\u7387(mV)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_15.add(panel_7);
|
panel_7.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_vol_slope2 = new JTextField();
|
tf_vol_slope2.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
tf_vol_slope2.setDocument(new LimitedDocument(5, "0123456789."));
|
tf_vol_slope2.setColumns(10);
|
panel_7.add(tf_vol_slope2);
|
|
btn_vol_slope2 = new JButton("\u6821\u51C6");
|
btn_vol_slope2.setEnabled(false);
|
btn_vol_slope2.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
if (tf_vol_slope2.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ÇëÊäÈëÐèҪУ׼µÄбÂʵçѹֵ!");
|
return;
|
} else {
|
data_flow = (short) (Integer.parseInt(tf_vol_slope2.getText()));
|
}
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonVol2AdjSlope_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_7.add(btn_vol_slope2);
|
|
JPanel panel_18 = new JPanel();
|
panel_18.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u7535\u538B\u4E8C\u6821\u51C6\u590D\u4F4D", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_15.add(panel_18);
|
|
btn_vol_reset2 = new JButton("\u7535\u538B\u4E8C\u6821\u51C6\u590D\u4F4D");
|
btn_vol_reset2.setEnabled(false);
|
btn_vol_reset2.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonVol2AdjReset_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_18.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
panel_18.add(btn_vol_reset2);
|
|
JPanel panel_19 = new JPanel();
|
panel_19.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u6E29\u5EA6\u4E8C\u6821\u51C6(\u2103)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_15.add(panel_19);
|
panel_19.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
tf_tmp_slope2 = new JTextField();
|
tf_tmp_slope2.setColumns(10);
|
panel_19.add(tf_tmp_slope2);
|
|
btn_tmp_cal2 = new JButton("\u6821\u51C6");
|
btn_tmp_cal2.setEnabled(false);
|
btn_tmp_cal2.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(null != Comm_Vol) {
|
short data_flow = 0x0001;
|
if (tf_tmp_slope2.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ÇëÊäÈëÐèҪУ׼µÄζÈÖµ!");
|
return;
|
}
|
if(tf_tmp_2.getText().length() <= 0) {
|
JOptionPane.showMessageDialog(null, "ʵ¼Ê²âÊÔζÈÖµÎÞЧ!");
|
return;
|
}
|
float set_curr = Float.parseFloat(tf_tmp_slope2.getText())*10 + 100;
|
data_flow = (short) (set_curr);
|
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonTmp2AdjSlope_RegAddr,
|
data_flow, (short)0xABCD, (short)0x1234);
|
}
|
}
|
});
|
panel_19.add(btn_tmp_cal2);
|
|
btn_tmp_reset2 = new JButton("\u590D\u4F4D");
|
btn_tmp_reset2.setEnabled(false);
|
btn_tmp_reset2.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
short data_flow = (short) 0xFF00;
|
Comm_Vol.setCommCmd(SPCommMon.CMD_TYPE_WRITE,
|
SPCommMon.UART_MonTmp2AdjSlope_RegAddr,
|
data_flow, (short)0xABCD, (short)0xABCD);
|
}
|
});
|
panel_19.add(btn_tmp_reset2);
|
|
panel_dfu = new page_dfu();
|
tabbedPane.addTab("\u7A0B\u5E8F\u5347\u7EA7", null, panel_dfu, null);
|
|
panel_debug = new page_debug_inf();
|
tabbedPane.addTab("\u8C03\u8BD5\u4FE1\u606F", null, panel_debug, null);
|
}
|
|
public void setButttonState(boolean state) {
|
btn_tmp_cal1.setEnabled(state);
|
btn_tmp_reset1.setEnabled(state);
|
btn_tmp_cal2.setEnabled(state);
|
btn_tmp_reset2.setEnabled(state);
|
|
btn_vol_reset1.setEnabled(state);
|
btn_vol_offset1.setEnabled(state);
|
btn_vol_slope1.setEnabled(state);
|
btn_vol_reset2.setEnabled(state);
|
btn_vol_slope2.setEnabled(state);
|
btn_vol_offset2.setEnabled(state);
|
|
panel_dfu.setButttonState(state);
|
}
|
|
public boolean openCommPort(int comm_type, String spname_or_ipaddr, int bitrate_or_ipport,
|
int dev_type, int multy_comm_type, JTextField tf_addr, Logger log) {
|
boolean res = false;
|
Comm_Vol = new SPCommMon(tf_addr, bitrate_or_ipport, dev_type, multy_comm_type,
|
panel_dfu.ta_dfu_inf, panel_debug, log);
|
Comm_Vol.setCmdNullEn(false);
|
|
if(true == Comm_Vol.OpenCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport)) {
|
Thread spcommThread = new Thread(Comm_Vol);
|
spcommThread.start();
|
|
panel_dfu.set_SerialComm_Mon(Comm_Vol);
|
panel_dfu.setDfu_Mon_Addr(tf_addr.getText(), tf_addr.getText());
|
|
setButttonState(true);
|
|
res = true;
|
}
|
|
return res;
|
}
|
|
public void closeCommPort() {
|
if(null != Comm_Vol) {
|
Comm_Vol.exitCommPortThread();
|
Comm_Vol = null;
|
panel_dfu.set_SerialComm_Mon(Comm_Vol);
|
|
setButttonState(false);
|
}
|
}
|
|
public void updateData() {
|
try{
|
if(null != Comm_Vol) {
|
tf_addr.setText(String.format("%d", Comm_Vol.dt_addr));
|
tf_version.setText(String.format("V%1.2f", ((double)Comm_Vol.dt_version)/100));
|
//cb_monvol_type.setSelectedIndex(SerialComm_Mon.dt_voltype%cb_monvol_type.getItemCount());
|
tf_lockbit.setText(String.format("%d", Comm_Vol.dt_lockpage_count));
|
tf_ssb.setText(String.format("%d", Comm_Vol.dt_ssb));
|
|
tf_vol_1.setText(String.format("%d", Comm_Vol.dt_vol_1));
|
tf_tmp_1.setText(String.format("%1.1f", (((double)Comm_Vol.dt_tmp_1)/10)-10.0));
|
tf_vol_2.setText(String.format("%d", Comm_Vol.dt_vol_2));
|
tf_tmp_2.setText(String.format("%1.1f", (((double)Comm_Vol.dt_tmp_2)/10)-10.0));
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
//JOptionPane.showMessageDialog(null, "updateData():" + e.getMessage());
|
}
|
}
|
}
|