|
@@ -123,7 +123,9 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static Integer lastpage = 0; //标记是否是首次进入设备运行状态,0表示首次进入运行状态,1表示非首次进入运行状态
|
|
public static Integer lastpage = 0; //标记是否是首次进入设备运行状态,0表示首次进入运行状态,1表示非首次进入运行状态
|
|
|
|
|
|
|
|
- public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.7.100");
|
|
|
|
|
|
|
+// public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.7.103"); // CD 北边
|
|
|
|
|
+// public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.0.41"); // AB 中间
|
|
|
|
|
+ public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.7.100"); // 610-P2
|
|
|
|
|
|
|
|
public static List<String> hjparams = new ArrayList<>();
|
|
public static List<String> hjparams = new ArrayList<>();
|
|
|
|
|
|
|
@@ -161,8 +163,6 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static String programNoB = "";
|
|
public static String programNoB = "";
|
|
|
|
|
|
|
|
- public static Boolean op040AutoSubmit = true; // OP040联动提交开关
|
|
|
|
|
-
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
|
// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
@@ -178,10 +178,6 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
JdbcUtils.getConn();
|
|
JdbcUtils.getConn();
|
|
|
|
|
|
|
|
- // 从数据库加载OP040联动提交开关状态
|
|
|
|
|
- String op040Flag = JdbcUtils.getConfig("op040_auto_submit", "true");
|
|
|
|
|
- op040AutoSubmit = op040Flag.equals("true");
|
|
|
|
|
-
|
|
|
|
|
welcomeWin = new LoginFarme();
|
|
welcomeWin = new LoginFarme();
|
|
|
welcomeWin.setVisible(true);
|
|
welcomeWin.setVisible(true);
|
|
|
|
|
|
|
@@ -658,31 +654,6 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
settingMenu.add(resetTcpMenu_1_1sd);
|
|
settingMenu.add(resetTcpMenu_1_1sd);
|
|
|
|
|
|
|
|
- JMenuItem op040SubmitMenu = new JMenuItem("OP040联动提交:" + (op040AutoSubmit ? "开" : "关"));
|
|
|
|
|
- op040SubmitMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- op040SubmitMenu.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
|
|
|
|
|
- op040SubmitMenu.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- String pwd = JOptionPane.showInputDialog(mesClientFrame, "请输入密码");
|
|
|
|
|
- if(pwd != null && pwd.equals("mes123")){
|
|
|
|
|
- op040AutoSubmit = !op040AutoSubmit;
|
|
|
|
|
- JdbcUtils.setConfig("op040_auto_submit", op040AutoSubmit ? "true" : "false");
|
|
|
|
|
- if(op040AutoSubmit){
|
|
|
|
|
- op040SubmitMenu.setText("OP040联动提交:开");
|
|
|
|
|
- MesClient.setMenuStatus("OP040联动提交已开启",0);
|
|
|
|
|
- }else{
|
|
|
|
|
- op040SubmitMenu.setText("OP040联动提交:关");
|
|
|
|
|
- MesClient.setMenuStatus("OP040联动提交已关闭",0);
|
|
|
|
|
- }
|
|
|
|
|
- }else if(pwd != null){
|
|
|
|
|
- MesClient.setMenuStatus("密码错误",-1);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(op040SubmitMenu);
|
|
|
|
|
-
|
|
|
|
|
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);
|
|
@@ -1355,14 +1326,13 @@ public class MesClient extends JFrame {
|
|
|
product_sn2.setText(sn);
|
|
product_sn2.setText(sn);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- MesClient.setMenuStatus("扫码成功,正在查询质量",0);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("扫码成功",0);
|
|
|
|
|
|
|
|
//刷新界面
|
|
//刷新界面
|
|
|
mesClientFrame.repaint();
|
|
mesClientFrame.repaint();
|
|
|
getUser();
|
|
getUser();
|
|
|
- // 查询质量(P02服务端自动建档),成功后进入等待加工状态
|
|
|
|
|
- String barcode36 = getBarcode(sn);
|
|
|
|
|
- Boolean sendret = DataUtil.checkQuality(nettyClient,barcode36,user20,page);
|
|
|
|
|
|
|
+ // 查询工件质量
|
|
|
|
|
+ Boolean sendret = DataUtil.checkQuality(nettyClient,sn,user20,page);
|
|
|
if(!sendret){
|
|
if(!sendret){
|
|
|
MesClient.setMenuStatus("消息发送失败,请重试",1);
|
|
MesClient.setMenuStatus("消息发送失败,请重试",1);
|
|
|
}
|
|
}
|