package main;
|
import java.awt.EventQueue;
|
|
import javax.swing.JFrame;
|
|
import java.awt.BorderLayout;
|
|
import javax.swing.JComboBox;
|
import javax.swing.JPanel;
|
import javax.swing.border.TitledBorder;
|
import javax.swing.JButton;
|
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.JOptionPane;
|
import javax.swing.Timer;
|
|
import java.awt.event.ActionListener;
|
import java.awt.event.ActionEvent;
|
import java.awt.Toolkit;
|
|
import javax.swing.JTextField;
|
import javax.swing.UIManager;
|
|
import java.awt.Color;
|
import java.awt.Container;
|
import java.nio.ByteBuffer;
|
import java.util.ArrayList;
|
import java.util.Date;
|
import java.util.List;
|
|
import javax.swing.JTabbedPane;
|
|
import java.awt.Font;
|
import java.awt.GridBagConstraints;
|
import java.awt.GridBagLayout;
|
import java.awt.event.FocusAdapter;
|
import java.awt.event.FocusEvent;
|
import java.net.InetAddress;
|
import java.net.UnknownHostException;
|
|
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeEvent;
|
|
import sp_comm.CommSerialPort;
|
import user_app_form.SkinConfig;
|
import user_app_form.iec61850_page_base;
|
|
import com.Com;
|
import com.LimitedDocument;
|
import com.dev.bts4810.bts4810_page_base;
|
import com.dev.btsm.bts_page_base;
|
import com.dev.bybb.bybb_page_base;
|
import com.dev.dummyload.DummyLoad_page_base;
|
import com.dev.fbo4830.fbo4830_page_base;
|
import com.dev.fbs9600_curr.module_curr_page;
|
import com.dev.fbs9600_groupvol.FCF651_groupvol_page;
|
import com.dev.fbs9600_groupvol.module_vol_page;
|
import com.dev.fbs9600_mon.SPCommMon;
|
import com.dev.fbs9600_mon.module_mon_page;
|
import com.dev.fbs9600_zdhj.zdhj_page_base;
|
import com.dev.ica_600kw.*;
|
import com.dev.nrf_lora_tester.loratester_page_base;
|
import com.dev.ntm.ntm_page_base;
|
import com.dev.simpower.power_page_base;
|
import com.dev.switchdev.SwitchDevice_page_base;
|
import com.ueky.ukeycfg_page_base;
|
|
import javax.swing.BorderFactory;
|
import javax.swing.Box;
|
import javax.swing.BoxLayout;
|
|
import java.awt.Dimension;
|
import java.awt.FlowLayout;
|
|
import javax.swing.JLabel;
|
import javax.swing.ImageIcon;
|
|
import java.awt.GridLayout;
|
import java.awt.Insets;
|
|
import javax.swing.SwingConstants;
|
import javax.swing.SwingUtilities;
|
|
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.Logger;
|
|
public class main_window_computer {
|
public static int CommDevType_MON = -1; //0
|
public static int CommDevType_CURR = -1; //1
|
public static int CommDevType_GROUPVOL = -1; //2
|
public static int CommDevType_FCF651VOL = -1; //3
|
public static int CommDevType_ZDHJ = -1; //4
|
public static int CommDevType_FBS9100 = -1; //5
|
public static int CommDevType_NTM = -1; //6
|
public static int CommDevType_LoraTest = -1; //7
|
public static int CommDevType_BYBB = -1; //8
|
public static int CommDevType_FBO4830 = -1; //9
|
public static int CommDevType_BTS4810 = -1; //10
|
public static int CommDevType_SwitchDevice = -1; //11 Çл»×°ÖÃ
|
public static int CommDevType_DummyLoad = -1; //12 ¼Ù¸ºÔØ
|
public static int CommDevType_IEC61850 = -1; //13 IEC61850
|
public static int CommDevType_UKEY = -1; //14 UKEY
|
public static int CommDevType_SIMPOWER = -1; //15 ¼«¼ò»¯µçÔ´
|
public static int CommDevType_ICA_200KW = -1; //15 ICA_200KW
|
|
public static final int CommDevType_MAX = 17;
|
|
public static int LANG_TYPE_CN = 0;
|
public static int LANG_TYPE_EN = 1;
|
|
//public String mTitle = "MSP&SAM&SWM&Curr_V1.523_220424G";
|
public String mTitle = "µ÷ÊÔ¹¤¾ß";
|
|
public String mVerSioin = "_V1.107";
|
|
|
public static int LANG_TYPE = LANG_TYPE_CN;
|
|
public static final boolean APP_FBS9600_MON_EN = true;
|
public static final boolean APP_FBS9600_CURR_EN = false;
|
public static final boolean APP_FBS9600_GVOL_EN = false;
|
public static final boolean APP_FCF_GVOL_EN = false;
|
public static final boolean APP_FBS9600_ZDHJ_EN = true;
|
public static final boolean APP_BTSM_EN = false;
|
public static final boolean APP_NTM_EN = false;
|
public static final boolean APP_NTM_LORA_EN = false;
|
public static final boolean APP_BYBB_EN = false;
|
public static final boolean APP_FBO4830_EN = false;
|
public static final boolean APP_BTS4810_EN = true;
|
public static final boolean APP_SwitchDevice_EN = false; //Çл»×°ÖÃ
|
public static final boolean APP_DummyLoad_EN = false; //¼Ù¸ºÔØ
|
public static final boolean APP_IEC61850_EN = true; //IEC61850
|
public static final boolean APP_UKEY_EN = true; //UKEY
|
public static final boolean APP_SIMPOWER_EN = true; //¼«¼ò»¯µçÔ´
|
|
public static final boolean APP_ICA_200KW_EN = true; //ICA-200KW
|
|
public int CommDevType = 6; //ĬÈÏÏÔʾtabÑ¡Ï
|
|
public static final int DebugMode_TYPE_Debug = 0; //µ÷ÊÔÄ£Äâ
|
public static final int DebugMode_TYPE_Package = 1; //µçÄÔ´ò°üģʽ
|
public static final int DebugMode_TYPE_Screen = 2; //10´çÆÁģʽ
|
|
public int DebugMode = DebugMode_TYPE_Package; //ÊÇ·ñΪµ÷ÊÔģʽtrue:µ÷ÊÔģʽ false:´ò°üģʽ[»áÒþ²Ø×ó²àÑ¡Ï]
|
|
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 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 List<JPanel> tabbedTopPanes = new ArrayList<JPanel>();
|
|
private List<JPanel> tabbedRightPanes = new ArrayList<JPanel>();
|
|
private JPanel main_TabbedTopPane0;
|
private JPanel main_TabbedTopPane1;
|
private JPanel main_TabbedTopPane2;
|
private JPanel main_TabbedTopPane3;
|
private JPanel main_TabbedTopPane4;
|
private JPanel main_TabbedTopPane5;
|
private JPanel main_TabbedTopPane6;
|
private JPanel main_TabbedTopPane7;
|
private JPanel main_TabbedTopPane8;
|
private JPanel main_TabbedTopPane9;
|
private JPanel main_TabbedTopPane10;
|
private JPanel main_TabbedTopPane11;
|
private JPanel main_TabbedTopPane12;
|
private JPanel main_TabbedTopPane13;
|
private JPanel main_TabbedTopPane14;
|
private JPanel main_TabbedTopPane15;
|
private JPanel main_TabbedTopPane16;
|
|
private JPanel main_TabbedRightPane0;
|
private JPanel main_TabbedRightPane1;
|
private JPanel main_TabbedRightPane2;
|
private JPanel main_TabbedRightPane3;
|
private JPanel main_TabbedRightPane4;
|
private JPanel main_TabbedRightPane5;
|
private JPanel main_TabbedRightPane6;
|
private JPanel main_TabbedRightPane7;
|
private JPanel main_TabbedRightPane8;
|
private JPanel main_TabbedRightPane9;
|
private JPanel main_TabbedRightPane10;
|
private JPanel main_TabbedRightPane11;
|
private JPanel main_TabbedRightPane12;
|
private JPanel main_TabbedRightPane13;
|
private JPanel main_TabbedRightPane14;
|
private JPanel main_TabbedRightPane15;
|
private JPanel main_TabbedRightPane16;
|
|
|
private JButton btn_renew_commport;
|
private JComboBox<String> cb_comm_bitrate;
|
|
private JPanel pre_panel; //ǰÖýçÃæ
|
private JPanel top_panel1; //³£¹æÍ·²¿ÈÝÆ÷
|
private JButton btn_back; //·µ»Ø°´Å¥
|
|
private JComboBox<?> cb_dev_type;
|
private JButton btnNewButton;
|
private JButton btnNewButton_1;
|
private JLabel label;
|
private JTabbedPane tab_comm_type;
|
private JPanel panel_3;
|
private JTextField tf_ip_addr;
|
private JTextField tf_ip_port;
|
|
private module_mon_page panel_mon_base;
|
private module_curr_page panel_Curr_Module;
|
private module_vol_page panel_groupVol_Module;
|
private FCF651_groupvol_page panel_fcf651Vol_Module;
|
private zdhj_page_base panel_ZDHJ_base;
|
private bts_page_base panel_FBS9100_base;
|
private ntm_page_base panel_NTM_base;
|
private loratester_page_base panel_LoraTest_base;
|
private bybb_page_base panel_bybb_base;
|
private fbo4830_page_base panel_fbo4830_base;
|
|
private bts4810_page_base panel_bts4810_base;
|
|
private SwitchDevice_page_base panel_switchdevice_base; //
|
|
private DummyLoad_page_base panel_dummyload_base; //
|
private iec61850_page_base panel_iec61850_base; //
|
private ukeycfg_page_base panel_ueky_page_base;
|
|
private power_page_base panel_power_page_base; //¼«¼ò»¯µçÔ´
|
|
private iac_600kw_page panel_ica_600kw_page; //ICA-200KW
|
|
private List<JPanel> pre_panels = new ArrayList<>(); //ǰÖÃÃæ°å¿Õ°×Ãæ°å
|
|
/*********************************************************************************************/
|
static Logger m_Log = null;
|
@SuppressWarnings("rawtypes")
|
private JComboBox cb_tcp_udp;
|
static {
|
System.setProperty("log4j.configurationFile", "log4j2_batt_dev.xml");
|
}
|
/*********************************************************************************************/
|
|
/**
|
* Launch the application.
|
*/
|
public static void main(String[] args) {
|
m_Log = LogManager.getLogger(main_window_computer.class);
|
|
|
SkinConfig.setupLookAndFeel(true);
|
//int dat = -30;-
|
//System.out.println(String.format("dat=%4X", dat));
|
|
byte[] bf = new byte[8];
|
for(int n=0; n<bf.length; n++) {
|
bf[n] = (byte) n;
|
}
|
//short crc1 = Crc16.CalModBusCRC16(bf, bf.length);
|
//short crc2 = Crc16.CalCRC16(bf, bf.length);
|
//System.out.println("crc1:" + (crc1&0xFFFF) + ", " + "crc2:" + crc2);
|
/*
|
CRC32 crc32 = new CRC32();
|
crc32.reset();
|
crc32.update(bf);
|
System.out.println(ComFn.bytesToHexString(bf, bf.length));
|
System.out.println("byte[] crc32.getValue():" + crc32.getValue());
|
|
crc32.reset();
|
ByteBuffer bb = ByteBuffer.allocate(bf.length);
|
bb.put(bf);
|
bb.flip();
|
crc32.update(bb);
|
System.out.println("ByteBuffer crc32.getValue():" + crc32.getValue());
|
*/
|
|
String hostAddress = "127.0.0.1";
|
try {
|
//»ñÈ¡±¾»úipµØÖ·
|
hostAddress = InetAddress.getLocalHost().getHostAddress();
|
System.out.println(hostAddress);
|
} catch (UnknownHostException e1) {
|
e1.printStackTrace();
|
}
|
|
EventQueue.invokeLater(new Runnable() {
|
public void run() {
|
try {
|
main_window_computer window = new main_window_computer();
|
window.frmSerialport.setVisible(true);
|
} catch (Exception e) {
|
m_Log.error(e.toString(), e);
|
}
|
}
|
});
|
}
|
|
/**
|
* Create the application.
|
*/
|
public main_window_computer() {
|
initialize();
|
}
|
|
/**
|
* Initialize the contents of the frame.
|
*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
private void initialize() {
|
frmSerialport = new JFrame();
|
frmSerialport.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
//frmSerialport.setResizable(false);
|
|
frmSerialport.setIconImage(Toolkit.getDefaultToolkit().getImage(main_window_computer.class.getResource("/main/fuguang.png")));
|
//frmSerialport.setIconImage(Toolkit.getDefaultToolkit().getImage(main_window_computer.class.getResource("/main/12164006.png")));
|
frmSerialport.setBounds(100, 100, 1180, 640);
|
frmSerialport.setMinimumSize(new Dimension(1160, 640));
|
//frmSerialport.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
frmSerialport.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frmSerialport.setLocationRelativeTo(null);
|
|
frmSerialport.setLayout(new BorderLayout());
|
|
//·µ»Ø°´Å¥ÈÝÆ÷
|
JPanel panel_10 = new JPanel();
|
|
//ǰÖýçÃæ
|
pre_panel = new JPanel();
|
pre_panel.setLayout(new GridLayout(0,4, 20, 20));
|
//ÉèÖñ߿ò¿í¶È
|
pre_panel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
|
|
btn_back = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_16x16/arrow_undo.png")));
|
|
btn_back.setText("·µ»Ø");
|
btn_back.setSize(new Dimension(100, 80));
|
//setButtonType(btn_back);
|
btn_back.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(pre_panel,BorderLayout.CENTER);
|
|
if(!panel_10.isAncestorOf(top_panel1)) {
|
top_panel1.add(panel_10);
|
}
|
|
|
btn_break.doClick();
|
|
mTitle = "µ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
|
});
|
}
|
});
|
|
|
JButton btn_mon = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/batt_mon.png")));
|
//JButton btn_mon = new JButton(new ImageIcon(main_window_computer.class.getResource("/icon/mon_ied.png")));
|
btn_mon.setText("µ¥ÌåÄ£¿é");
|
setButtonType(btn_mon);
|
btn_mon.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane0, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_MON);
|
|
mTitle = "µ¥ÌåÄ£¿éµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_curr = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/curr_model.png")));
|
btn_curr.setText("µçÁ÷Ä£¿é");
|
setButtonType(btn_curr);
|
btn_curr.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane1, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_CURR);
|
|
mTitle = "µçÁ÷Ä£¿éµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_groupvol = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/groupvol.png")));
|
btn_groupvol.setText("×éѹģ¿é");
|
setButtonType(btn_groupvol);
|
btn_groupvol.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane2, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_GROUPVOL);
|
|
mTitle = "×éѹģ¿éµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_fcf651vol = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/groupvol1.png")));
|
btn_fcf651vol.setText("FCF×éѹ");
|
setButtonType(btn_fcf651vol);
|
btn_fcf651vol.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane3, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_FCF651VOL);
|
|
mTitle = "FCF×éѹµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_zdhj = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/zdhj_mon.png")));
|
btn_zdhj.setText("×é¶Ë»ã¼¯Ä£¿é");
|
setButtonType(btn_zdhj);
|
btn_zdhj.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane4, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_ZDHJ);
|
|
mTitle = "×é¶Ë»ã¼¯Ä£¿éµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_fbs9100 = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/control.png")));
|
btn_fbs9100.setText("BTSÖ÷¿Ø");
|
setButtonType(btn_fbs9100);
|
btn_fbs9100.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane5, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_FBS9100);
|
|
mTitle = "BTSÖ÷¿Øµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_ntm = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/dis_ele.png")));
|
btn_ntm.setText("NTM·ÅµçÒÇ");
|
setButtonType(btn_ntm);
|
btn_ntm.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane6, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_NTM);
|
|
mTitle = "NTM·ÅµçÒǵ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_lora = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/mcs_lora_on.png")));
|
btn_lora.setText("Lora²âÊÔ");
|
setButtonType(btn_lora);
|
btn_lora.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane7, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_LoraTest);
|
|
mTitle = "Lora²âÊÔµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_bybb = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/board_main.png")));
|
btn_bybb.setText("BYBB²âÊÔ");
|
setButtonType(btn_bybb);
|
btn_bybb.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane8, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_BYBB);
|
|
mTitle = "BYBB²âÊÔµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_fbo4830 = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/dis_instrument.png")));
|
btn_fbo4830.setText("FBO4830");
|
setButtonType(btn_fbo4830);
|
btn_fbo4830.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane9, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_FBO4830);
|
|
mTitle = "FBO4830µ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_bts4810 = new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/dis_instrument1.png")));
|
btn_bts4810.setText("ºËÈÝÖ÷»ú");
|
setButtonType(btn_bts4810);
|
btn_bts4810.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane10, BorderLayout.CENTER);
|
|
System.out.println("CommDevType_BTS4810:"+CommDevType_BTS4810+"\tmain_TabbedPane.getTabCount():"+main_TabbedPane.getTabCount());
|
setJTableSelectIndex(CommDevType_BTS4810);
|
|
mTitle = "ºËÈÝÖ÷»úµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_switch= new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/change_instrument.png")));
|
btn_switch.setText("Çл»×°ÖÃ");
|
setButtonType(btn_switch);
|
btn_switch.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane11, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_SwitchDevice);
|
|
mTitle = "Çл»×°Öõ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_load= new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/dummy_load.png")));
|
btn_load.setText("¼Ù¸ºÔØ×°ÖÃ");
|
setButtonType(btn_load);
|
btn_load.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
frmSerialport.getContentPane().add(main_TabbedRightPane12, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_DummyLoad);
|
|
mTitle = "¼Ù¸ºÔØ×°Öõ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
JButton btn_iec61850= new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/61850_logo.png")));
|
btn_iec61850.setText("61850Ðת");
|
setButtonType(btn_iec61850);
|
btn_iec61850.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
panel_iec61850_base.panel.add(panel_10);
|
|
//panel_10.setPreferredSize(new Dimension(100, 50));
|
|
frmSerialport.getContentPane().add(main_TabbedRightPane13, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_IEC61850);
|
|
mTitle = "61850Ðתµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
|
JButton btn_ukey= new JButton(new ImageIcon(main_window_computer.class.getResource("/png_32x32/ukey_logo.png")));
|
btn_ukey.setText("UKEY");
|
setButtonType(btn_ukey);
|
btn_ukey.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
SwingUtilities.invokeLater(() ->{
|
frmSerialport.getContentPane().removeAll();
|
|
main_TabbedTopPane14.removeAll();
|
//main_TabbedTopPane14.setPreferredSize(new Dimension(100, 80));
|
// main_TabbedTopPane14.add(panel_10);
|
// main_TabbedTopPane14.setLayout(new FlowLayout(FlowLayout.RIGHT,10,10));
|
// btn_back.setSize(100, 100);
|
|
setJTableSelectIndex(CommDevType_UKEY);
|
|
main_TabbedTopPane14.setLayout(new GridBagLayout());
|
//main_TabbedTopPane14.setBackground(Color.yellow);
|
|
GridBagConstraints gbc = new GridBagConstraints();
|
gbc.anchor = GridBagConstraints.EAST; // ÓÒÉÏ½Ç¶ÔÆë
|
gbc.weightx = 1.0; // ʹÓöîÍâ¿Õ¼ä
|
gbc.insets = new Insets(5, 5, 5, 5); // ±ß¾à
|
|
main_TabbedTopPane14.add(panel_10,gbc);
|
|
frmSerialport.getContentPane().add(main_TabbedTopPane14, BorderLayout.NORTH);
|
|
frmSerialport.getContentPane().add(main_TabbedRightPane14, BorderLayout.CENTER);
|
|
setJTableSelectIndex(CommDevType_UKEY);
|
|
mTitle = "UKEYµ÷ÊÔ¹¤¾ß";
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
frmSerialport.getContentPane().revalidate(); // ÖØÐÂÑéÖ¤²¼¾Ö
|
frmSerialport.getContentPane().repaint(); // ÖØ»æÈÝÆ÷
|
});
|
}
|
});
|
|
//panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
|
|
main_TabbedTopPane0 = new JPanel();
|
main_TabbedTopPane0.setLayout(new BoxLayout(main_TabbedTopPane0, BoxLayout.X_AXIS));
|
main_TabbedTopPane1 = new JPanel();
|
main_TabbedTopPane1.setLayout(new BoxLayout(main_TabbedTopPane1, BoxLayout.X_AXIS));
|
main_TabbedTopPane2 = new JPanel();
|
main_TabbedTopPane2.setLayout(new BoxLayout(main_TabbedTopPane2, BoxLayout.X_AXIS));
|
main_TabbedTopPane3 = new JPanel();
|
main_TabbedTopPane3.setLayout(new BoxLayout(main_TabbedTopPane3, BoxLayout.X_AXIS));
|
main_TabbedTopPane4 = new JPanel();
|
main_TabbedTopPane4.setLayout(new BoxLayout(main_TabbedTopPane4, BoxLayout.X_AXIS));
|
main_TabbedTopPane5 = new JPanel();
|
main_TabbedTopPane5.setLayout(new BoxLayout(main_TabbedTopPane5, BoxLayout.X_AXIS));
|
main_TabbedTopPane6 = new JPanel();
|
main_TabbedTopPane6.setLayout(new BoxLayout(main_TabbedTopPane6, BoxLayout.X_AXIS));
|
main_TabbedTopPane7 = new JPanel();
|
main_TabbedTopPane7.setLayout(new BoxLayout(main_TabbedTopPane7, BoxLayout.X_AXIS));
|
main_TabbedTopPane8 = new JPanel();
|
main_TabbedTopPane8.setLayout(new BoxLayout(main_TabbedTopPane8, BoxLayout.X_AXIS));
|
main_TabbedTopPane9 = new JPanel();
|
main_TabbedTopPane9.setLayout(new BoxLayout(main_TabbedTopPane9, BoxLayout.X_AXIS));
|
main_TabbedTopPane10 = new JPanel();
|
main_TabbedTopPane10.setLayout(new BoxLayout(main_TabbedTopPane10, BoxLayout.X_AXIS));
|
main_TabbedTopPane11 = new JPanel();
|
main_TabbedTopPane11.setLayout(new BoxLayout(main_TabbedTopPane11, BoxLayout.X_AXIS));
|
main_TabbedTopPane12 = new JPanel();
|
main_TabbedTopPane12.setLayout(new BoxLayout(main_TabbedTopPane12, BoxLayout.X_AXIS));
|
main_TabbedTopPane13 = new JPanel();
|
main_TabbedTopPane13.setLayout(new BoxLayout(main_TabbedTopPane13, BoxLayout.X_AXIS));
|
main_TabbedTopPane14 = new JPanel();
|
main_TabbedTopPane14.setLayout(new BoxLayout(main_TabbedTopPane14, BoxLayout.X_AXIS));
|
main_TabbedTopPane15 = new JPanel();
|
main_TabbedTopPane15.setLayout(new BoxLayout(main_TabbedTopPane15, BoxLayout.X_AXIS));
|
main_TabbedTopPane16 = new JPanel();
|
main_TabbedTopPane16.setLayout(new BoxLayout(main_TabbedTopPane16, BoxLayout.X_AXIS));
|
|
|
main_TabbedRightPane0 = new JPanel();
|
main_TabbedRightPane0.setLayout(new BorderLayout());
|
main_TabbedRightPane1 = new JPanel();
|
main_TabbedRightPane1.setLayout(new BorderLayout());
|
main_TabbedRightPane2 = new JPanel();
|
main_TabbedRightPane2.setLayout(new BorderLayout());
|
main_TabbedRightPane3 = new JPanel();
|
main_TabbedRightPane3.setLayout(new BorderLayout());
|
main_TabbedRightPane4 = new JPanel();
|
main_TabbedRightPane4.setLayout(new BorderLayout());
|
main_TabbedRightPane5 = new JPanel();
|
main_TabbedRightPane5.setLayout(new BorderLayout());
|
main_TabbedRightPane6 = new JPanel();
|
main_TabbedRightPane6.setLayout(new BorderLayout());
|
main_TabbedRightPane7 = new JPanel();
|
main_TabbedRightPane7.setLayout(new BorderLayout());
|
main_TabbedRightPane8 = new JPanel();
|
main_TabbedRightPane8.setLayout(new BorderLayout());
|
main_TabbedRightPane9 = new JPanel();
|
main_TabbedRightPane9.setLayout(new BorderLayout());
|
main_TabbedRightPane10 = new JPanel();
|
main_TabbedRightPane10.setLayout(new BorderLayout());
|
main_TabbedRightPane11 = new JPanel();
|
main_TabbedRightPane11.setLayout(new BorderLayout());
|
main_TabbedRightPane12 = new JPanel();
|
main_TabbedRightPane12.setLayout(new BorderLayout());
|
main_TabbedRightPane13 = new JPanel();
|
main_TabbedRightPane13.setLayout(new BorderLayout());
|
main_TabbedRightPane14 = new JPanel();
|
main_TabbedRightPane14.setLayout(new BorderLayout());
|
main_TabbedRightPane15 = new JPanel();
|
main_TabbedRightPane15.setLayout(new BorderLayout());
|
main_TabbedRightPane16 = new JPanel();
|
main_TabbedRightPane16.setLayout(new BorderLayout());
|
|
top_panel1 = new JPanel();
|
top_panel1.setLayout(new BoxLayout(top_panel1, BoxLayout.X_AXIS));
|
|
|
String comm_title = "ͨÐŵØÖ· / ²¨ÌØÂÊ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Comm Addr / Bit Rate";
|
}
|
|
JPanel panel_80 = new JPanel();
|
panel_80.setLayout(new GridLayout(0, 1));
|
|
tab_comm_type = new JTabbedPane(JTabbedPane.TOP);
|
//panel_80.add(tab_comm_type);
|
tab_comm_type.add(new JPanel());
|
|
top_panel1.add(panel_80);
|
|
JPanel panel_8 = new JPanel();
|
//panel_8.setBackground(Color.blue);
|
tab_comm_type.addTab("RS485\u901A\u4FE1", null, panel_8, null);
|
panel_8.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u4E32\u53E3\u53F7 / \u6CE2\u7279\u7387", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
panel_80.add(panel_8);
|
|
//panel_8.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 0));
|
panel_8.setLayout(new GridLayout(1,4,0,0));
|
|
btn_renew_commport = new JButton("\u5237\u65B0");
|
panel_8.add(btn_renew_commport);
|
btn_renew_commport.setIcon(new ImageIcon(main_window_computer.class.getResource("/png_16x16/arrow_refresh.png")));
|
btn_renew_commport.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
btn_renew_commport.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì
|
new Thread(()->{
|
CommSerialPort.searchCommPort(cb_commport);
|
if(cb_commport.getItemCount() > 0) {
|
cb_commport.setSelectedIndex(0);
|
}
|
}).start();
|
}
|
});
|
|
cb_commport = new JComboBox<String>();
|
panel_8.add(cb_commport);
|
//cb_commport.setModel(new DefaultComboBoxModel<String>(new String[] {"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "COM10", "COM11", "COM12"}));
|
CommSerialPort.searchCommPort(cb_commport);
|
|
cb_comm_bitrate = new JComboBox();
|
cb_comm_bitrate.setModel(new DefaultComboBoxModel(new String[] {"2400", "4800", "9600", "19200", "38400", "57600", "115200"}));
|
cb_comm_bitrate.setSelectedIndex(2);
|
panel_8.add(cb_comm_bitrate);
|
|
cb_dev_type = new JComboBox();
|
cb_dev_type.setModel(new DefaultComboBoxModel(new String[] {"SAM", "MSP", "MSP_RF", "SWM(\u534E\u82AF\u5A01\u7279)"}));
|
panel_8.add(cb_dev_type);
|
|
// label = new JLabel("");
|
// panel_8.add(label);
|
|
panel_3 = new JPanel();
|
FlowLayout flowLayout = (FlowLayout) panel_3.getLayout();
|
flowLayout.setVgap(0);
|
panel_3.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "IP\u5730\u5740 / \u7AEF\u53E3", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
//tab_comm_type.addTab("\u4EE5\u592A\u7F51\u901A\u4FE1", null, panel_3, null);
|
|
cb_tcp_udp = new JComboBox();
|
//cb_tcp_udp.setEnabled(false);
|
cb_tcp_udp.setModel(new DefaultComboBoxModel(new String[] {"TCP¿Í»§¶Ë", "TCP·þÎñÆ÷"}));
|
panel_3.add(cb_tcp_udp);
|
|
tf_ip_addr = new JTextField();
|
tf_ip_addr.setDocument(new LimitedDocument(16, "0123456789."));
|
//tf_ip_addr.setText("192.168.10.102");
|
tf_ip_addr.setText("192.168.10.79");
|
panel_3.add(tf_ip_addr);
|
tf_ip_addr.setColumns(10);
|
|
tf_ip_port = new JTextField();
|
tf_ip_port.setDocument(new LimitedDocument(6, "0123456789"));
|
tf_ip_port.setText("1025");
|
panel_3.add(tf_ip_port);
|
tf_ip_port.setColumns(10);
|
|
JPanel panel_1 = new JPanel();
|
comm_title = "´®¿ÚºÅ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Comm Port";
|
}
|
panel_1.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u8BBE\u5907\u5730\u5740", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
top_panel1.add(panel_1);
|
if(cb_commport.getItemCount() > 0) {
|
cb_commport.setSelectedIndex(0);
|
}
|
|
comm_title = "Ë¢ÐÂ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Reflesh";
|
}
|
panel_1.setLayout(new GridLayout(0, 3, 0, 0));
|
|
btnNewButton = new JButton("\u4E0A\u4E00\u4E2A");
|
panel_1.add(btnNewButton);
|
btnNewButton.setIcon(new ImageIcon(main_window_computer.class.getResource("/png_16x16/arrow_left.png")));
|
btnNewButton.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
int addr = Integer.parseInt(tf_target_addr.getText());
|
if(addr > 0) {
|
addr -= 1;
|
} else {
|
addr = 255;
|
}
|
tf_target_addr.setText(String.valueOf(addr));
|
}
|
});
|
|
tf_target_addr = new JTextField();
|
tf_target_addr.setHorizontalAlignment(SwingConstants.CENTER);
|
tf_target_addr.setFont(new Font("ËÎÌå", Font.PLAIN, 32));
|
panel_1.add(tf_target_addr);
|
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(4, "0123456789"));
|
tf_target_addr.setText("255");
|
tf_target_addr.setColumns(3);
|
|
btnNewButton_1 = new JButton("\u4E0B\u4E00\u4E2A");
|
panel_1.add(btnNewButton_1);
|
btnNewButton_1.setIcon(new ImageIcon(main_window_computer.class.getResource("/png_16x16/arrow_right.png")));
|
btnNewButton_1.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
int addr = Integer.parseInt(tf_target_addr.getText());
|
if(++addr > 255) {
|
addr = 0;
|
}
|
tf_target_addr.setText(String.valueOf(addr));
|
}
|
});
|
|
JPanel panel_2 = new JPanel();
|
comm_title = "²Ù×÷";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Operation";
|
}
|
panel_2.setBorder(new TitledBorder(null, comm_title, TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
top_panel1.add(panel_2);
|
|
comm_title = "Á¬½Ó";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Connect";
|
}
|
btn_connet = new JButton(comm_title);
|
btn_connet.setIcon(new ImageIcon(main_window_computer.class.getResource("/png_16x16/connect.png")));
|
btn_connet.setFont(new Font("ËÎÌå", Font.PLAIN, 24));
|
btn_connet.setEnabled(true);
|
btn_connet.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
//Ö´Ðнø³Ì,±ÜÃâ´ò¿ª´®¿Úʱ½çÃæ¿¨¶Ù
|
new Thread(()->{
|
main_TabbedPane.setEnabled(false);
|
|
int comm_type = tab_comm_type.getSelectedIndex();
|
btn_connet.setEnabled(false);
|
|
//System.out.println(comm_type);
|
String spname_or_ipaddr;
|
int bitrate_or_ipport = Integer.parseInt((String)cb_comm_bitrate.getSelectedItem());
|
|
if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) {
|
if(cb_commport.getSelectedIndex() < 0) {
|
Toolkit.getDefaultToolkit().beep();
|
JOptionPane.showMessageDialog(frmSerialport, "ÕÒ²»µ½Èκδ®¿Ú!");
|
return;
|
}
|
spname_or_ipaddr = cb_commport.getSelectedItem().toString();
|
} else {
|
try {
|
spname_or_ipaddr = tf_ip_addr.getText().trim();
|
bitrate_or_ipport = Integer.parseInt(tf_ip_port.getText().trim());
|
} catch (NumberFormatException e) {
|
Toolkit.getDefaultToolkit().beep();
|
JOptionPane.showMessageDialog(frmSerialport, "ÇëÊäÈëÕýÈ·µÄIPµØÖ·ºÍ¶Ë¿ÚºÅ!");
|
m_Log.error(e.toString(), e);
|
return;
|
}
|
}
|
|
//ʹÓÃtableÑ¡ÖеÄÁбí
|
int main_DevType = main_TabbedPane.getSelectedIndex();
|
//int main_DevType = CommDevType;
|
if(DebugMode == DebugMode_TYPE_Package) {
|
main_DevType = CommDevType;
|
}
|
|
boolean comm_open_res = true;
|
//System.err.println("main_DevType:"+main_DevType);
|
int monomer_devType = cb_dev_type.getSelectedIndex();
|
if(main_window_computer.CommDevType_MON == main_DevType) {
|
int comm_multy_type = CommSerialPort.mutycomm_Type_Samd09;
|
if(0 == monomer_devType) {
|
comm_multy_type = CommSerialPort.mutycomm_Type_Samd09;
|
} else if(1 == monomer_devType) {
|
comm_multy_type = CommSerialPort.mutycomm_Type_Msp430;
|
} else if(2 == monomer_devType) {
|
comm_multy_type = CommSerialPort.mutycomm_Type_Samd09;
|
} else if(3 == monomer_devType) {
|
comm_multy_type = CommSerialPort.mutycomm_Type_SWM;
|
}
|
|
comm_open_res = panel_mon_base.openCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport,
|
monomer_devType, comm_multy_type, tf_target_addr, m_Log);
|
} else if(main_window_computer.CommDevType_CURR == main_DevType) {
|
comm_open_res = panel_Curr_Module.openCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport,
|
monomer_devType, CommSerialPort.mutycomm_Type_Samd09, tf_target_addr, m_Log);
|
} else if(main_window_computer.CommDevType_GROUPVOL == main_DevType) {
|
comm_open_res = panel_groupVol_Module.openCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport,
|
monomer_devType, CommSerialPort.mutycomm_Type_Samd09, tf_target_addr, m_Log);
|
} else if(main_window_computer.CommDevType_FCF651VOL == main_DevType) {
|
comm_open_res = panel_fcf651Vol_Module.openCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport,
|
monomer_devType, CommSerialPort.mutycomm_Type_Samd09, tf_target_addr);
|
} else if(main_window_computer.CommDevType_ZDHJ == main_DevType) {
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_ZDHJ_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
} else if(main_window_computer.CommDevType_FBS9100 == main_DevType) {
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_FBS9100_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
} else if(main_window_computer.CommDevType_NTM == main_DevType) {
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_NTM_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
} else if(main_window_computer.CommDevType_LoraTest == main_DevType) {
|
comm_open_res = panel_LoraTest_base.openCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport, m_Log);
|
} else if(main_window_computer.CommDevType_BYBB == main_DevType) {
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_bybb_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
} else if(main_window_computer.CommDevType_FBO4830 == main_DevType) {
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_fbo4830_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
} else if(main_window_computer.CommDevType_BTS4810 == main_DevType) {
|
if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) {
|
//´®¿ÚͨÐÅ
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_bts4810_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
}else if(SPCommMon.COMM_PORT_TYPE_Socket == comm_type){
|
//¿Í»§¶ËͨÐÅ
|
int tcp_type = cb_tcp_udp.getSelectedIndex();
|
System.out.println("tcp_type:" + tcp_type);
|
}
|
} else if(main_window_computer.CommDevType_SwitchDevice == main_DevType) {
|
if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) {
|
//´®¿ÚͨÐÅ
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_switchdevice_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
}else if(SPCommMon.COMM_PORT_TYPE_Socket == comm_type){
|
//¿Í»§¶ËͨÐÅ
|
int tcp_type = cb_tcp_udp.getSelectedIndex();
|
System.out.println("tcp_type:" + tcp_type);
|
}
|
} else if(main_window_computer.CommDevType_DummyLoad == main_DevType) {
|
if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) {
|
//´®¿ÚͨÐÅ
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_dummyload_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
}else if(SPCommMon.COMM_PORT_TYPE_Socket == comm_type){
|
//¿Í»§¶ËͨÐÅ
|
int tcp_type = cb_tcp_udp.getSelectedIndex();
|
System.out.println("tcp_type:" + tcp_type);
|
}
|
} else if(main_window_computer.CommDevType_SIMPOWER == main_DevType) {
|
if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) {
|
//´®¿ÚͨÐÅ
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_power_page_base.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
}else if(SPCommMon.COMM_PORT_TYPE_Socket == comm_type){
|
//¿Í»§¶ËͨÐÅ
|
int tcp_type = cb_tcp_udp.getSelectedIndex();
|
System.out.println("tcp_type:" + tcp_type);
|
}
|
} else if(main_window_computer.CommDevType_ICA_200KW == main_DevType) {
|
if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) {
|
//´®¿ÚͨÐÅ
|
int dev_addr = Integer.parseInt(tf_target_addr.getText().trim());
|
comm_open_res = panel_ica_600kw_page.openCommPort(comm_type, spname_or_ipaddr,
|
bitrate_or_ipport, dev_addr, m_Log);
|
}else if(SPCommMon.COMM_PORT_TYPE_Socket == comm_type){
|
//¿Í»§¶ËͨÐÅ
|
int tcp_type = cb_tcp_udp.getSelectedIndex();
|
System.out.println("tcp_type:" + tcp_type);
|
}
|
|
}
|
|
if(true == comm_open_res) {
|
CommDevType = main_DevType;
|
|
main_TabbedPane.setEnabled(false);
|
tf_target_addr.setEditable(false);
|
btn_renew_commport.setEnabled(false);
|
cb_commport.setEnabled(false);
|
btn_connet.setEnabled(false);
|
btn_break.setEnabled(true);
|
cb_comm_bitrate.setEnabled(false);
|
cb_dev_type.setEnabled(false);
|
|
mMainFormTimer.start();
|
|
tf_ip_addr.setEnabled(false);
|
tf_ip_port.setEnabled(false);
|
cb_tcp_udp.setEnabled(false);
|
tab_comm_type.setEnabled(false);
|
} else {
|
main_TabbedPane.setEnabled(true);
|
btn_connet.setEnabled(true);
|
|
Toolkit.getDefaultToolkit().beep();
|
JOptionPane.showMessageDialog(frmSerialport, spname_or_ipaddr + "²»´æÔÚ»ò±»ÆäËûÓ¦ÓóÌÐòÕ¼ÓÃ!");
|
}
|
}).start();
|
}
|
});
|
panel_2.setLayout(new GridLayout(0, 2, 0, 0));
|
panel_2.add(btn_connet);
|
|
comm_title = "¶Ï¿ª";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
comm_title = "Break";
|
}
|
btn_break = new JButton(comm_title);
|
btn_break.setIcon(new ImageIcon(main_window_computer.class.getResource("/png_16x16/disconnect.png")));
|
btn_break.setFont(new Font("ËÎÌå", Font.PLAIN, 24));
|
panel_2.add(btn_break);
|
btn_break.setEnabled(false);
|
btn_break.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
mMainFormTimer.stop();
|
if(null != panel_mon_base) {
|
panel_mon_base.closeCommPort();
|
}
|
if(null != panel_Curr_Module) {
|
panel_Curr_Module.closeCommPort();
|
}
|
if(null != panel_groupVol_Module) {
|
panel_groupVol_Module.closeCommPort();
|
}
|
if(null != panel_fcf651Vol_Module) {
|
panel_fcf651Vol_Module.closeCommPort();
|
}
|
if(null != panel_ZDHJ_base) {
|
panel_ZDHJ_base.closeCommPort();
|
}
|
if(null != panel_FBS9100_base) {
|
panel_FBS9100_base.closeCommPort();
|
panel_FBS9100_base.setButttonState(false);
|
}
|
if(null != panel_NTM_base) {
|
panel_NTM_base.closeCommPort();
|
}
|
if(null != panel_LoraTest_base) {
|
panel_LoraTest_base.closeCommPort();
|
}
|
if(null != panel_bybb_base) {
|
panel_bybb_base.closeCommPort();
|
}
|
if(null != panel_bybb_base) {
|
panel_fbo4830_base.closeCommPort();
|
}
|
if(null != panel_bts4810_base) {
|
panel_bts4810_base.closeCommPort();
|
}
|
if(null != panel_switchdevice_base) {
|
panel_switchdevice_base.closeCommPort();
|
}
|
if(null != panel_dummyload_base) {
|
panel_dummyload_base.closeCommPort();
|
}
|
if(null != panel_power_page_base) {
|
panel_power_page_base.closeCommPort();
|
}
|
if(null != panel_ica_600kw_page) {
|
panel_ica_600kw_page.closeCommPort();
|
}
|
tf_target_addr.setEditable(true);
|
btn_renew_commport.setEnabled(true);
|
cb_commport.setEnabled(true);
|
btn_connet.setEnabled(true);
|
btn_break.setEnabled(false);
|
cb_dev_type.setEnabled(true);
|
cb_comm_bitrate.setEnabled(true);
|
|
panel_3.setEnabled(true);
|
tab_comm_type.setEnabled(true);
|
tf_ip_addr.setEnabled(true);
|
tf_ip_port.setEnabled(true);
|
cb_tcp_udp.setEnabled(true);
|
|
if((LANG_TYPE_EN == LANG_TYPE)/* || (1 == APP_ZDHJ_ONLY)*/) {
|
//main_TabbedPane.setSelectedIndex(1);
|
main_TabbedPane.setEnabled(false);
|
} else {
|
main_TabbedPane.setEnabled(true);
|
}
|
}
|
});
|
|
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"), "\u901A\u4FE1\u8BA1\u6570(TX/RX)", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
top_panel1.add(panel_9);
|
panel_9.setLayout(new GridLayout(0, 1, 0, 0));
|
|
|
panel_10.setLayout(new GridLayout(0, 1, 20, 20));
|
panel_10.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
panel_10.setPreferredSize(new Dimension(140, 80));
|
|
panel_10.add(btn_back);
|
//btn_back.setHorizontalAlignment(SwingConstants.CENTER);
|
|
top_panel1.add(panel_10);
|
|
|
tf_txcnt = new JTextField();
|
tf_txcnt.setFont(new Font("ËÎÌå", Font.PLAIN, 16));
|
panel_9.add(tf_txcnt);
|
tf_txcnt.setColumns(12);
|
|
tf_rxcnt = new JTextField();
|
tf_rxcnt.setFont(new Font("ËÎÌå", Font.PLAIN, 16));
|
panel_9.add(tf_rxcnt);
|
tf_rxcnt.setColumns(12);
|
|
main_TabbedPane = new JTabbedPane(JTabbedPane.LEFT);
|
main_TabbedPane.setFont(new Font("ËÎÌå", Font.PLAIN, 20));
|
main_TabbedPane.addChangeListener(new ChangeListener() {
|
public void stateChanged(ChangeEvent arg0) {
|
System.out.println("¼àÌýµ½Èí¼þÇл»£º" + main_TabbedPane.getSelectedIndex() + " CommDevType:" + CommDevType);
|
|
if (DebugMode_TYPE_Screen == DebugMode /* || DebugMode_TYPE_Package == DebugMode */ ) {
|
//ÏÔʾÆÁģʽʱ»á³öÏÖÍ·²¿×é¼þÏûʧÎÊÌâ,Ìáǰ½áÊø
|
return;
|
}
|
|
int tab_index = main_TabbedPane.getSelectedIndex();
|
System.out.println("tab_index:"+tab_index);
|
if(tab_index >=0 && tab_index < tabbedTopPanes.size()) {
|
JPanel topPanel = tabbedTopPanes.get(tab_index);
|
//System.out.println("topPanel:"+topPanel);
|
if(topPanel != null) {
|
topPanel.removeAll();
|
topPanel.add(top_panel1);
|
}
|
}
|
|
|
// if(CommDevType_MON == tab_index) {
|
// main_TabbedTopPane0.removeAll();
|
// main_TabbedTopPane0.add(top_panel1);
|
// }else if(CommDevType_CURR == tab_index) {
|
// main_TabbedTopPane1.removeAll();
|
// main_TabbedTopPane1.add(top_panel1);
|
// }else if(CommDevType_GROUPVOL == tab_index) {
|
// main_TabbedTopPane2.removeAll();
|
// main_TabbedTopPane2.add(top_panel1);
|
// }else if(CommDevType_FCF651VOL == tab_index) {
|
// main_TabbedTopPane3.removeAll();
|
// main_TabbedTopPane3.add(top_panel1);
|
// }else if(CommDevType_ZDHJ == tab_index) {
|
// main_TabbedTopPane4.removeAll();
|
// main_TabbedTopPane4.add(top_panel1);
|
// }else if(CommDevType_FBS9100 == tab_index) {
|
// main_TabbedTopPane5.removeAll();
|
// main_TabbedTopPane5.add(top_panel1);
|
// }else if(CommDevType_NTM == tab_index) {
|
// main_TabbedTopPane6.removeAll();
|
// main_TabbedTopPane6.add(top_panel1);
|
// }else if(CommDevType_LoraTest == tab_index) {
|
// main_TabbedTopPane7.removeAll();
|
// main_TabbedTopPane7.add(top_panel1);
|
// }else if(CommDevType_BYBB == tab_index) {
|
// main_TabbedTopPane8.removeAll();
|
// main_TabbedTopPane8.add(top_panel1);
|
// }else if(CommDevType_FBO4830 == tab_index) {
|
// main_TabbedTopPane9.removeAll();
|
// main_TabbedTopPane9.add(top_panel1);
|
// }else if(CommDevType_BTS4810 == tab_index) {
|
// main_TabbedTopPane10.removeAll();
|
// main_TabbedTopPane10.add(top_panel1);
|
// }else if(CommDevType_SwitchDevice == tab_index) {
|
// main_TabbedTopPane11.removeAll();
|
// main_TabbedTopPane11.add(top_panel1);
|
// }else if(CommDevType_DummyLoad == tab_index) {
|
// main_TabbedTopPane12.removeAll();
|
// main_TabbedTopPane12.add(top_panel1);
|
// }
|
|
}
|
});
|
|
|
frmSerialport.getContentPane().add(main_TabbedPane, BorderLayout.CENTER);
|
|
int jtable_index = 0;
|
//main_TabbedPane.setUI(new MyTabbedPaneUI());
|
//=======================================================================//
|
if(APP_FBS9600_MON_EN) {
|
CommDevType_MON = jtable_index++;
|
tabbedRightPanes.add(main_TabbedRightPane0);
|
tabbedTopPanes.add(main_TabbedTopPane0);
|
|
panel_mon_base = new module_mon_page();
|
String dt_title = "µ¥ÌåÄ£¿é";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
dt_title = "Mon Module";
|
}
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(dt_title, new JPanel());
|
}else {
|
main_TabbedPane.add(dt_title, main_TabbedRightPane0);
|
main_TabbedPane.setIconAt(CommDevType_MON, new ImageIcon(main_window_computer.class.getResource("/png_16x16/application.png")));
|
}
|
//main_TabbedPane.add(dt_title, panel_mon_base);
|
|
main_TabbedRightPane0.add(main_TabbedTopPane0,BorderLayout.NORTH);
|
main_TabbedRightPane0.add(panel_mon_base,BorderLayout.CENTER);
|
|
pre_panel.add(btn_mon);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
//=======================================================================//
|
if(APP_FBS9600_CURR_EN) {
|
CommDevType_CURR = jtable_index++;
|
|
panel_Curr_Module = new module_curr_page();
|
String Curr_Module_title = "µçÁ÷Ä£¿é";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
Curr_Module_title = "Curr Module";
|
}
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(Curr_Module_title, new JPanel());
|
}else {
|
//main_TabbedPane.add(Curr_Module_title, panel_Curr_Module);
|
main_TabbedPane.add(Curr_Module_title, main_TabbedRightPane1);
|
main_TabbedPane.setIconAt(CommDevType_CURR, new ImageIcon(main_window_computer.class.getResource("/png_16x16/application_link.png")));
|
}
|
|
main_TabbedRightPane1.add(main_TabbedTopPane1,BorderLayout.NORTH);
|
main_TabbedRightPane1.add(panel_Curr_Module,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane1);
|
tabbedRightPanes.add(main_TabbedRightPane1);
|
|
pre_panel.add(btn_curr);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
//=======================================================================//
|
if(APP_FBS9600_GVOL_EN) {
|
CommDevType_GROUPVOL = jtable_index++;
|
|
panel_groupVol_Module = new module_vol_page();
|
String vol_Module_title = "×éѹģ¿é";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
vol_Module_title = "GroupVol Module";
|
}
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(vol_Module_title, new JPanel());
|
}else {
|
// main_TabbedPane.add(vol_Module_title, panel_groupVol_Module);
|
main_TabbedPane.add(vol_Module_title, main_TabbedRightPane2);
|
main_TabbedPane.setIconAt(CommDevType_GROUPVOL, new ImageIcon(main_window_computer.class.getResource("/png_16x16/application_lightning.png")));
|
}
|
|
main_TabbedRightPane2.add(main_TabbedTopPane2,BorderLayout.NORTH);
|
main_TabbedRightPane2.add(panel_groupVol_Module,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane2);
|
tabbedRightPanes.add(main_TabbedRightPane2);
|
|
pre_panel.add(btn_groupvol);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_FCF_GVOL_EN) {
|
CommDevType_FCF651VOL = jtable_index++;
|
|
panel_fcf651Vol_Module = new FCF651_groupvol_page();
|
String vol_Module_title = "FCF×éѹ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
vol_Module_title = "FCF651 GroupVol";
|
}
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(vol_Module_title, new JPanel());
|
}else {
|
main_TabbedPane.add(vol_Module_title, main_TabbedRightPane3);
|
// main_TabbedPane.add(vol_Module_title, panel_fcf651Vol_Module);
|
main_TabbedPane.setIconAt(CommDevType_FCF651VOL, new ImageIcon(main_window_computer.class.getResource("/png_16x16/application_lightning.png")));
|
}
|
|
main_TabbedRightPane3.add(main_TabbedTopPane3,BorderLayout.NORTH);
|
main_TabbedRightPane3.add(panel_fcf651Vol_Module,BorderLayout.CENTER);
|
|
|
tabbedTopPanes.add(main_TabbedTopPane3);
|
tabbedRightPanes.add(main_TabbedRightPane3);
|
|
pre_panel.add(btn_fcf651vol);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
//======================================================================//
|
if(APP_FBS9600_ZDHJ_EN) {
|
CommDevType_ZDHJ = jtable_index++;
|
|
panel_ZDHJ_base = new zdhj_page_base();
|
String zdhj_title = "»ã¼¯Ä£¿é";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
zdhj_title = "Collect Module";
|
}
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(zdhj_title, new JPanel());
|
}else {
|
main_TabbedPane.add(zdhj_title, main_TabbedRightPane4);
|
// main_TabbedPane.add(zdhj_title, panel_ZDHJ_base);
|
main_TabbedPane.setIconAt(CommDevType_ZDHJ, new ImageIcon(main_window_computer.class.getResource("/png_16x16/application_view_tile.png")));
|
}
|
|
main_TabbedRightPane4.add(main_TabbedTopPane4,BorderLayout.NORTH);
|
main_TabbedRightPane4.add(panel_ZDHJ_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane4);
|
tabbedRightPanes.add(main_TabbedRightPane4);
|
|
pre_panel.add(btn_zdhj);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
//======================================================================//
|
if(APP_BTSM_EN) {
|
CommDevType_FBS9100 = jtable_index++;
|
|
panel_FBS9100_base = new bts_page_base();
|
String fbs9100_title = "BTSÖ÷¿Ø";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
fbs9100_title = "BTS Module";
|
}
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(fbs9100_title, new JPanel());
|
}else {
|
main_TabbedPane.add(fbs9100_title, main_TabbedRightPane5);
|
// main_TabbedPane.add(fbs9100_title, panel_FBS9100_base);
|
main_TabbedPane.setIconAt(CommDevType_FBS9100, new ImageIcon(main_window_computer.class.getResource("/png_16x16/application_home.png")));
|
}
|
|
main_TabbedRightPane5.add(main_TabbedTopPane5,BorderLayout.NORTH);
|
main_TabbedRightPane5.add(panel_FBS9100_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane5);
|
tabbedRightPanes.add(main_TabbedRightPane5);
|
|
pre_panel.add(btn_fbs9100);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
//======================================================================//
|
if(APP_NTM_EN) {
|
CommDevType_NTM = jtable_index++;
|
|
String ntm_title = "NT·ÅµçÒÇ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
ntm_title = "NT Tester";
|
}
|
panel_NTM_base = new ntm_page_base(m_Log);
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(ntm_title, new JPanel());
|
}else {
|
main_TabbedPane.add(ntm_title, main_TabbedRightPane6);
|
// main_TabbedPane.add(ntm_title, panel_NTM_base);
|
main_TabbedPane.setIconAt(CommDevType_NTM, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
|
main_TabbedRightPane6.add(main_TabbedTopPane6,BorderLayout.NORTH);
|
main_TabbedRightPane6.add(panel_NTM_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane6);
|
tabbedRightPanes.add(main_TabbedRightPane6);
|
|
pre_panel.add(btn_ntm);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
//======================================================================//
|
if(APP_NTM_LORA_EN) {
|
CommDevType_LoraTest = jtable_index++;
|
|
String loratest_title = "Lora²âÊÔ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
loratest_title = "NT Tester";
|
}
|
panel_LoraTest_base = new loratester_page_base(m_Log);
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(loratest_title, new JPanel());
|
}else {
|
main_TabbedPane.add(loratest_title, main_TabbedRightPane7);
|
// main_TabbedPane.add(loratest_title, panel_LoraTest_base);
|
main_TabbedPane.setIconAt(CommDevType_LoraTest, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane7.add(main_TabbedTopPane7,BorderLayout.NORTH);
|
main_TabbedRightPane7.add(panel_LoraTest_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane7);
|
tabbedRightPanes.add(main_TabbedRightPane7);
|
|
pre_panel.add(btn_lora);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
//======================================================================//
|
if(APP_BYBB_EN) {
|
CommDevType_BYBB = jtable_index++;
|
|
String bybb_title = "BYBB²âÊÔ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
bybb_title = "bybb Tester";
|
}
|
panel_bybb_base = new bybb_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane8);
|
// main_TabbedPane.add(bybb_title, panel_bybb_base);
|
main_TabbedPane.setIconAt(CommDevType_BYBB, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane8.add(main_TabbedTopPane8,BorderLayout.NORTH);
|
main_TabbedRightPane8.add(panel_bybb_base,BorderLayout.CENTER);
|
if(APP_BYBB_EN) {
|
tf_ip_port.setText("6600");
|
//tab_comm_type.setSelectedIndex(1);
|
//tab_comm_type.setEnabled(false);
|
//main_TabbedPane.setSelectedIndex(main_window_simulator.CommDevType_BYBB);
|
//main_TabbedPane.setEnabled(false);
|
}
|
|
|
tabbedTopPanes.add(main_TabbedTopPane8);
|
tabbedRightPanes.add(main_TabbedRightPane8);
|
|
pre_panel.add(btn_bybb);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
if(APP_FBO4830_EN) {
|
CommDevType_FBO4830 = jtable_index++;
|
|
String bybb_title = "FBO4830²âÊÔ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
bybb_title = "bybb Tester";
|
}
|
panel_fbo4830_base = new fbo4830_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane9);
|
// main_TabbedPane.add(bybb_title, panel_fbo4830_base);
|
main_TabbedPane.setIconAt(CommDevType_FBO4830, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane9.add(main_TabbedTopPane9,BorderLayout.NORTH);
|
main_TabbedRightPane9.add(panel_fbo4830_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane9);
|
tabbedRightPanes.add(main_TabbedRightPane9);
|
|
if(APP_FBO4830_EN) {
|
tf_ip_port.setText("4830");
|
//tab_comm_type.setSelectedIndex(1);
|
//tab_comm_type.setEnabled(false);
|
//main_TabbedPane.setSelectedIndex(main_window_simulator.CommDevType_FBO4830);
|
//main_TabbedPane.setEnabled(false);
|
}
|
pre_panel.add(btn_fbo4830);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_BTS4810_EN) {
|
CommDevType_BTS4810 = jtable_index++;
|
|
String bybb_title = "BTS4810Ä£Äâ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
bybb_title = "bybb Tester";
|
}
|
panel_bts4810_base = new bts4810_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane10);
|
// main_TabbedPane.add(bybb_title, panel_bts4810_base);
|
main_TabbedPane.setIconAt(CommDevType_BTS4810, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane10.add(main_TabbedTopPane10,BorderLayout.NORTH);
|
main_TabbedRightPane10.add(panel_bts4810_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane10);
|
tabbedRightPanes.add(main_TabbedRightPane10);
|
|
if(APP_BTS4810_EN) {
|
tf_ip_port.setText("9101");
|
|
cb_comm_bitrate.setSelectedIndex(6);
|
|
tab_comm_type.setSelectedIndex(0);
|
tab_comm_type.setEnabled(false);
|
//main_TabbedPane.setSelectedIndex(main_window_simulator.CommDevType_FBO4830);
|
//main_TabbedPane.setEnabled(false);
|
}
|
pre_panel.add(btn_bts4810);
|
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_SwitchDevice_EN) {
|
CommDevType_SwitchDevice = jtable_index++;
|
|
String bybb_title = "Çл»×°ÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
bybb_title = "bybb Tester";
|
}
|
panel_switchdevice_base = new SwitchDevice_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane11);
|
// main_TabbedPane.add(bybb_title, panel_switchdevice_base);
|
main_TabbedPane.setIconAt(CommDevType_SwitchDevice, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane11.add(main_TabbedTopPane11,BorderLayout.NORTH);
|
main_TabbedRightPane11.add(panel_switchdevice_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane11);
|
tabbedRightPanes.add(main_TabbedRightPane11);
|
|
pre_panel.add(btn_switch);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_DummyLoad_EN) {
|
CommDevType_DummyLoad = jtable_index++;
|
|
String bybb_title = "¼Ù¸ºÔØ×°ÖÃ";
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
bybb_title = "bybb Tester";
|
}
|
panel_dummyload_base = new DummyLoad_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane12);
|
// main_TabbedPane.add(bybb_title, panel_dummyload_base);
|
main_TabbedPane.setIconAt(CommDevType_DummyLoad, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane12.add(main_TabbedTopPane12,BorderLayout.NORTH);
|
main_TabbedRightPane12.add(panel_dummyload_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane12);
|
tabbedRightPanes.add(main_TabbedRightPane12);
|
|
pre_panel.add(btn_load);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_IEC61850_EN) {
|
CommDevType_IEC61850 = jtable_index++;
|
|
String bybb_title = "IEC61850";
|
|
panel_iec61850_base = new iec61850_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane13);
|
// main_TabbedPane.add(bybb_title, panel_dummyload_base);
|
main_TabbedPane.setIconAt(CommDevType_IEC61850, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
//main_TabbedRightPane12.add(main_TabbedTopPane12,BorderLayout.NORTH);
|
main_TabbedRightPane13.add(panel_iec61850_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane13);
|
tabbedRightPanes.add(main_TabbedRightPane13);
|
|
pre_panel.add(btn_iec61850);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_UKEY_EN) {
|
CommDevType_UKEY = jtable_index++;
|
|
String bybb_title = "UEKY";
|
|
panel_ueky_page_base = new ukeycfg_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane14);
|
// main_TabbedPane.add(bybb_title, panel_dummyload_base);
|
main_TabbedPane.setIconAt(CommDevType_UKEY, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
//main_TabbedRightPane14.add(main_TabbedTopPane14,BorderLayout.NORTH);
|
main_TabbedRightPane14.add(panel_ueky_page_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane14);
|
tabbedRightPanes.add(main_TabbedRightPane14);
|
|
pre_panel.add(btn_ukey);
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
|
if(APP_SIMPOWER_EN) {
|
CommDevType_SIMPOWER = jtable_index++;
|
|
String bybb_title = "¼«¼ò»¯µçÔ´";
|
|
panel_power_page_base = new power_page_base();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane15);
|
// main_TabbedPane.add(bybb_title, panel_dummyload_base);
|
main_TabbedPane.setIconAt(CommDevType_SIMPOWER, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
}
|
|
main_TabbedRightPane15.add(main_TabbedTopPane15,BorderLayout.NORTH);
|
main_TabbedRightPane15.add(panel_power_page_base,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane15);
|
tabbedRightPanes.add(main_TabbedRightPane15);
|
|
if(CommDevType == CommDevType_SIMPOWER) {
|
//µ±Ä¬ÈÏÊǼ«¼ò»¯µçԴʱ
|
cb_comm_bitrate.setSelectedIndex(2); //ĬÈϲ¨ÌØÂÊ9600
|
tf_target_addr.setText("1"); //ĬÈÏÉ豸µØÖ·1
|
|
}
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
if(APP_ICA_200KW_EN) {
|
CommDevType_ICA_200KW = jtable_index++;
|
|
String bybb_title = "IAC-600KW";
|
|
panel_ica_600kw_page = new iac_600kw_page();
|
|
if(DebugMode == DebugMode_TYPE_Screen) {
|
main_TabbedPane.add(bybb_title, new JPanel());
|
}else {
|
main_TabbedPane.add(bybb_title, main_TabbedRightPane16);
|
main_TabbedPane.setIconAt(CommDevType_ICA_200KW, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png")));
|
if(DebugMode == DebugMode_TYPE_Package) {
|
//ÉèÖÃÈí¼þ´ò¿ªÊ±Ä¬ÈÏÈí¼þÈ«ÆÁ
|
frmSerialport.setExtendedState(JFrame.MAXIMIZED_BOTH);
|
}
|
}
|
|
main_TabbedRightPane16.add(main_TabbedTopPane16,BorderLayout.NORTH);
|
main_TabbedRightPane16.add(panel_ica_600kw_page,BorderLayout.CENTER);
|
|
tabbedTopPanes.add(main_TabbedTopPane16);
|
tabbedRightPanes.add(main_TabbedRightPane16);
|
|
if(CommDevType == CommDevType_ICA_200KW) {
|
//µ±Ä¬ÈÏÊÇICA-200KW
|
cb_comm_bitrate.setSelectedIndex(6); //ĬÈϲ¨ÌØÂÊ9600
|
tf_target_addr.setText("1"); //ĬÈÏÉ豸µØÖ·1
|
|
}
|
}else {
|
pre_panels.add(new JPanel());
|
}
|
|
|
if(pre_panels.size() > 0) {
|
for (JPanel jPanel : pre_panels) {
|
pre_panel.add(jPanel);
|
}
|
}
|
/**************************************************************************/
|
if((LANG_TYPE_EN == LANG_TYPE)/* || (1 == APP_ZDHJ_ONLY)*/) {
|
//main_TabbedPane.setSelectedIndex(1);
|
main_TabbedPane.setEnabled(false);
|
}
|
/**************************************************************************/
|
//´ò°üģʽÅжÏÑ¡Ïî--Òþ²Ø×ó²àÑ¡¿¨²¢ÉèÖõ÷ÊÔÈí¼þÃû³Æ
|
if(CommDevType >= CommDevType_MON && CommDevType <= CommDevType_MAX) {
|
|
System.out.println("CommDevType$$$$$$$$$$$--"+CommDevType);
|
|
//Ñ¡ÖÐĬÈÏÑ¡Ï
|
main_TabbedPane.setSelectedIndex(CommDevType);
|
|
int tab_index = main_TabbedPane.getSelectedIndex();
|
|
System.out.println("tab_index$$$$$$$$$$$--"+tab_index);
|
|
if(DebugMode == DebugMode_TYPE_Package) {
|
//´ò°üģʽʱ »á³öÏÖ main_TabbedPane.getSelectedIndex Óë CommDevType ²»Ò»ÖÂ
|
tab_index = CommDevType;
|
|
//ÒÆ³ý·µ»Ø°´Å¥
|
top_panel1.remove(panel_10);
|
|
main_TabbedPane.setVisible(false);
|
JPanel topPanel = tabbedTopPanes.get(tab_index);
|
JPanel rightPanel = tabbedRightPanes.get(tab_index);
|
|
System.out.println("66666666666"+main_TabbedPane.getSelectedIndex());
|
//System.err.println(main_TabbedTopPane0+"==="+topPanel + "=="+ rightPanel);
|
if(topPanel != null && rightPanel != null) {
|
|
frmSerialport.getContentPane().removeAll();
|
|
System.out.println("333:"+main_TabbedPane.getSelectedIndex()+"\tCommDevType"+CommDevType);
|
|
frmSerialport.getContentPane().add(topPanel, BorderLayout.NORTH);
|
|
frmSerialport.getContentPane().add(rightPanel, BorderLayout.CENTER);
|
System.out.println("777:"+main_TabbedPane.getSelectedIndex()+"\tCommDevType"+CommDevType);
|
|
frmSerialport.setMinimumSize(new Dimension(1030, 640));
|
|
System.out.println("222:"+main_TabbedPane.getSelectedIndex()+"\tCommDevType"+CommDevType);
|
}
|
if(CommDevType_MON == CommDevType){
|
//frmSerialport.getContentPane().add(panel_mon_base, BorderLayout.CENTER);
|
}else if(CommDevType_CURR == CommDevType){
|
//frmSerialport.getContentPane().add(panel_Curr_Module, BorderLayout.CENTER);
|
}else if(CommDevType_GROUPVOL == CommDevType){
|
//frmSerialport.getContentPane().add(panel_groupVol_Module, BorderLayout.CENTER);
|
}else if(CommDevType_FCF651VOL == CommDevType){
|
//frmSerialport.getContentPane().add(panel_fcf651Vol_Module, BorderLayout.CENTER);
|
}else if(CommDevType_ZDHJ == CommDevType){
|
//panel_3.setVisible(false);
|
//tab_comm_type.remove(panel_3);
|
|
//frmSerialport.getContentPane().add(panel_ZDHJ_base, BorderLayout.CENTER);
|
}else if( CommDevType_FBS9100 == CommDevType){
|
//frmSerialport.getContentPane().add(panel_FBS9100_base, BorderLayout.CENTER);
|
}else if(CommDevType_NTM == CommDevType){
|
//frmSerialport.getContentPane().add(panel_NTM_base, BorderLayout.CENTER);
|
}else if(CommDevType_LoraTest == CommDevType){
|
//frmSerialport.getContentPane().add(panel_LoraTest_base, BorderLayout.CENTER);
|
}else if( CommDevType_BYBB == CommDevType){
|
//frmSerialport.getContentPane().add(panel_bybb_base, BorderLayout.CENTER);
|
}else if(CommDevType_FBO4830 == CommDevType){
|
//frmSerialport.getContentPane().add(panel_fbo4830_base, BorderLayout.CENTER);
|
}else if( CommDevType_BTS4810 == CommDevType){
|
mTitle = "BTS4810É豸ģÄ⹤¾ß";
|
//frmSerialport.getContentPane().add(panel_bts4810_base, BorderLayout.CENTER);
|
}else if( CommDevType_SwitchDevice == CommDevType){
|
tf_target_addr.setText("1");
|
cb_comm_bitrate.setSelectedIndex(2);
|
|
mTitle = "È«¹¦ÄÜÇл»×°Öõ÷ÊÔ¹¤¾ß";
|
//frmSerialport.getContentPane().add(panel_switchdevice_base, BorderLayout.CENTER);
|
}else if(CommDevType_DummyLoad == CommDevType){
|
tf_target_addr.setText("1");
|
cb_comm_bitrate.setSelectedIndex(2);
|
|
mTitle = "È«¹¦ÄܼٸºÔØ×°Öõ÷ÊÔ¹¤¾ß";
|
//frmSerialport.getContentPane().add(panel_dummyload_base, BorderLayout.CENTER);
|
}else if(CommDevType_UKEY == CommDevType) {
|
mTitle = "UKEYµ÷ÊÔ¹¤¾ß";
|
}else if(CommDevType_SIMPOWER == CommDevType) {
|
mTitle = "¼«¼ò»¯µçÔ´µ÷ÊÔ¹¤¾ß";
|
|
//System.out.println("Í·²¿ÈÝÆ÷£º"+top_panel1.getParent());
|
//¼«¼ò»¯µçÔ´
|
cb_comm_bitrate.setSelectedIndex(2);
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
|
}else if(CommDevType_IEC61850 == CommDevType) {
|
frmSerialport.getContentPane().remove(topPanel);
|
}else if(CommDevType_ICA_200KW == CommDevType) {
|
frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH);
|
mTitle = "ICA-600KWµ÷ÊÔ¹¤¾ß";
|
}
|
} else if(DebugMode == DebugMode_TYPE_Screen){
|
//btn_back = null;
|
|
frmSerialport.getContentPane().removeAll();
|
frmSerialport.getContentPane().add(pre_panel);
|
} else {
|
System.err.println("µ÷ÊÔģʽÖÐ....");
|
top_panel1.remove(panel_10);
|
}
|
}
|
System.out.println("444:"+main_TabbedPane.getSelectedIndex()+"\tCommDevType"+CommDevType);
|
|
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
if(LANG_TYPE_EN == LANG_TYPE) {
|
frmSerialport.setTitle(this.mTitle + "_EN" + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
}
|
|
/**************************************************************************/
|
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{
|
|
frmSerialport.setTitle(mTitle+ mVerSioin + " " + Com.get_DTF(new Date(), Com.DTF_YMDhms));
|
|
int main_DevType = main_TabbedPane.getSelectedIndex();
|
if(DebugMode == DebugMode_TYPE_Package) {
|
main_DevType = CommDevType;
|
}
|
|
if(CommDevType_MON == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_mon_base.Comm_Mon.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_mon_base.Comm_Mon.comm_rx_cnt));
|
|
panel_mon_base.updateData();
|
} else if(CommDevType_CURR == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_Curr_Module.Comm_Curr.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_Curr_Module.Comm_Curr.comm_rx_cnt));
|
|
panel_Curr_Module.updateData();
|
} else if(CommDevType_GROUPVOL == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_groupVol_Module.Comm_Vol.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_groupVol_Module.Comm_Vol.comm_rx_cnt));
|
|
panel_groupVol_Module.updateData();
|
} else if(CommDevType_FCF651VOL == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_fcf651Vol_Module.Comm_Vol.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_fcf651Vol_Module.Comm_Vol.comm_rx_cnt));
|
|
panel_fcf651Vol_Module.updateData();
|
} else if(CommDevType_ZDHJ == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_ZDHJ_base.Comm_ZDHJ.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_ZDHJ_base.Comm_ZDHJ.comm_rx_cnt));
|
|
panel_ZDHJ_base.updateData();
|
} else if(CommDevType_FBS9100 == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_FBS9100_base.Comm_BTS.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_FBS9100_base.Comm_BTS.comm_rx_cnt));
|
|
panel_FBS9100_base.updateData();
|
} else if(CommDevType_NTM == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_NTM_base.Comm_NTM.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_NTM_base.Comm_NTM.comm_rx_cnt));
|
|
panel_NTM_base.updateData();
|
} else if(CommDevType_LoraTest == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_LoraTest_base.Comm_LoraTester.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_LoraTest_base.Comm_LoraTester.comm_rx_cnt));
|
|
panel_LoraTest_base.updateData();
|
} else if(CommDevType_BYBB == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_bybb_base.Comm_BYBB.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_bybb_base.Comm_BYBB.comm_rx_cnt));
|
|
panel_bybb_base.updateData();
|
} else if(CommDevType_BTS4810 == main_DevType) {
|
|
tf_txcnt.setText(String.format("TX:%d", panel_bts4810_base.Comm_BTS4810.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_bts4810_base.Comm_BTS4810.comm_rx_cnt));
|
|
panel_bts4810_base.updateData();
|
} else if(CommDevType_SwitchDevice == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_switchdevice_base.Comm_Swit.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_switchdevice_base.Comm_Swit.comm_rx_cnt));
|
|
panel_switchdevice_base.updateData();
|
} else if(CommDevType_DummyLoad == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_dummyload_base.Comm_Swit.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_dummyload_base.Comm_Swit.comm_rx_cnt));
|
|
panel_dummyload_base.updateData();
|
} else if(CommDevType_UKEY == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_ueky_page_base.Comm_ukey.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_ueky_page_base.Comm_ukey.comm_rx_cnt));
|
|
panel_ueky_page_base.updateData();
|
} else if(CommDevType_SIMPOWER == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_power_page_base.Comm_POWER.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_power_page_base.Comm_POWER.comm_rx_cnt));
|
|
panel_power_page_base.updateData();
|
} else if(CommDevType_ICA_200KW == main_DevType) {
|
tf_txcnt.setText(String.format("TX:%d", panel_ica_600kw_page.Comm_ICA.comm_tx_cnt));
|
tf_rxcnt.setText(String.format("RX:%d", panel_ica_600kw_page.Comm_ICA.comm_rx_cnt));
|
|
panel_ica_600kw_page.updateData();
|
}
|
} catch (Exception e) {
|
m_Log.error(e.toString(), e);
|
}
|
}
|
|
//ÉèÖÃÊ×Ò³°´Å¥Ñùʽ
|
public void setButtonType(JButton button) {
|
button.setBorder(null);
|
//ÉèÖÃÎı¾ÔÚͼƬÏ·½
|
button.setHorizontalTextPosition(SwingConstants.CENTER);
|
button.setVerticalTextPosition(SwingConstants.BOTTOM);
|
|
button.setFont(new Font("ËÎÌå", Font.PLAIN, 18));
|
}
|
|
public void setJTableSelectIndex(int jt_index) {
|
System.out.println("###########################");
|
if(jt_index < main_TabbedPane.getTabCount() && jt_index >= 0) {
|
main_TabbedPane.setSelectedIndex(jt_index);
|
}
|
}
|
|
|
}
|