chefz il y a 2 semaines
Parent
commit
dac100138c

+ 1 - 1
.project

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>mesclient-op510</name>
+	<name>mesclient-op460</name>
 	<comment></comment>
 	<projects>
 	</projects>

+ 1 - 1
src/com/mes/ui/LoginFrame.java

@@ -24,7 +24,7 @@ public class LoginFrame extends JFrame {
     static JButton scanLoginButton = new JButton("扫  码  登  录");
 
     public LoginFrame() {
-        setTitle("MES系统客户端: OP510接地点检测");
+        setTitle("MES系统客户端: OP460接地点检测");
 
         ImageIcon bg = new ImageIcon(Objects.requireNonNull(MesClient.class.getResource("/background.png")));
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

+ 6 - 5
src/com/mes/ui/MesClient.java

@@ -328,7 +328,7 @@ public class MesClient extends JFrame {
 
     public MesClient() {
         setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
-        setTitle("MES系统客户端: OP510接地点检测");
+        setTitle("MES系统客户端: OP460接地点检测");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setBounds(0, 0, 1024, 768);
 
@@ -545,6 +545,7 @@ public class MesClient extends JFrame {
                         return;
                     }
                     DataUtil.sendQuality(sn, "OK", user20, Config.gw_1);
+                    MesClient.setMenuState_1("结果上传中,请稍候...", 0);
                 }
             }
         });
@@ -567,7 +568,7 @@ public class MesClient extends JFrame {
                         return;
                     }
                     DataUtil.sendQuality(sn, "NG", user20, Config.gw_1);
-
+                    MesClient.setMenuState_1("结果上传中,请稍候...", 0);
                 }
             }
         });
@@ -632,13 +633,13 @@ public class MesClient extends JFrame {
                     int option = JOptionPane.showConfirmDialog(mesClientFrame, "确定切换串口至" + selectedItem + "?", "切换串口", JOptionPane.OK_CANCEL_OPTION);
                     if (option == JOptionPane.OK_OPTION) {
                         // 用户确认切换
-                        log.info("用户切换OP510A串口至 {}", selectedItem);
+                        log.info("用户切换OP460A串口至 {}", selectedItem);
                         currentSerialPort = selectedItem;
                         WorkTimer.serialUtil.serialPort.closePort();
                         WorkTimer.serialUtil = new SerialUtil(selectedItem);
                         resetScanA();
-                        setMenuState_1("切换OP510A串口至" + selectedItem + ",请扫码", 0);
-                        log.info("切换OP510A串口成功");
+                        setMenuState_1("切换OP460A串口至" + selectedItem + ",请扫码", 0);
+                        log.info("切换OP460A串口成功");
                     } else {
                         // 用户取消切换,恢复之前的选项
                         comboBox1.setSelectedItem(currentSerialPort);

+ 6 - 7
src/com/mes/ui/MesRevice.java

@@ -83,17 +83,16 @@ public class MesRevice {
     public static void updateResultRevice(String processMsgRet,String mes_msg){
         try{
             if(processMsgRet.equalsIgnoreCase("OK")) {
-
                 WorkTimer.flag = 0;
                 MesClient.resetScanA();
-                MesClient.setMenuState_1("结果提交成功,请扫下一件",0);
-                MesClient.scanBarcode1();
-
-            }else{
-                MesClient.setMenuState_1("结果提交失败,请重试",-1);
+                javax.swing.SwingUtilities.invokeLater(() ->
+                        MesClient.setMenuState_1("结果提交成功,请扫下一件", 0));
+            } else {
+                javax.swing.SwingUtilities.invokeLater(() ->
+                        MesClient.setMenuState_1("结果提交失败,请重试", -1));
             }
         }catch (Exception e){
-            e.printStackTrace();
+            log.error("上传质量报文回调出现错误", e);
         }
     }
 }

+ 3 - 6
src/com/mes/util/WorkTimer.java

@@ -20,7 +20,7 @@ public class WorkTimer {
 
         if (workTimer1 == null) {
             workTimer1 = new Timer();
-            workTimer1.schedule(new WorkTimerTask1(), 1000, 3000);
+            workTimer1.schedule(new WorkTimerTask1(), 500, 1500);
         }
     }
 
@@ -50,7 +50,6 @@ public class WorkTimer {
                         case 2:
                             String read = serialUtil.read(":source:safety:result:completed?");
                             if ("1".equals(read.trim())) {
-                                flag = 3;
                                 read = serialUtil.read(":source:safety:result:all:judgment?");
                                 log.info("读取参数: {}", read);
                                 if (read.trim().isEmpty()) {
@@ -71,12 +70,10 @@ public class WorkTimer {
 
                                 String sn = MesClient.product_sn_1.getText().trim();
                                 DataUtil.sendQuality(sn, result, MesClient.user20, Config.gw_1);
-                                MesClient.setMenuState_1("测试完成, 结果:" + result, 0);
-
+                                MesClient.setMenuState_1("结果上传中,请稍候...", 0);
+                                flag = 0;
                             }
                             break;
-                        case 3:
-                            flag = 0;
                     }
                 }
             } catch (Exception e) {

+ 2 - 2
src/resources/config/config.properties

@@ -1,4 +1,4 @@
-mes.gw_1=460A
+mes.gw_1=OP460
 #mes.server_ip=127.0.0.1
 mes.server_ip=192.168.15.99
 mes.tcp_port=3000
@@ -7,5 +7,5 @@ mes.heart_beat_cycle=60
 
 mes.line_sn=XT
 
-portName1=COM7
+portName1=COM11