|
@@ -71,7 +71,7 @@ public class MesClient extends JFrame {
|
|
|
//工位
|
|
//工位
|
|
|
public static String mes_gw = "";
|
|
public static String mes_gw = "";
|
|
|
//工位名称
|
|
//工位名称
|
|
|
- public static String mes_gw_des = "箱体反面CNC";
|
|
|
|
|
|
|
+ public static String mes_gw_des = "";
|
|
|
//服务器IP地址
|
|
//服务器IP地址
|
|
|
public static String mes_server_ip = "";
|
|
public static String mes_server_ip = "";
|
|
|
//TCP端口
|
|
//TCP端口
|
|
@@ -80,7 +80,7 @@ public class MesClient extends JFrame {
|
|
|
public static int mes_heart_beat_cycle = 10;
|
|
public static int mes_heart_beat_cycle = 10;
|
|
|
public static int mes_heart_icon_cycle = 1;
|
|
public static int mes_heart_icon_cycle = 1;
|
|
|
public static String mes_line_sn = "";
|
|
public static String mes_line_sn = "";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//TCP连接
|
|
//TCP连接
|
|
|
public static NettyClient nettyClient;
|
|
public static NettyClient nettyClient;
|
|
|
//TCP连接状态
|
|
//TCP连接状态
|
|
@@ -94,10 +94,10 @@ public class MesClient extends JFrame {
|
|
|
public static boolean MJBW_flg = false;
|
|
public static boolean MJBW_flg = false;
|
|
|
public static boolean MQDW_flg = false;
|
|
public static boolean MQDW_flg = false;
|
|
|
public static boolean MCSW_flg = false;
|
|
public static boolean MCSW_flg = false;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//session
|
|
//session
|
|
|
public static String sessionid = "";
|
|
public static String sessionid = "";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//窗口大小
|
|
//窗口大小
|
|
|
int winWidth = 1024;
|
|
int winWidth = 1024;
|
|
|
int winHeight = 768;
|
|
int winHeight = 768;
|
|
@@ -114,12 +114,12 @@ public class MesClient extends JFrame {
|
|
|
public static Boolean check_quality_result = false; // false=不合格 true=合格
|
|
public static Boolean check_quality_result = false; // false=不合格 true=合格
|
|
|
|
|
|
|
|
public static Integer work_status = 0; // 0=未开始 1=进行中
|
|
public static Integer work_status = 0; // 0=未开始 1=进行中
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static JFrame tcframe;
|
|
public static JFrame tcframe;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static String qualityRet = "";
|
|
public static String qualityRet = "";
|
|
|
|
|
|
|
|
- public static ModbusTcp modbusTcp = new ModbusTcp(1, "192.168.88.89");
|
|
|
|
|
|
|
+ public static ModbusTcp modbusTcp = new ModbusTcp(99, "192.168.88.99");
|
|
|
|
|
|
|
|
public static Integer tjFlag = 0; // 0=未扫码 1=已扫码,设备未运行 2=设备运行中 3=设备运行结束,结果未提交到MES
|
|
public static Integer tjFlag = 0; // 0=未扫码 1=已扫码,设备未运行 2=设备运行中 3=设备运行结束,结果未提交到MES
|
|
|
|
|
|
|
@@ -150,7 +150,7 @@ public class MesClient extends JFrame {
|
|
|
public static Integer yxstart = 0; // 运行次数 OP060需要启动2次
|
|
public static Integer yxstart = 0; // 运行次数 OP060需要启动2次
|
|
|
|
|
|
|
|
public static Integer yxpause = 0; // 1=已暂停过 0=未
|
|
public static Integer yxpause = 0; // 1=已暂停过 0=未
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Launch the application.
|
|
* Launch the application.
|
|
|
*/
|
|
*/
|
|
@@ -160,21 +160,21 @@ public class MesClient extends JFrame {
|
|
|
try {
|
|
try {
|
|
|
//读取配置文件
|
|
//读取配置文件
|
|
|
readProperty();
|
|
readProperty();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//显示界面
|
|
//显示界面
|
|
|
mesClientFrame = new MesClient();
|
|
mesClientFrame = new MesClient();
|
|
|
mesClientFrame.setVisible(false);
|
|
mesClientFrame.setVisible(false);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//初始化sqlite数据库连接
|
|
//初始化sqlite数据库连接
|
|
|
JdbcUtils.getConn();
|
|
JdbcUtils.getConn();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
initLoginPanel();
|
|
initLoginPanel();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// initTcPanel();
|
|
// initTcPanel();
|
|
|
|
|
|
|
|
getPlcParam();
|
|
getPlcParam();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
@@ -192,7 +192,6 @@ public class MesClient extends JFrame {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
if(work_status == 1){
|
|
if(work_status == 1){
|
|
|
ModbusUitl.getParamData(modbusTcp);
|
|
ModbusUitl.getParamData(modbusTcp);
|
|
|
-// ModbusUitl.getParamDatas(modbusTcp);
|
|
|
|
|
}else{
|
|
}else{
|
|
|
int qdstatus = ModbusUitl.getEnable(modbusTcp);
|
|
int qdstatus = ModbusUitl.getEnable(modbusTcp);
|
|
|
if(qdstatus == 0){
|
|
if(qdstatus == 0){
|
|
@@ -213,14 +212,14 @@ public class MesClient extends JFrame {
|
|
|
pro.load(br);
|
|
pro.load(br);
|
|
|
mes_gw = pro.getProperty("mes.gw");
|
|
mes_gw = pro.getProperty("mes.gw");
|
|
|
|
|
|
|
|
-// mes_gw_des = pro.getProperty("mes.gw_des");
|
|
|
|
|
|
|
+ mes_gw_des = pro.getProperty("mes.gw_des");
|
|
|
mes_server_ip = pro.getProperty("mes.server_ip");
|
|
mes_server_ip = pro.getProperty("mes.server_ip");
|
|
|
mes_tcp_port = Integer.parseInt(pro.getProperty("mes.tcp_port"));
|
|
mes_tcp_port = Integer.parseInt(pro.getProperty("mes.tcp_port"));
|
|
|
mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
|
|
mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
|
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
|
System.out.println(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";" + mes_tcp_port + ";" + mes_heart_beat_cycle);
|
|
System.out.println(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";" + mes_tcp_port + ";" + mes_heart_beat_cycle);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//初始化TCP
|
|
//初始化TCP
|
|
|
private static void initTcpConnection() {
|
|
private static void initTcpConnection() {
|
|
|
try {
|
|
try {
|
|
@@ -231,7 +230,7 @@ public class MesClient extends JFrame {
|
|
|
tcp_connect_flag = false;
|
|
tcp_connect_flag = false;
|
|
|
//设置TCP请求状态
|
|
//设置TCP请求状态
|
|
|
connect_request_flag = true;
|
|
connect_request_flag = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//TCP连接后,直接先发同步报文
|
|
//TCP连接后,直接先发同步报文
|
|
|
String start = "aaaabbbbbABW";
|
|
String start = "aaaabbbbbABW";
|
|
|
String msgType = "SYNR";
|
|
String msgType = "SYNR";
|
|
@@ -243,7 +242,7 @@ public class MesClient extends JFrame {
|
|
|
String gy = "";
|
|
String gy = "";
|
|
|
String sn = "";
|
|
String sn = "";
|
|
|
JdbcUtils.insertData(gw, gy, synr_str, msgType, sn);
|
|
JdbcUtils.insertData(gw, gy, synr_str, msgType, sn);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
nettyClient.run(synr_str);
|
|
nettyClient.run(synr_str);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -251,7 +250,7 @@ public class MesClient extends JFrame {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//启动心跳包程序
|
|
//启动心跳包程序
|
|
|
public static Timer heartBeatTimer;
|
|
public static Timer heartBeatTimer;
|
|
|
public static Timer heartBeatIconTimer;
|
|
public static Timer heartBeatIconTimer;
|
|
@@ -276,12 +275,12 @@ public class MesClient extends JFrame {
|
|
|
String sn = "";
|
|
String sn = "";
|
|
|
JdbcUtils.insertData(gw, gy, axtw_str, msgType, sn);
|
|
JdbcUtils.insertData(gw, gy, axtw_str, msgType, sn);
|
|
|
nettyClient.future.channel().writeAndFlush(axtw_str);
|
|
nettyClient.future.channel().writeAndFlush(axtw_str);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}, 100,mes_heart_beat_cycle*1000);
|
|
}, 100,mes_heart_beat_cycle*1000);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//心跳显示图标
|
|
//心跳显示图标
|
|
|
if(heartBeatIconTimer!=null) {
|
|
if(heartBeatIconTimer!=null) {
|
|
|
heartBeatIconTimer.cancel();
|
|
heartBeatIconTimer.cancel();
|
|
@@ -298,12 +297,12 @@ public class MesClient extends JFrame {
|
|
|
iconREDFlag = true;
|
|
iconREDFlag = true;
|
|
|
}
|
|
}
|
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
|
- heart_beat_menu.repaint();
|
|
|
|
|
|
|
+ heart_beat_menu.repaint();
|
|
|
}else {
|
|
}else {
|
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
|
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
|
- heart_beat_menu.repaint();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ heart_beat_menu.repaint();
|
|
|
|
|
+
|
|
|
//若未连接则尝试连接
|
|
//若未连接则尝试连接
|
|
|
if(nettyClient!=null&&!tcp_connect_flag){
|
|
if(nettyClient!=null&&!tcp_connect_flag){
|
|
|
System.out.println("TCP已断开");
|
|
System.out.println("TCP已断开");
|
|
@@ -325,17 +324,17 @@ public class MesClient extends JFrame {
|
|
|
JdbcUtils.insertData(gw1, gy1, synr_str, msgType1, sn1);
|
|
JdbcUtils.insertData(gw1, gy1, synr_str, msgType1, sn1);
|
|
|
nettyClient.run(synr_str);
|
|
nettyClient.run(synr_str);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}, 100,mes_heart_icon_cycle*1000);
|
|
}, 100,mes_heart_icon_cycle*1000);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Create the frame.
|
|
* Create the frame.
|
|
|
*/
|
|
*/
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static JButton heart_beat_menu;
|
|
public static JButton heart_beat_menu;
|
|
|
public static JButton status_menu;
|
|
public static JButton status_menu;
|
|
|
public static JButton user_menu;
|
|
public static JButton user_menu;
|
|
@@ -344,13 +343,13 @@ public class MesClient extends JFrame {
|
|
|
JScrollPane resistanceTableScroll;
|
|
JScrollPane resistanceTableScroll;
|
|
|
//table
|
|
//table
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public MesClient() {
|
|
public MesClient() {
|
|
|
setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
|
|
setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
|
|
|
setTitle("MES系统客户端:"+mes_gw + "- " + mes_gw_des);
|
|
setTitle("MES系统客户端:"+mes_gw + "- " + mes_gw_des);
|
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
setBounds(0, 0, 1024, 768);
|
|
setBounds(0, 0, 1024, 768);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//全屏显示
|
|
//全屏显示
|
|
|
//获取屏幕的边界
|
|
//获取屏幕的边界
|
|
|
// Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
|
|
// Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
|
|
@@ -358,7 +357,7 @@ public class MesClient extends JFrame {
|
|
|
// taskBarHeight = screenInsets.bottom;
|
|
// taskBarHeight = screenInsets.bottom;
|
|
|
// Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
|
// Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
// setBounds(0, 0, d.width, d.height-taskBarHeight);
|
|
// setBounds(0, 0, d.width, d.height-taskBarHeight);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenuBar menuBar = new JMenuBar();
|
|
JMenuBar menuBar = new JMenuBar();
|
|
|
menuBar.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 26));
|
|
menuBar.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 26));
|
|
|
setJMenuBar(menuBar);
|
|
setJMenuBar(menuBar);
|
|
@@ -366,7 +365,7 @@ public class MesClient extends JFrame {
|
|
|
fileMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/user.png")));
|
|
fileMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/user.png")));
|
|
|
fileMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
fileMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
menuBar.add(fileMenu);
|
|
menuBar.add(fileMenu);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenuItem exitMenuItem = new JMenuItem("退出");
|
|
JMenuItem exitMenuItem = new JMenuItem("退出");
|
|
|
exitMenuItem.setIcon(new ImageIcon(MesClient.class.getResource("/bg/logoff.png")));
|
|
exitMenuItem.setIcon(new ImageIcon(MesClient.class.getResource("/bg/logoff.png")));
|
|
|
exitMenuItem.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
exitMenuItem.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
@@ -380,13 +379,13 @@ public class MesClient extends JFrame {
|
|
|
logoff();
|
|
logoff();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenu settingMenu = new JMenu("设置");
|
|
JMenu settingMenu = new JMenu("设置");
|
|
|
//settingMenu.setVisible(false);
|
|
//settingMenu.setVisible(false);
|
|
|
settingMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")));
|
|
settingMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")));
|
|
|
settingMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
settingMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
menuBar.add(settingMenu);
|
|
menuBar.add(settingMenu);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenuItem resetTcpMenu = new JMenuItem("\u91CD\u8FDEMES");
|
|
JMenuItem resetTcpMenu = new JMenuItem("\u91CD\u8FDEMES");
|
|
|
resetTcpMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
resetTcpMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
resetTcpMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
resetTcpMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
@@ -414,7 +413,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
settingMenu.add(resetTcpMenu_11);
|
|
settingMenu.add(resetTcpMenu_11);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenuItem resetTcpMenu_1 = new JMenuItem("\u5237\u65B0\u5DE5\u4EF6");
|
|
JMenuItem resetTcpMenu_1 = new JMenuItem("\u5237\u65B0\u5DE5\u4EF6");
|
|
|
resetTcpMenu_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
resetTcpMenu_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
resetTcpMenu_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
resetTcpMenu_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
@@ -485,7 +484,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
settingMenu.add(resetTcpMenu_111);
|
|
settingMenu.add(resetTcpMenu_111);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenuItem resetTcpMenu_1_1 = new JMenuItem("\u8D28\u91CF\u68C0\u67E5");
|
|
JMenuItem resetTcpMenu_1_1 = new JMenuItem("\u8D28\u91CF\u68C0\u67E5");
|
|
|
resetTcpMenu_1_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/bar_sampling.png")));
|
|
resetTcpMenu_1_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/bar_sampling.png")));
|
|
|
resetTcpMenu_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
resetTcpMenu_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
@@ -503,7 +502,7 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
// resetTcpMenu_1_1.setVisible(false);
|
|
// resetTcpMenu_1_1.setVisible(false);
|
|
|
// settingMenu.add(resetTcpMenu_1_1);
|
|
// settingMenu.add(resetTcpMenu_1_1);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
rescanMenu1 = new JMenuItem("\u91CD\u65B0\u626B\u7801-A\u9762");
|
|
rescanMenu1 = new JMenuItem("\u91CD\u65B0\u626B\u7801-A\u9762");
|
|
|
rescanMenu1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
|
|
rescanMenu1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
|
|
|
rescanMenu1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
rescanMenu1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
@@ -518,7 +517,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
// settingMenu.add(rescanMenu1);
|
|
// settingMenu.add(rescanMenu1);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JMenuItem rescanMenu2 = new JMenuItem("\u91CD\u65B0\u626B\u7801-B\u9762");
|
|
JMenuItem rescanMenu2 = new JMenuItem("\u91CD\u65B0\u626B\u7801-B\u9762");
|
|
|
rescanMenu2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
|
|
rescanMenu2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
|
|
|
rescanMenu2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
rescanMenu2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
@@ -533,23 +532,23 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
// settingMenu.add(rescanMenu2);
|
|
// settingMenu.add(rescanMenu2);
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
contentPane = new JPanel();
|
|
contentPane = new JPanel();
|
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
|
setContentPane(contentPane);
|
|
setContentPane(contentPane);
|
|
|
contentPane.setLayout(new BorderLayout(0, 0));
|
|
contentPane.setLayout(new BorderLayout(0, 0));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JToolBar toolBar = new JToolBar();
|
|
JToolBar toolBar = new JToolBar();
|
|
|
contentPane.add(toolBar, BorderLayout.NORTH);
|
|
contentPane.add(toolBar, BorderLayout.NORTH);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel equipment_statu_label = new JLabel("\u72B6\u6001\uFF1A");
|
|
JLabel equipment_statu_label = new JLabel("\u72B6\u6001\uFF1A");
|
|
|
equipment_statu_label.setHorizontalAlignment(SwingConstants.CENTER);
|
|
equipment_statu_label.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
equipment_statu_label.setForeground(Color.BLACK);
|
|
equipment_statu_label.setForeground(Color.BLACK);
|
|
|
equipment_statu_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
equipment_statu_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
equipment_statu_label.setBackground(Color.LIGHT_GRAY);
|
|
equipment_statu_label.setBackground(Color.LIGHT_GRAY);
|
|
|
toolBar.add(equipment_statu_label);
|
|
toolBar.add(equipment_statu_label);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
status_menu = new JButton("设备未连接MES服务器");
|
|
status_menu = new JButton("设备未连接MES服务器");
|
|
|
System.out.println("tcp_connect_flag="+tcp_connect_flag);
|
|
System.out.println("tcp_connect_flag="+tcp_connect_flag);
|
|
|
if(tcp_connect_flag) {
|
|
if(tcp_connect_flag) {
|
|
@@ -567,51 +566,51 @@ public class MesClient extends JFrame {
|
|
|
status_menu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
status_menu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
status_menu.setBackground(Color.BLACK);
|
|
status_menu.setBackground(Color.BLACK);
|
|
|
toolBar.add(status_menu);
|
|
toolBar.add(status_menu);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel space_1 = new JLabel(" ");
|
|
JLabel space_1 = new JLabel(" ");
|
|
|
toolBar.add(space_1);
|
|
toolBar.add(space_1);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel heart_beat_status_label = new JLabel("\u5FC3\u8DF3\uFF1A");
|
|
JLabel heart_beat_status_label = new JLabel("\u5FC3\u8DF3\uFF1A");
|
|
|
heart_beat_status_label.setHorizontalAlignment(SwingConstants.CENTER);
|
|
heart_beat_status_label.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
heart_beat_status_label.setForeground(Color.BLACK);
|
|
heart_beat_status_label.setForeground(Color.BLACK);
|
|
|
heart_beat_status_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
heart_beat_status_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
heart_beat_status_label.setBackground(Color.LIGHT_GRAY);
|
|
heart_beat_status_label.setBackground(Color.LIGHT_GRAY);
|
|
|
toolBar.add(heart_beat_status_label);
|
|
toolBar.add(heart_beat_status_label);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
heart_beat_menu = new JButton("2023-08-17 23:20:10");
|
|
heart_beat_menu = new JButton("2023-08-17 23:20:10");
|
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/green_dot.png")));
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/green_dot.png")));
|
|
|
heart_beat_menu.setForeground(Color.GREEN);
|
|
heart_beat_menu.setForeground(Color.GREEN);
|
|
|
heart_beat_menu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
heart_beat_menu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
heart_beat_menu.setBackground(Color.BLACK);
|
|
heart_beat_menu.setBackground(Color.BLACK);
|
|
|
toolBar.add(heart_beat_menu);
|
|
toolBar.add(heart_beat_menu);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel space_2 = new JLabel(" ");
|
|
JLabel space_2 = new JLabel(" ");
|
|
|
toolBar.add(space_2);
|
|
toolBar.add(space_2);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel user_status_label = new JLabel("\u767B\u5F55\u7528\u6237\uFF1A");
|
|
JLabel user_status_label = new JLabel("\u767B\u5F55\u7528\u6237\uFF1A");
|
|
|
user_status_label.setHorizontalAlignment(SwingConstants.CENTER);
|
|
user_status_label.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
user_status_label.setForeground(Color.BLACK);
|
|
user_status_label.setForeground(Color.BLACK);
|
|
|
user_status_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
user_status_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
user_status_label.setBackground(Color.LIGHT_GRAY);
|
|
user_status_label.setBackground(Color.LIGHT_GRAY);
|
|
|
toolBar.add(user_status_label);
|
|
toolBar.add(user_status_label);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
user_menu = new JButton("JinJuShi");
|
|
user_menu = new JButton("JinJuShi");
|
|
|
user_menu.setForeground(Color.GREEN);
|
|
user_menu.setForeground(Color.GREEN);
|
|
|
user_menu.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
user_menu.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
|
user_menu.setBackground(Color.BLACK);
|
|
user_menu.setBackground(Color.BLACK);
|
|
|
toolBar.add(user_menu);
|
|
toolBar.add(user_menu);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel space_3 = new JLabel(" ");
|
|
JLabel space_3 = new JLabel(" ");
|
|
|
toolBar.add(space_3);
|
|
toolBar.add(space_3);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel space_4 = new JLabel(" ");
|
|
JLabel space_4 = new JLabel(" ");
|
|
|
toolBar.add(space_4);
|
|
toolBar.add(space_4);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
|
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
|
|
tabbedPane.setMinimumSize(new Dimension(400, 50));
|
|
tabbedPane.setMinimumSize(new Dimension(400, 50));
|
|
|
tabbedPane.setFont(new Font("宋体", Font.BOLD, 22));
|
|
tabbedPane.setFont(new Font("宋体", Font.BOLD, 22));
|
|
|
contentPane.add(tabbedPane);
|
|
contentPane.add(tabbedPane);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//首页
|
|
//首页
|
|
|
JPanel indexPanelA = new JPanel();
|
|
JPanel indexPanelA = new JPanel();
|
|
|
indexScrollPaneA = new JScrollPane(indexPanelA);
|
|
indexScrollPaneA = new JScrollPane(indexPanelA);
|
|
@@ -639,7 +638,7 @@ public class MesClient extends JFrame {
|
|
|
// resistanceTableScroll = new JScrollPane(resistanceTable); //支持滚动
|
|
// resistanceTableScroll = new JScrollPane(resistanceTable); //支持滚动
|
|
|
// resistanceTableScroll.setVisible(false);
|
|
// resistanceTableScroll.setVisible(false);
|
|
|
// resistanceTableScroll.setBounds(46, 90, 773, 589);
|
|
// resistanceTableScroll.setBounds(46, 90, 773, 589);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
product_sn = new JTextField();
|
|
product_sn = new JTextField();
|
|
|
product_sn.setHorizontalAlignment(SwingConstants.CENTER);
|
|
product_sn.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
product_sn.setEditable(false);
|
|
product_sn.setEditable(false);
|
|
@@ -647,7 +646,7 @@ public class MesClient extends JFrame {
|
|
|
product_sn.setBounds(81, 70, 602, 70);
|
|
product_sn.setBounds(81, 70, 602, 70);
|
|
|
indexPanelA.add(product_sn);
|
|
indexPanelA.add(product_sn);
|
|
|
product_sn.setColumns(10);
|
|
product_sn.setColumns(10);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
f_scan_data_bt_1 = new JButton("\u626B\u7801");
|
|
f_scan_data_bt_1 = new JButton("\u626B\u7801");
|
|
|
f_scan_data_bt_1.addActionListener(new ActionListener() {
|
|
f_scan_data_bt_1.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
@@ -660,13 +659,13 @@ public class MesClient extends JFrame {
|
|
|
f_scan_data_bt_1.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
f_scan_data_bt_1.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
|
f_scan_data_bt_1.setBounds(693, 70, 198, 70);
|
|
f_scan_data_bt_1.setBounds(693, 70, 198, 70);
|
|
|
indexPanelA.add(f_scan_data_bt_1);
|
|
indexPanelA.add(f_scan_data_bt_1);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
r_barcode_label_1 = new JLabel("");
|
|
r_barcode_label_1 = new JLabel("");
|
|
|
//r_barcode_label_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/bar_cmd_go.png")));
|
|
//r_barcode_label_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/bar_cmd_go.png")));
|
|
|
r_barcode_label_1.setFont(new Font("微软雅黑", Font.PLAIN, 26));
|
|
r_barcode_label_1.setFont(new Font("微软雅黑", Font.PLAIN, 26));
|
|
|
r_barcode_label_1.setBounds(712, 291, 36, 44);
|
|
r_barcode_label_1.setBounds(712, 291, 36, 44);
|
|
|
indexPanelA.add(r_barcode_label_1);
|
|
indexPanelA.add(r_barcode_label_1);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
finish_ok_bt = new JButton("OK");
|
|
finish_ok_bt = new JButton("OK");
|
|
|
finish_ok_bt.setEnabled(false);
|
|
finish_ok_bt.setEnabled(false);
|
|
|
finish_ok_bt.addActionListener(new ActionListener() {
|
|
finish_ok_bt.addActionListener(new ActionListener() {
|
|
@@ -674,7 +673,7 @@ public class MesClient extends JFrame {
|
|
|
if(work_status == 1 && check_quality_result){
|
|
if(work_status == 1 && check_quality_result){
|
|
|
String sn = getBarcode(product_sn.getText());
|
|
String sn = getBarcode(product_sn.getText());
|
|
|
getUser();
|
|
getUser();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
String qret = "OK";
|
|
String qret = "OK";
|
|
|
if(qualityRet.equals("OK")) {
|
|
if(qualityRet.equals("OK")) {
|
|
|
qret = "OC";
|
|
qret = "OC";
|
|
@@ -692,7 +691,7 @@ public class MesClient extends JFrame {
|
|
|
finish_ok_bt.setBounds(201, 391, 240, 80);
|
|
finish_ok_bt.setBounds(201, 391, 240, 80);
|
|
|
finish_ok_bt.setEnabled(false);
|
|
finish_ok_bt.setEnabled(false);
|
|
|
indexPanelA.add(finish_ok_bt);
|
|
indexPanelA.add(finish_ok_bt);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
finish_ng_bt = new JButton("NG");
|
|
finish_ng_bt = new JButton("NG");
|
|
|
finish_ng_bt.setEnabled(false);
|
|
finish_ng_bt.setEnabled(false);
|
|
|
finish_ng_bt.addActionListener(new ActionListener() {
|
|
finish_ng_bt.addActionListener(new ActionListener() {
|
|
@@ -720,41 +719,41 @@ public class MesClient extends JFrame {
|
|
|
finish_ng_bt.setBounds(521, 391, 240, 80);
|
|
finish_ng_bt.setBounds(521, 391, 240, 80);
|
|
|
finish_ng_bt.setEnabled(false);
|
|
finish_ng_bt.setEnabled(false);
|
|
|
indexPanelA.add(finish_ng_bt);
|
|
indexPanelA.add(finish_ng_bt);
|
|
|
-
|
|
|
|
|
- JLabel lblNewLabel = new JLabel("机床主轴转速");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNewLabel = new JLabel("波刃铣刀");
|
|
|
lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
lblNewLabel.setBounds(139, 187, 120, 40);
|
|
lblNewLabel.setBounds(139, 187, 120, 40);
|
|
|
indexPanelA.add(lblNewLabel);
|
|
indexPanelA.add(lblNewLabel);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
knife1 = new JTextField();
|
|
knife1 = new JTextField();
|
|
|
knife1.setText("1");
|
|
knife1.setText("1");
|
|
|
knife1.setEnabled(false);
|
|
knife1.setEnabled(false);
|
|
|
knife1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
knife1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
knife1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
knife1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
knife1.setBounds(264, 186, 60, 40);
|
|
knife1.setBounds(264, 186, 60, 40);
|
|
|
-// indexPanelA.add(knife1);
|
|
|
|
|
|
|
+ indexPanelA.add(knife1);
|
|
|
knife1.setColumns(10);
|
|
knife1.setColumns(10);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
param1 = new JTextField();
|
|
param1 = new JTextField();
|
|
|
param1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
param1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
param1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
param1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
param1.setColumns(10);
|
|
param1.setColumns(10);
|
|
|
param1.setBounds(334, 186, 100, 40);
|
|
param1.setBounds(334, 186, 100, 40);
|
|
|
indexPanelA.add(param1);
|
|
indexPanelA.add(param1);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel lblNewLabel_1 = new JLabel("合金钻头");
|
|
JLabel lblNewLabel_1 = new JLabel("合金钻头");
|
|
|
lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
lblNewLabel_1.setBounds(139, 245, 120, 40);
|
|
lblNewLabel_1.setBounds(139, 245, 120, 40);
|
|
|
-// indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
+
|
|
|
JLabel lblNewLabel_1_1 = new JLabel("T型刀");
|
|
JLabel lblNewLabel_1_1 = new JLabel("T型刀");
|
|
|
lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
lblNewLabel_1_1.setBounds(139, 306, 120, 40);
|
|
lblNewLabel_1_1.setBounds(139, 306, 120, 40);
|
|
|
-// indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
+
|
|
|
knife3 = new JTextField();
|
|
knife3 = new JTextField();
|
|
|
knife3.setText("3");
|
|
knife3.setText("3");
|
|
|
knife3.setEnabled(false);
|
|
knife3.setEnabled(false);
|
|
@@ -762,8 +761,8 @@ public class MesClient extends JFrame {
|
|
|
knife3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
knife3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
knife3.setColumns(10);
|
|
knife3.setColumns(10);
|
|
|
knife3.setBounds(264, 245, 60, 40);
|
|
knife3.setBounds(264, 245, 60, 40);
|
|
|
-// indexPanelA.add(knife3);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(knife3);
|
|
|
|
|
+
|
|
|
knife5 = new JTextField();
|
|
knife5 = new JTextField();
|
|
|
knife5.setText("5");
|
|
knife5.setText("5");
|
|
|
knife5.setEnabled(false);
|
|
knife5.setEnabled(false);
|
|
@@ -771,28 +770,28 @@ public class MesClient extends JFrame {
|
|
|
knife5.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
knife5.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
knife5.setColumns(10);
|
|
knife5.setColumns(10);
|
|
|
knife5.setBounds(264, 306, 60, 40);
|
|
knife5.setBounds(264, 306, 60, 40);
|
|
|
-// indexPanelA.add(knife5);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(knife5);
|
|
|
|
|
+
|
|
|
param3 = new JTextField();
|
|
param3 = new JTextField();
|
|
|
param3.setHorizontalAlignment(SwingConstants.CENTER);
|
|
param3.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
param3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
param3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
param3.setColumns(10);
|
|
param3.setColumns(10);
|
|
|
param3.setBounds(334, 245, 100, 40);
|
|
param3.setBounds(334, 245, 100, 40);
|
|
|
-// indexPanelA.add(param3);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(param3);
|
|
|
|
|
+
|
|
|
param5 = new JTextField();
|
|
param5 = new JTextField();
|
|
|
param5.setHorizontalAlignment(SwingConstants.CENTER);
|
|
param5.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
param5.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
param5.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
param5.setColumns(10);
|
|
param5.setColumns(10);
|
|
|
param5.setBounds(334, 306, 100, 40);
|
|
param5.setBounds(334, 306, 100, 40);
|
|
|
-// indexPanelA.add(param5);
|
|
|
|
|
-
|
|
|
|
|
- JLabel lblNewLabel_2 = new JLabel("机床进给速率");
|
|
|
|
|
|
|
+ indexPanelA.add(param5);
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNewLabel_2 = new JLabel("合金铣刀");
|
|
|
lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel_2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
lblNewLabel_2.setBounds(478, 186, 120, 40);
|
|
lblNewLabel_2.setBounds(478, 186, 120, 40);
|
|
|
indexPanelA.add(lblNewLabel_2);
|
|
indexPanelA.add(lblNewLabel_2);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
knife2 = new JTextField();
|
|
knife2 = new JTextField();
|
|
|
knife2.setText("2");
|
|
knife2.setText("2");
|
|
|
knife2.setEnabled(false);
|
|
knife2.setEnabled(false);
|
|
@@ -800,21 +799,21 @@ public class MesClient extends JFrame {
|
|
|
knife2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
knife2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
knife2.setColumns(10);
|
|
knife2.setColumns(10);
|
|
|
knife2.setBounds(602, 186, 60, 40);
|
|
knife2.setBounds(602, 186, 60, 40);
|
|
|
-// indexPanelA.add(knife2);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(knife2);
|
|
|
|
|
+
|
|
|
param2 = new JTextField();
|
|
param2 = new JTextField();
|
|
|
param2.setHorizontalAlignment(SwingConstants.CENTER);
|
|
param2.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
param2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
param2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
param2.setColumns(10);
|
|
param2.setColumns(10);
|
|
|
- param2.setBounds(672, 186, 200, 40);
|
|
|
|
|
|
|
+ param2.setBounds(672, 186, 100, 40);
|
|
|
indexPanelA.add(param2);
|
|
indexPanelA.add(param2);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
JLabel lblNewLabel_2_1 = new JLabel("T型刀");
|
|
JLabel lblNewLabel_2_1 = new JLabel("T型刀");
|
|
|
lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_2_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel_2_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
lblNewLabel_2_1.setBounds(478, 245, 120, 40);
|
|
lblNewLabel_2_1.setBounds(478, 245, 120, 40);
|
|
|
-// indexPanelA.add(lblNewLabel_2_1);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_2_1);
|
|
|
|
|
+
|
|
|
knife4 = new JTextField();
|
|
knife4 = new JTextField();
|
|
|
knife4.setText("4");
|
|
knife4.setText("4");
|
|
|
knife4.setEnabled(false);
|
|
knife4.setEnabled(false);
|
|
@@ -822,22 +821,22 @@ public class MesClient extends JFrame {
|
|
|
knife4.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
knife4.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
knife4.setColumns(10);
|
|
knife4.setColumns(10);
|
|
|
knife4.setBounds(602, 245, 60, 40);
|
|
knife4.setBounds(602, 245, 60, 40);
|
|
|
-// indexPanelA.add(knife4);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(knife4);
|
|
|
|
|
+
|
|
|
param4 = new JTextField();
|
|
param4 = new JTextField();
|
|
|
param4.setHorizontalAlignment(SwingConstants.CENTER);
|
|
param4.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
param4.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
param4.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
param4.setColumns(10);
|
|
param4.setColumns(10);
|
|
|
param4.setBounds(672, 245, 100, 40);
|
|
param4.setBounds(672, 245, 100, 40);
|
|
|
-// indexPanelA.add(param4);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(param4);
|
|
|
|
|
+
|
|
|
JLabel lblNewLabel_2_1_1 = new JLabel("合金钻");
|
|
JLabel lblNewLabel_2_1_1 = new JLabel("合金钻");
|
|
|
lblNewLabel_2_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_2_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_2_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel_2_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
lblNewLabel_2_1_1.setBounds(478, 306, 120, 40);
|
|
lblNewLabel_2_1_1.setBounds(478, 306, 120, 40);
|
|
|
lblNewLabel_2_1_1.setVisible(false);
|
|
lblNewLabel_2_1_1.setVisible(false);
|
|
|
-// indexPanelA.add(lblNewLabel_2_1_1);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_2_1_1);
|
|
|
|
|
+
|
|
|
knife6 = new JTextField();
|
|
knife6 = new JTextField();
|
|
|
knife6.setText("6");
|
|
knife6.setText("6");
|
|
|
knife6.setEnabled(false);
|
|
knife6.setEnabled(false);
|
|
@@ -846,16 +845,16 @@ public class MesClient extends JFrame {
|
|
|
knife6.setColumns(10);
|
|
knife6.setColumns(10);
|
|
|
knife6.setBounds(602, 306, 60, 40);
|
|
knife6.setBounds(602, 306, 60, 40);
|
|
|
knife6.setVisible(false);
|
|
knife6.setVisible(false);
|
|
|
-// indexPanelA.add(knife6);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(knife6);
|
|
|
|
|
+
|
|
|
param6 = new JTextField();
|
|
param6 = new JTextField();
|
|
|
param6.setHorizontalAlignment(SwingConstants.CENTER);
|
|
param6.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
param6.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
param6.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
param6.setColumns(10);
|
|
param6.setColumns(10);
|
|
|
param6.setBounds(672, 306, 100, 40);
|
|
param6.setBounds(672, 306, 100, 40);
|
|
|
param6.setVisible(false);
|
|
param6.setVisible(false);
|
|
|
-// indexPanelA.add(param6);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ indexPanelA.add(param6);
|
|
|
|
|
+
|
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|
|
|
|
@@ -873,27 +872,27 @@ public class MesClient extends JFrame {
|
|
|
// tabbedPane.addTab("\u67E5\u8BE2", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPane, null);
|
|
// tabbedPane.addTab("\u67E5\u8BE2", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPane, null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//设置tcp连接状态显示
|
|
//设置tcp连接状态显示
|
|
|
public static void setTcpStatus() {
|
|
public static void setTcpStatus() {
|
|
|
if(tcp_connect_flag) {
|
|
if(tcp_connect_flag) {
|
|
|
status_menu.setText("已连接MES服务器");
|
|
status_menu.setText("已连接MES服务器");
|
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
|
|
|
- heart_beat_menu.repaint();
|
|
|
|
|
|
|
+ heart_beat_menu.repaint();
|
|
|
}else {
|
|
}else {
|
|
|
status_menu.setText("未连接MES服务器");
|
|
status_menu.setText("未连接MES服务器");
|
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
|
|
heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
|
|
|
- heart_beat_menu.repaint();
|
|
|
|
|
|
|
+ heart_beat_menu.repaint();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//初始化登录界面
|
|
//初始化登录界面
|
|
|
- public static JFrame welcomeWin;// = new JFrame("MES系统客户端-登录");
|
|
|
|
|
|
|
+ public static JFrame welcomeWin;// = new JFrame("MES系统客户端-登录");
|
|
|
//public static JLabel welcomeLable= new JLabel("<html><body>设备维护中心备件管理系统</body></html>",JLabel.LEFT);//创建标签label 并初始化;
|
|
//public static JLabel welcomeLable= new JLabel("<html><body>设备维护中心备件管理系统</body></html>",JLabel.LEFT);//创建标签label 并初始化;
|
|
|
//欢迎界面标志位
|
|
//欢迎界面标志位
|
|
|
static boolean welcomeWinFlag = true;
|
|
static boolean welcomeWinFlag = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//登录模块组件
|
|
//登录模块组件
|
|
|
static JLabel userNameLabel= new JLabel("<html><body>用户名:</body></html>",JLabel.LEFT);//用户名
|
|
static JLabel userNameLabel= new JLabel("<html><body>用户名:</body></html>",JLabel.LEFT);//用户名
|
|
|
static JLabel userPasswordLabel= new JLabel("<html><body>密码:</body></html>",JLabel.LEFT);//用户名
|
|
static JLabel userPasswordLabel= new JLabel("<html><body>密码:</body></html>",JLabel.LEFT);//用户名
|
|
@@ -901,14 +900,14 @@ public class MesClient extends JFrame {
|
|
|
public static JPasswordField userPasswordTxt;
|
|
public static JPasswordField userPasswordTxt;
|
|
|
static JButton loginButton = new JButton("用户密码登录");
|
|
static JButton loginButton = new JButton("用户密码登录");
|
|
|
static JButton scanLoginButton = new JButton("扫 码 登 录");
|
|
static JButton scanLoginButton = new JButton("扫 码 登 录");
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static String USER_NAME = "";
|
|
public static String USER_NAME = "";
|
|
|
public static String USER_PWD = "";
|
|
public static String USER_PWD = "";
|
|
|
static String WORK_CENTER = "";
|
|
static String WORK_CENTER = "";
|
|
|
static String ACCOUNT_TYPE = "";
|
|
static String ACCOUNT_TYPE = "";
|
|
|
public static int LOGIN_ACCOUNT_TYPE = 1;
|
|
public static int LOGIN_ACCOUNT_TYPE = 1;
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//工件码
|
|
//工件码
|
|
|
public static String barcode = "";
|
|
public static String barcode = "";
|
|
|
//工件类型,//P是类型1,Q是类型2
|
|
//工件类型,//P是类型1,Q是类型2
|
|
@@ -918,10 +917,10 @@ public class MesClient extends JFrame {
|
|
|
public static String user36 = "";
|
|
public static String user36 = "";
|
|
|
public static String user20 = "";
|
|
public static String user20 = "";
|
|
|
private JMenuItem rescanMenu1;
|
|
private JMenuItem rescanMenu1;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//工位类型A-B
|
|
//工位类型A-B
|
|
|
public static String gw_type = "";
|
|
public static String gw_type = "";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//扫工件码类型scan_type = 1-A面前梁,2-A面后梁;3-B面前梁,4-B面后梁
|
|
//扫工件码类型scan_type = 1-A面前梁,2-A面后梁;3-B面前梁,4-B面后梁
|
|
|
public static int scan_type = 0;
|
|
public static int scan_type = 0;
|
|
|
public static JButton finish_ok_bt;
|
|
public static JButton finish_ok_bt;
|
|
@@ -949,11 +948,11 @@ public class MesClient extends JFrame {
|
|
|
public static JTextField param4;
|
|
public static JTextField param4;
|
|
|
public static JTextField knife6;
|
|
public static JTextField knife6;
|
|
|
public static JTextField param6;
|
|
public static JTextField param6;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static void initLoginPanel() {
|
|
public static void initLoginPanel() {
|
|
|
welcomeWin = new JFrame("MES系统客户端:" + mes_gw + "- " + mes_gw_des);
|
|
welcomeWin = new JFrame("MES系统客户端:" + mes_gw + "- " + mes_gw_des);
|
|
|
// 加载背景图片
|
|
// 加载背景图片
|
|
|
- //ImageIcon bg = new ImageIcon("E:\\Benz Work\\Programming for Spart Part Department\\Spare Part Department\\image\\background.jpg");
|
|
|
|
|
|
|
+ //ImageIcon bg = new ImageIcon("E:\\Benz Work\\Programming for Spart Part Department\\Spare Part Department\\image\\background.jpg");
|
|
|
ImageIcon bg = new ImageIcon(MesClient.class.getResource("/background.png"));
|
|
ImageIcon bg = new ImageIcon(MesClient.class.getResource("/background.png"));
|
|
|
welcomeWin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
welcomeWin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
JLabel imgLabel = new JLabel(bg);//将背景图放在标签里。
|
|
JLabel imgLabel = new JLabel(bg);//将背景图放在标签里。
|
|
@@ -968,7 +967,7 @@ public class MesClient extends JFrame {
|
|
|
welcomePanel.setBounds(30, 330, 890, 300);
|
|
welcomePanel.setBounds(30, 330, 890, 300);
|
|
|
welcomePanel.setOpaque(false);//背景透明
|
|
welcomePanel.setOpaque(false);//背景透明
|
|
|
contentPane.add(welcomePanel);
|
|
contentPane.add(welcomePanel);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//登录页面
|
|
//登录页面
|
|
|
userNameLabel.setBounds(300, 100, 120, 40);
|
|
userNameLabel.setBounds(300, 100, 120, 40);
|
|
|
userNameLabel.setFont(new java.awt.Font("Dialog", 1, 16));
|
|
userNameLabel.setFont(new java.awt.Font("Dialog", 1, 16));
|
|
@@ -988,7 +987,7 @@ public class MesClient extends JFrame {
|
|
|
scanLoginButton.setFont(new java.awt.Font("Dialog", 1, 16));
|
|
scanLoginButton.setFont(new java.awt.Font("Dialog", 1, 16));
|
|
|
scanLoginButton.setBounds(300, 250, 255, 40);
|
|
scanLoginButton.setBounds(300, 250, 255, 40);
|
|
|
scanLoginButton.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
|
|
scanLoginButton.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
welcomePanel.add(userNameLabel);
|
|
welcomePanel.add(userNameLabel);
|
|
|
welcomePanel.add(userPasswordLabel);
|
|
welcomePanel.add(userPasswordLabel);
|
|
|
welcomePanel.add(userNameTxt);
|
|
welcomePanel.add(userNameTxt);
|
|
@@ -999,18 +998,18 @@ public class MesClient extends JFrame {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
login();
|
|
login();
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
scanLoginButton.addActionListener(new ActionListener(){
|
|
scanLoginButton.addActionListener(new ActionListener(){
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
scanLogin();
|
|
scanLogin();
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
((JPanel)contentPane).setOpaque(false); //注意这里,将内容面板设为透明。这样LayeredPane面板中的背景才能显示出来。
|
|
((JPanel)contentPane).setOpaque(false); //注意这里,将内容面板设为透明。这样LayeredPane面板中的背景才能显示出来。
|
|
|
//welcomeWin.setSize(902,678);
|
|
//welcomeWin.setSize(902,678);
|
|
|
welcomeWin.setResizable(false);//禁止最大化
|
|
welcomeWin.setResizable(false);//禁止最大化
|
|
|
welcomeWin.setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
|
|
welcomeWin.setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
|
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
int width = 902;
|
|
int width = 902;
|
|
|
int height = 678;
|
|
int height = 678;
|
|
@@ -1018,7 +1017,7 @@ public class MesClient extends JFrame {
|
|
|
/*****正常模式******/
|
|
/*****正常模式******/
|
|
|
welcomeWin.setVisible(true);
|
|
welcomeWin.setVisible(true);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static void initTcPanel() {
|
|
public static void initTcPanel() {
|
|
|
tcframe = new JFrame("质量检查");
|
|
tcframe = new JFrame("质量检查");
|
|
|
Container contentPane=tcframe.getContentPane();
|
|
Container contentPane=tcframe.getContentPane();
|
|
@@ -1030,14 +1029,14 @@ public class MesClient extends JFrame {
|
|
|
welcomePanel.setBounds(30, 30, 890, 300);
|
|
welcomePanel.setBounds(30, 30, 890, 300);
|
|
|
welcomePanel.setOpaque(false);//背景透明
|
|
welcomePanel.setOpaque(false);//背景透明
|
|
|
contentPane.add(welcomePanel);
|
|
contentPane.add(welcomePanel);
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
JButton button = new JButton("OK");
|
|
JButton button = new JButton("OK");
|
|
|
button.setSize(200, 80);
|
|
button.setSize(200, 80);
|
|
|
button.setBounds(100, 50, 250, 80);
|
|
button.setBounds(100, 50, 250, 80);
|
|
|
button.setIcon(new ImageIcon(MesClient.class.getResource("/bg/ok_bg.png")));
|
|
button.setIcon(new ImageIcon(MesClient.class.getResource("/bg/ok_bg.png")));
|
|
|
button.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
button.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
button.addActionListener(new ActionListener(){
|
|
button.addActionListener(new ActionListener(){
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
tcframe.setVisible(false);
|
|
tcframe.setVisible(false);
|
|
@@ -1045,9 +1044,9 @@ public class MesClient extends JFrame {
|
|
|
MesClient.finish_ok_bt.setEnabled(true);
|
|
MesClient.finish_ok_bt.setEnabled(true);
|
|
|
MesClient.finish_ng_bt.setEnabled(true);
|
|
MesClient.finish_ng_bt.setEnabled(true);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-//
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+//
|
|
|
JButton button2 = new JButton("NG");
|
|
JButton button2 = new JButton("NG");
|
|
|
button2.setSize(200, 80);
|
|
button2.setSize(200, 80);
|
|
|
button2.setBounds(100, 150, 250, 80);
|
|
button2.setBounds(100, 150, 250, 80);
|
|
@@ -1060,23 +1059,23 @@ public class MesClient extends JFrame {
|
|
|
MesClient.finish_ok_bt.setEnabled(false);
|
|
MesClient.finish_ok_bt.setEnabled(false);
|
|
|
MesClient.finish_ng_bt.setEnabled(true);
|
|
MesClient.finish_ng_bt.setEnabled(true);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
welcomePanel.add(button);
|
|
welcomePanel.add(button);
|
|
|
welcomePanel.add(button2);
|
|
welcomePanel.add(button2);
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
((JPanel)contentPane).setOpaque(false); //注意这里,将内容面板设为透明。这样LayeredPane面板中的背景才能显示出来。
|
|
((JPanel)contentPane).setOpaque(false); //注意这里,将内容面板设为透明。这样LayeredPane面板中的背景才能显示出来。
|
|
|
//welcomeWin.setSize(902,678);
|
|
//welcomeWin.setSize(902,678);
|
|
|
tcframe.setResizable(false);//禁止最大化
|
|
tcframe.setResizable(false);//禁止最大化
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
|
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
int width = 500;
|
|
int width = 500;
|
|
|
int height = 400;
|
|
int height = 400;
|
|
|
tcframe.setBounds((d.width-width)/2, (d.height-height)/2-(d.height-height)/4, width, height);
|
|
tcframe.setBounds((d.width-width)/2, (d.height-height)/2-(d.height-height)/4, width, height);
|
|
|
/*****正常模式******/
|
|
/*****正常模式******/
|
|
|
tcframe.setVisible(false);
|
|
tcframe.setVisible(false);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// tcframe.addWindowListener(new WindowAdapter() {
|
|
// tcframe.addWindowListener(new WindowAdapter() {
|
|
|
// @Override
|
|
// @Override
|
|
|
// public void windowClosing(WindowEvent e) {
|
|
// public void windowClosing(WindowEvent e) {
|
|
@@ -1086,7 +1085,7 @@ public class MesClient extends JFrame {
|
|
|
// }
|
|
// }
|
|
|
// });
|
|
// });
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//登录
|
|
//登录
|
|
|
public static void login() {
|
|
public static void login() {
|
|
|
String user_str = userNameTxt.getText().toString();
|
|
String user_str = userNameTxt.getText().toString();
|
|
@@ -1191,7 +1190,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//登出
|
|
//登出
|
|
|
public static void logoff() {
|
|
public static void logoff() {
|
|
|
welcomeWin.setVisible(true);
|
|
welcomeWin.setVisible(true);
|
|
@@ -1208,7 +1207,7 @@ public class MesClient extends JFrame {
|
|
|
connect_request_flag = false;
|
|
connect_request_flag = false;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//获取barcode内容36位
|
|
//获取barcode内容36位
|
|
|
public static String getBarcode(String barcodeTmp) {
|
|
public static String getBarcode(String barcodeTmp) {
|
|
|
String barcodeRet = barcodeTmp;
|
|
String barcodeRet = barcodeTmp;
|
|
@@ -1228,7 +1227,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
return barcodeRet;
|
|
return barcodeRet;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//获取用户20位
|
|
//获取用户20位
|
|
|
public static void getUser() {
|
|
public static void getUser() {
|
|
|
user36 = user_menu.getText().toString();
|
|
user36 = user_menu.getText().toString();
|
|
@@ -1239,7 +1238,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
user36 = user36 + space_tmp;
|
|
user36 = user36 + space_tmp;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
user20 = user_menu.getText().toString();
|
|
user20 = user_menu.getText().toString();
|
|
|
String space_tmp1 = "";
|
|
String space_tmp1 = "";
|
|
|
if(user20.length()<20) {
|
|
if(user20.length()<20) {
|
|
@@ -1248,9 +1247,9 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
user20 = user20 + space_tmp1;
|
|
user20 = user20 + space_tmp1;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//扫工件码类型scan_type = 1-A面前梁,2-A面后梁;3-B面前梁,4-B面后梁
|
|
//扫工件码类型scan_type = 1-A面前梁,2-A面后梁;3-B面前梁,4-B面后梁
|
|
|
public static void scanBarcode() {
|
|
public static void scanBarcode() {
|
|
|
if(work_status == 1){
|
|
if(work_status == 1){
|
|
@@ -1267,7 +1266,7 @@ public class MesClient extends JFrame {
|
|
|
scanBarcodeTitle = "请扫工件码";
|
|
scanBarcodeTitle = "请扫工件码";
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//弹窗扫工件码
|
|
//弹窗扫工件码
|
|
|
String scanBarcode = JOptionPane.showInputDialog(null, scanBarcodeTitle).trim();
|
|
String scanBarcode = JOptionPane.showInputDialog(null, scanBarcodeTitle).trim();
|
|
|
System.out.println("scanBarcode="+scanBarcode);
|
|
System.out.println("scanBarcode="+scanBarcode);
|
|
@@ -1283,11 +1282,11 @@ public class MesClient extends JFrame {
|
|
|
//1-A面前梁
|
|
//1-A面前梁
|
|
|
product_sn.setText(scanBarcode);
|
|
product_sn.setText(scanBarcode);
|
|
|
f_barcode_1 = barcode36;
|
|
f_barcode_1 = barcode36;
|
|
|
- break;
|
|
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
//刷新界面
|
|
//刷新界面
|
|
|
mesClientFrame.repaint();
|
|
mesClientFrame.repaint();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if(!scanBarcode.isEmpty()) {
|
|
if(!scanBarcode.isEmpty()) {
|
|
|
// 检查工件质量
|
|
// 检查工件质量
|
|
|
if(!connect_request_flag) {
|
|
if(!connect_request_flag) {
|
|
@@ -1311,13 +1310,13 @@ public class MesClient extends JFrame {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//检查用户权限是否可登录界面
|
|
//检查用户权限是否可登录界面
|
|
|
public static void checkUserAuthority(JSONObject retObj) {
|
|
public static void checkUserAuthority(JSONObject retObj) {
|
|
|
//设置登录用户名
|
|
//设置登录用户名
|
|
|
JSONObject userObj = JSONObject.parseObject(retObj.get("user").toString());
|
|
JSONObject userObj = JSONObject.parseObject(retObj.get("user").toString());
|
|
|
String user_id = userObj.getString("id").toString();
|
|
String user_id = userObj.getString("id").toString();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//获取sessionid,判断权限
|
|
//获取sessionid,判断权限
|
|
|
sessionid = retObj.get("sessionid").toString();
|
|
sessionid = retObj.get("sessionid").toString();
|
|
|
if(sessionid!=null&&!sessionid.equalsIgnoreCase("")) {
|
|
if(sessionid!=null&&!sessionid.equalsIgnoreCase("")) {
|
|
@@ -1355,9 +1354,9 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}else {
|
|
}else {
|
|
|
JOptionPane.showMessageDialog(mesClientFrame,"登录失败,用户名或密码错误","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
JOptionPane.showMessageDialog(mesClientFrame,"登录失败,用户名或密码错误","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
return;
|
|
return;
|
|
@@ -1365,14 +1364,14 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void initWarehouseData(){
|
|
public static void initWarehouseData(){
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
resetScanA();
|
|
resetScanA();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//重置A面扫码
|
|
//重置A面扫码
|
|
|
public static void resetScanA() {
|
|
public static void resetScanA() {
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// initWarehouseData();
|
|
// initWarehouseData();
|
|
|
work_status = 0;
|
|
work_status = 0;
|
|
|
check_quality_result = false;
|
|
check_quality_result = false;
|
|
@@ -1409,11 +1408,11 @@ public class MesClient extends JFrame {
|
|
|
MesClient.smStatus = 0;
|
|
MesClient.smStatus = 0;
|
|
|
ModbusUitl.changeEnable(modbusTcp,1); // 禁止启动
|
|
ModbusUitl.changeEnable(modbusTcp,1); // 禁止启动
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//重置B面扫码
|
|
//重置B面扫码
|
|
|
public static void resetScanB() {
|
|
public static void resetScanB() {
|
|
|
status_menu.setText("重新扫码工位B面");
|
|
status_menu.setText("重新扫码工位B面");
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//初始化扫码
|
|
//初始化扫码
|
|
|
// confirm_barcode_bt_2.setEnabled(true);
|
|
// confirm_barcode_bt_2.setEnabled(true);
|
|
|
// f_scan_data_bt_2.setEnabled(true);
|
|
// f_scan_data_bt_2.setEnabled(true);
|