张田野 4 dni temu
rodzic
commit
b43c51dd93

+ 3 - 2
src/com/mes/ui/DataUtil.java

@@ -165,10 +165,11 @@ public class DataUtil {
             BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
             pro.load(br);
 
-            if(MesClient.mes_gwflag.equals("B")){
+            // 080A机:AB面上传OP080A/OP080B;080B机:AB面上传OP080C/OP080D
+            if(MesClient.mes_gwflag != null && MesClient.mes_gwflag.equals("B")){
                 if(op.equals("A")){
                     op = "C";
-                }else{
+                }else if(op.equals("B")){
                     op = "D";
                 }
             }

+ 4 - 4
src/com/mes/ui/LoginFarme.java

@@ -194,10 +194,10 @@ public class LoginFarme extends JFrame {
                     }
 
                     if(MesClient.jfxPanel2 == null){
-                        String url = "http://"+ MesClient.mes_server_ip+":8980/js/a/mes/mesProcessCheckRecord/ulist?__sid="+MesClient.sessionid+"&oprno="+MesClient.mes_gw+"&lineSn="+MesClient.mes_line_sn;
-                        MesClient.jfxPanel2 = new MesWebView(url);
-                        MesClient.jfxPanel2.setSize(990, 550);
-                        MesClient.indexPanelC.add(MesClient.jfxPanel2);
+//                        String url = "http://"+ MesClient.mes_server_ip+":8980/js/a/mes/mesProcessCheckRecord/ulist?__sid="+MesClient.sessionid+"&oprno="+MesClient.mes_gw+"&lineSn="+MesClient.mes_line_sn;
+//                        MesClient.jfxPanel2 = new MesWebView(url);
+//                        MesClient.jfxPanel2.setSize(990, 550);
+//                        MesClient.indexPanelC.add(MesClient.jfxPanel2);
                     }
 
                     MesClient.initWarehouseData();

+ 49 - 40
src/com/mes/ui/MesClient.java

@@ -135,7 +135,7 @@ public class MesClient extends JFrame {
     public static JPanel indexPanelC;
     public static MesWebView jfxPanel2 = null;
 
-    public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.7.100"); //100 B工位 新设备
+    public static S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.1.1"); //1511 DB200
 
     public static List<String> hjparams = new ArrayList<>();
 
@@ -153,6 +153,8 @@ public class MesClient extends JFrame {
                 try{
                     //鐠囩粯鏋冩禒鍫曞帳缂冿拷
                     readProperty();
+                    s7PLC.setConnectTimeout(1000);
+                    s7PLC.setReceiveTimeout(1000);
 
                     // 閺勫墽銇氶悾宀勬桨
                     mesClientFrame = new MesClient();
@@ -189,13 +191,22 @@ public class MesClient extends JFrame {
         cjTimerText = new Timer();
         cjTimerText.schedule(new TimerTask() {
             public void run() {
-                txtfa.requestFocusInWindow();
+                try{
+                    if(txtfa != null && mesClientFrame != null && mesClientFrame.isDisplayable()){
+                        txtfa.requestFocusInWindow();
+                    }
 
-                MesClient.curPage = PlcUtil.getCurAside(s7PLC);
-                if(MesClient.curPage .equals("A")){
-                    page_text.setText("当前:A面");
-                }else{
-                    page_text.setText("当前:B面");
+                    MesClient.curPage = PlcUtil.getCurAside(s7PLC);
+                    final String pageLabel = MesClient.curPage.equals("A") ? "当前:A面" : "当前:B面";
+                    SwingUtilities.invokeLater(new Runnable() {
+                        public void run() {
+                            if(page_text != null){
+                                page_text.setText(pageLabel);
+                            }
+                        }
+                    });
+                }catch (Exception e){
+                    e.printStackTrace();
                 }
             }
         }, 1000,1000);
@@ -287,11 +298,10 @@ public class MesClient extends JFrame {
         mes_tcp_port = Integer.parseInt(pro.getProperty("mes.tcp_port"));
         mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
         mes_line_sn = pro.getProperty("mes.line_sn");
+        mes_gwflag = pro.getProperty("mes.gwflag");
 
         mes_gw_des = OprnoUtil.getGwDes(mes_line_sn,mes_gw);
 
-        mes_gwflag = pro.getProperty("mes.gwflag");
-
         System.out.println(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";" + mes_tcp_port + ";" + mes_heart_beat_cycle);
     }
 
@@ -910,14 +920,14 @@ public class MesClient extends JFrame {
         lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel.setBounds(26, 340, 100, 40);
-        lblNewLabel.setVisible(false);
+        lblNewLabel.setVisible(true);
         indexPanelA.add(lblNewLabel);
 
         JLabel lblNewLabel_1 = new JLabel("电流");
         lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_1.setBounds(226, 340, 100, 40);
-        lblNewLabel_1.setVisible(false);
+        lblNewLabel_1.setVisible(true);
         indexPanelA.add(lblNewLabel_1);
 
         param1 = new JTextField();
@@ -926,7 +936,7 @@ public class MesClient extends JFrame {
         param1.setHorizontalAlignment(SwingConstants.CENTER);
         param1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param1.setBounds(136, 340, 70, 40);
-        param1.setVisible(false);
+        param1.setVisible(true);
         indexPanelA.add(param1);
         param1.setColumns(10);
 
@@ -937,14 +947,14 @@ public class MesClient extends JFrame {
         param2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param2.setColumns(10);
         param2.setBounds(345, 340, 70, 40);
-        param2.setVisible(false);
+        param2.setVisible(true);
         indexPanelA.add(param2);
 
         JLabel lblNewLabel_2 = new JLabel("送丝速度");
         lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_2.setBounds(26, 401, 100, 40);
-        lblNewLabel_2.setVisible(false);
+        lblNewLabel_2.setVisible(true);
         indexPanelA.add(lblNewLabel_2);
 
         param3 = new JTextField();
@@ -954,14 +964,14 @@ public class MesClient extends JFrame {
         param3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param3.setColumns(10);
         param3.setBounds(136, 401, 70, 40);
-        param3.setVisible(false);
+        param3.setVisible(true);
         indexPanelA.add(param3);
 
         JLabel lblNewLabel_1_1 = new JLabel("错误代码");
         lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_1_1.setBounds(213, 401, 122, 40);
-        lblNewLabel_1_1.setVisible(false);
+        lblNewLabel_1_1.setVisible(true);
         indexPanelA.add(lblNewLabel_1_1);
 
         param4 = new JTextField();
@@ -971,7 +981,7 @@ public class MesClient extends JFrame {
         param4.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param4.setColumns(10);
         param4.setBounds(345, 401, 70, 40);
-        param4.setVisible(false);
+        param4.setVisible(true);
         indexPanelA.add(param4);
 
         param5 = new JTextField();
@@ -981,14 +991,14 @@ public class MesClient extends JFrame {
         param5.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param5.setColumns(10);
         param5.setBounds(226, 470, 70, 40);
-        param5.setVisible(false);
+        param5.setVisible(true);
         indexPanelA.add(param5);
 
         JLabel lblNewLabel_1_1_1 = new JLabel("JOB号");
         lblNewLabel_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_1_1_1.setBounds(106, 470, 122, 40);
-        lblNewLabel_1_1_1.setVisible(false);
+        lblNewLabel_1_1_1.setVisible(true);
         indexPanelA.add(lblNewLabel_1_1_1);
 
         product_sn2 = new JTextField();
@@ -1013,7 +1023,7 @@ public class MesClient extends JFrame {
         lblNewLabel_3.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_3.setBounds(528, 340, 100, 40);
-        lblNewLabel_3.setVisible(false);
+        lblNewLabel_3.setVisible(true);
         indexPanelA.add(lblNewLabel_3);
 
         param21 = new JTextField();
@@ -1023,14 +1033,14 @@ public class MesClient extends JFrame {
         param21.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param21.setColumns(10);
         param21.setBounds(638, 340, 70, 40);
-        param21.setVisible(false);
+        param21.setVisible(true);
         indexPanelA.add(param21);
 
         JLabel lblNewLabel_1_2 = new JLabel("电流");
         lblNewLabel_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_1_2.setBounds(742, 340, 100, 40);
-        lblNewLabel_1_2.setVisible(false);
+        lblNewLabel_1_2.setVisible(true);
         indexPanelA.add(lblNewLabel_1_2);
 
         param22 = new JTextField();
@@ -1040,14 +1050,14 @@ public class MesClient extends JFrame {
         param22.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param22.setColumns(10);
         param22.setBounds(852, 340, 70, 40);
-        param22.setVisible(false);
+        param22.setVisible(true);
         indexPanelA.add(param22);
 
         JLabel lblNewLabel_2_1 = new JLabel("送丝速度");
         lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_2_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_2_1.setBounds(528, 401, 100, 40);
-        lblNewLabel_2_1.setVisible(false);
+        lblNewLabel_2_1.setVisible(true);
         indexPanelA.add(lblNewLabel_2_1);
 
         param23 = new JTextField();
@@ -1057,14 +1067,14 @@ public class MesClient extends JFrame {
         param23.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param23.setColumns(10);
         param23.setBounds(638, 401, 70, 40);
-        param23.setVisible(false);
+        param23.setVisible(true);
         indexPanelA.add(param23);
 
         JLabel lblNewLabel_1_1_2 = new JLabel("错误代码");
         lblNewLabel_1_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_1_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_1_1_2.setBounds(718, 401, 122, 40);
-        lblNewLabel_1_1_2.setVisible(false);
+        lblNewLabel_1_1_2.setVisible(true);
         indexPanelA.add(lblNewLabel_1_1_2);
 
         param24 = new JTextField();
@@ -1074,15 +1084,14 @@ public class MesClient extends JFrame {
         param24.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param24.setColumns(10);
         param24.setBounds(852, 401, 70, 40);
-        param24.setVisible(false);
+        param24.setVisible(true);
         indexPanelA.add(param24);
 
         JLabel lblNewLabel_1_1_1_1 = new JLabel("JOB号");
         lblNewLabel_1_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
         lblNewLabel_1_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         lblNewLabel_1_1_1_1.setBounds(609, 470, 122, 40);
-        lblNewLabel_1_1_1_1.setVisible(false);
-        lblNewLabel_1_1_1_1.setVisible(false);
+        lblNewLabel_1_1_1_1.setVisible(true);
         indexPanelA.add(lblNewLabel_1_1_1_1);
 
         param25 = new JTextField();
@@ -1092,7 +1101,7 @@ public class MesClient extends JFrame {
         param25.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
         param25.setColumns(10);
         param25.setBounds(742, 470, 70, 40);
-        param25.setVisible(false);
+        param25.setVisible(true);
         indexPanelA.add(param25);
 
         pxstatus1 = new JLabel("A");
@@ -1117,15 +1126,15 @@ public class MesClient extends JFrame {
         lblNewLabel_4.setHorizontalAlignment(SwingConstants.CENTER);
         lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 24));
         lblNewLabel_4.setBounds(170, 290, 156, 40);
-        lblNewLabel_4.setVisible(false);
-//        indexPanelA.add(lblNewLabel_4);
+        lblNewLabel_4.setVisible(true);
+        indexPanelA.add(lblNewLabel_4);
 
         JLabel lblNewLabel_4_1 = new JLabel("\u710A\u673A2");
         lblNewLabel_4_1.setHorizontalAlignment(SwingConstants.CENTER);
         lblNewLabel_4_1.setFont(new Font("微软雅黑", Font.PLAIN, 24));
         lblNewLabel_4_1.setBounds(670, 287, 156, 40);
-        lblNewLabel_4_1.setVisible(false);
-//        indexPanelA.add(lblNewLabel_4_1);
+        lblNewLabel_4_1.setVisible(true);
+        indexPanelA.add(lblNewLabel_4_1);
 
         JSeparator separator_1_1 = new JSeparator();
         separator_1_1.setOrientation(SwingConstants.VERTICAL);
@@ -1258,7 +1267,7 @@ public class MesClient extends JFrame {
         scan_type_text.setForeground(new Color(255, 128, 64));
         scan_type_text.setHorizontalAlignment(SwingConstants.LEFT);
         scan_type_text.setFont(new Font("微软雅黑", Font.PLAIN, 20));
-        scan_type_text.setBounds(752, 10, 132, 60);
+        scan_type_text.setBounds(900, 10, 90, 60);
         indexPanelA.add(scan_type_text);
 
         tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
@@ -1271,11 +1280,11 @@ public class MesClient extends JFrame {
         indexPanelGz.setLayout(null);
 
 
-        indexPanelC = new JPanel();
-        searchScrollPaneDj = new JScrollPane(indexPanelC);
-        indexPanelC.setLayout(null);
-
-        tabbedPane.addTab("开班点检", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPaneDj, null);
+//        indexPanelC = new JPanel();
+//        searchScrollPaneDj = new JScrollPane(indexPanelC);
+//        indexPanelC.setLayout(null);
+//
+//        tabbedPane.addTab("开班点检", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPaneDj, null);
 
 
         indexPanelB = new JPanel();

+ 4 - 76
src/com/mes/ui/MesRevice.java

@@ -1,12 +1,8 @@
 package com.mes.ui;
 
 import com.mes.netty.ProtocolParam;
-import com.mes.component.MyDialog;
 import com.mes.util.ErrorMsg;
 
-import javax.swing.*;
-import java.awt.*;
-
 public class MesRevice {
 
     // 质量查询
@@ -15,26 +11,10 @@ public class MesRevice {
             if(processMsgRet.equalsIgnoreCase("UD")) {
                 MesClient.setMenuStatus("该工件可以加工",0);
 
-                String oprno = ProtocolParam.getOprno(mes_msg).trim();
                 String sn = ProtocolParam.getSn(mes_msg).trim();
-                System.out.println(":"+oprno);
-                if(oprno.equals("OP110A")){
-                    String barcode36 = MesClient.getBarcode(sn);//处理36为码
-                    MesClient.getUser();
-                    DataUtil.startWork(MesClient.nettyClient,barcode36,MesClient.user20,"A");
-                }else if(oprno.equals("OP110B")){
-                    String barcode36 = MesClient.getBarcode(sn);//处理36为码
-                    MesClient.getUser();
-                    DataUtil.startWork(MesClient.nettyClient,barcode36,MesClient.user20,"B");
-                }else if(oprno.equals("OP110C")){
-                    String barcode36 = MesClient.getBarcode(sn);//处理36为码
-                    MesClient.getUser();
-                    DataUtil.startWork(MesClient.nettyClient,barcode36,MesClient.user20,"A");
-                }else if(oprno.equals("OP110D")){
-                    String barcode36 = MesClient.getBarcode(sn);//处理36为码
-                    MesClient.getUser();
-                    DataUtil.startWork(MesClient.nettyClient,barcode36,MesClient.user20,"B");
-                }
+                String barcode36 = MesClient.getBarcode(sn);
+                MesClient.getUser();
+                DataUtil.startWork(MesClient.nettyClient,barcode36,MesClient.user20,MesClient.curPage);
 
             }else {
                 if(MesClient.curPage.equals("A")){
@@ -42,7 +22,6 @@ public class MesRevice {
                 }else{
                     MesClient.check_quality_result2 = false;
                 }
-
                 String lmsg = ErrorMsg.getErrorMsg(processMsgRet, mes_msg);
                 MesClient.setMenuStatus(lmsg,-1);
                 PlcUtil.changeEnable(MesClient.s7PLC,false);
@@ -57,10 +36,7 @@ public class MesRevice {
         try{
             if(processMsgRet.equalsIgnoreCase("OK")) {
 
-                String oprno = ProtocolParam.getOprno(mes_msg).trim();
-                String sn = ProtocolParam.getSn(mes_msg).trim();
-
-                if(oprno.equals(MesClient.mes_gw+"A") || oprno.equals(MesClient.mes_gw+"C")){
+                if(MesClient.curPage.equals("A")){
                     MesClient.mesQualityFlagA = true;
                     MesClient.pxstatus1.setText("A:可以加工,等待设备启动");
                     MesClient.curSna = MesClient.product_sn.getText();
@@ -71,9 +47,6 @@ public class MesRevice {
                     MesClient.curSnb = MesClient.product_sn2.getText();
                     MesClient.tjFlagb = 1;
                 }
-//                System.out.println("scan_type1:"+MesClient.scan_type);
-//                MesClient.formatScanType(2);// 1=镭雕码 2=后梁码
-//                System.out.println("scan_type2:"+MesClient.scan_type);
                 PlcUtil.changeEnable(MesClient.s7PLC,true);
 
             }
@@ -87,28 +60,7 @@ public class MesRevice {
         try{
             String craft = ProtocolParam.getCraft(mes_msg);
             if(processMsgRet.equalsIgnoreCase("OK")) {
-//                if(craft.equals("400007")){
-//                    if(MesClient.scan_type == 1){
-//                        MesClient.batch_status = 1;
-//                        MesClient.batch_scan_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
-//                        MesClient.batch_scan_1.setText("解绑");
-//                        MesClient.batch_scan_1.setEnabled(true);
-//                    }else{
-//                        MesClient.batch_status2 = 1;
-//                        MesClient.batch_scan_2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
-//                        MesClient.batch_scan_2.setText("解绑");
-//                        MesClient.batch_scan_2.setEnabled(true);
-//                    }
-//
-//                    PlcUtil.changeEnable(MesClient.s7PLC,true);
-//
-////                    MesClient.formatBatchSn();
-//                }
             }else{
-//                if(craft.equals("400007")){
-//                    JOptionPane.showMessageDialog(MesClient.mesClientFrame,"绑定失败,请重试","提醒", JOptionPane.INFORMATION_MESSAGE);
-//                    return;
-//                }
             }
         }catch (Exception e){
             e.printStackTrace();
@@ -119,28 +71,6 @@ public class MesRevice {
     public static void unbindRevice(String processMsgRet,String mes_msg){
         try{
             String craft = ProtocolParam.getCraft(mes_msg);
-//            if(processMsgRet.equalsIgnoreCase("OK")) {
-//                if(craft.equals("400007")){
-//                    if(MesClient.scan_type == 1){
-//                        MesClient.batch_status = 0;
-//                        MesClient.batch_scan_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
-//                        MesClient.batch_scan_1.setText("扫码");
-//                        MesClient.batch_scan_1.setEnabled(true);
-//                    }else {
-//                        MesClient.batch_status2 = 0;
-//                        MesClient.batch_scan_2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
-//                        MesClient.batch_scan_2.setText("扫码");
-//                        MesClient.batch_scan_2.setEnabled(true);
-//                    }
-//                    PlcUtil.changeEnable(MesClient.s7PLC,false);
-////                    MesClient.formatBatchSn();
-//                }
-//            }else{
-//                if(craft.equals("400007")){
-//                    JOptionPane.showMessageDialog(MesClient.mesClientFrame,"解绑失败,请重试","提醒", JOptionPane.INFORMATION_MESSAGE);
-//                    return;
-//                }
-//            }
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -166,12 +96,10 @@ public class MesRevice {
                 if(sn.equals(MesClient.product_sn.getText())){
                     MesClient.status_menu.setText("A件提交失败");
                     MesClient.pxstatus1.setText("A:提交失败");
-//                    MesClient.finish_ok_bt.setEnabled(true);
                     MesClient.tjStatusa = 1;
                 }else{
                     MesClient.status_menu.setText("B件提交失败");
                     MesClient.pxstatus2.setText("B:提交失败");
-//                    MesClient.finish_ng_bt.setEnabled(true);
                     MesClient.tjStatusb = 1;
                 }
             }

+ 2 - 18
src/com/mes/ui/OprnoUtil.java

@@ -6,27 +6,11 @@ import java.util.Map;
 
 public class OprnoUtil {
     public static String[] xtoprnos = new String[]{
-            "OP040", "OP050", "OP060", "OP070", "OP080",
-            "OP090", "OP100", "OP110", "OP120", "OP130",
-            "OP140", "OP150", "OP160", "OP170", "OP180",
-            "OP190", "OP200", "OP210", "OP220", "OP230",
-            "OP240", "OP250", "OP260", "OP270", "OP280",
-            "OP290", "OP300", "OP310", "OP320", "OP330",
-            "OP340", "OP350", "OP360", "OP370", "OP380",
-            "OP390", "OP400", "OP410", "OP420", "OP430",
-            "OP440", "OP450"
+             "OP110"
     };
 
     public static String[] xtoprnodes = new String[]{
-            "镭雕二维码", "前边梁小总成(焊接)", "前边梁小总成(拉铆)+右边梁小总成(拉铆)", "前边梁小总成气密", "前边梁小总成/左边梁小总成压铆",
-            "前边梁小总成/左边梁小总成涂胶", "框架CMT焊接", "框架CMT焊接", "焊道铣削", "焊道缺陷检验",
-            "框架气密", "总成正面CNC", "总成反面CNC", "框架清洁", "框架涂胶+液冷板安装",
-            "反面铆接", "激光点焊", "水冷板FSW", "清除FSW飞边", "TIG焊接水嘴",
-            "TIG补焊尾孔+封堵片焊接", "总成清洁+涂封堵胶", "涂胶+压套筒", "胶水固化", "正面装配",
-            "反面装配", "半成品气密", "箱体补强件位置涂胶", "安装补强件", "胶水固化",
-            "FSW焊道位置涂胶", "胶水固化", "底护板装配", "复拧螺栓", "成品气密",
-            "液冷板气检", "总成检具", "CCD", "总成清洁", "终检",
-            "GP12", "包装"
+            "框架拼装焊接"
     };
     public static String[] lboprnos = new String[]{
 

+ 25 - 26
src/com/mes/ui/PlcUtil.java

@@ -15,14 +15,14 @@ import java.util.Arrays;
 public class PlcUtil {
 
     public static void getParamDyDl(S7PLC s7PLC){
-        Boolean starta = s7PLC.readBoolean("DB1.2.2"); //A启动中
-        Boolean startb = s7PLC.readBoolean("DB1.2.3"); //B启动中
+        Boolean starta = s7PLC.readBoolean("DB200.0.1"); //进站 A
+        Boolean startb = s7PLC.readBoolean("DB200.38.0"); //进站 B
 
         String oprno = MesClient.mes_gw+"A";
         if(startb){
             oprno = MesClient.mes_gw+"B";
         }
-        if(MesClient.mes_gwflag.equals("B")){
+        if(MesClient.mes_gwflag != null && MesClient.mes_gwflag.equals("B")){
             if(oprno.equals(MesClient.mes_gw+"A")){
                 oprno = MesClient.mes_gw+"C";
             }else{
@@ -31,11 +31,11 @@ public class PlcUtil {
         }
 
         if(MesClient.tjFlaga == 2 || MesClient.tjFlagb == 2){ //运行中
-            Float dya = s7PLC.readFloat32("DB1010.2");
-            Float dla = s7PLC.readFloat32("DB1010.8");
-            Float ssa = s7PLC.readFloat32("DB1010.14");
-            Short cwa = s7PLC.readInt16("DB1010.18");
-            Short joba = s7PLC.readInt16("DB1010.20");
+            Float dya = s7PLC.readFloat32("DB200.84.0"); //R1 焊接电压平均值
+            Float dla = s7PLC.readFloat32("DB200.80.0"); //R1 焊接电流平均值
+            Float ssa = s7PLC.readFloat32("DB200.88.0"); //R1 送丝速度平均值
+            Short cwa = s7PLC.readInt16("DB200.78.0"); //R1 焊道序号
+            Short joba = s7PLC.readInt16("DB200.182.0"); //机器人任务序号 A
 
 //            MesClient.param1.setText(dya+"");
 //            MesClient.param2.setText(dla+"");
@@ -43,11 +43,11 @@ public class PlcUtil {
 //            MesClient.param4.setText(cwa+"");
 //            MesClient.param5.setText(joba+"");
 
-            Float dyb = s7PLC.readFloat32("DB1010.26");
-            Float dlb = s7PLC.readFloat32("DB1010.34");
-            Float ssb = s7PLC.readFloat32("DB1010.42");
-            Short cwb = s7PLC.readInt16("DB1010.46");
-            Short jobb = s7PLC.readInt16("DB1010.48");
+            Float dyb = s7PLC.readFloat32("DB200.104.0"); //R2 焊接电压平均值
+            Float dlb = s7PLC.readFloat32("DB200.100.0"); //R2 焊接电流平均值
+            Float ssb = s7PLC.readFloat32("DB200.108.0"); //R2 送丝速度平均值
+            Short cwb = s7PLC.readInt16("DB200.98.0"); //R2 焊道序号
+            Short jobb = s7PLC.readInt16("DB200.184.0"); //机器人任务序号 B
 
 //            MesClient.param21.setText(dyb+"");
 //            MesClient.param22.setText(dlb+"");
@@ -227,7 +227,7 @@ public class PlcUtil {
     // 获取A启动状态
     public static Boolean getAStart(S7PLC s7PLC){
         try{
-            return s7PLC.readBoolean("DB1.2.2");
+            return s7PLC.readBoolean("DB200.0.1"); //进站 A
         }catch (Exception e){
             e.printStackTrace();
             return false;
@@ -237,8 +237,8 @@ public class PlcUtil {
     // 获取A的结束状态
     public static Boolean getAFinish(S7PLC s7PLC){
         try{
-            boolean a = s7PLC.readBoolean("DB1.2.5");
-            boolean b = s7PLC.readBoolean("DB1.2.6");
+            boolean a = s7PLC.readBoolean("DB200.0.2"); //返回 A
+            boolean b = s7PLC.readBoolean("DB200.38.0"); //进站 B,A当做完成
             return a || b;
         }catch (Exception e){
             e.printStackTrace();
@@ -249,7 +249,7 @@ public class PlcUtil {
     // 获取B启动状态
     public static Boolean getBStart(S7PLC s7PLC){
         try{
-            return s7PLC.readBoolean("DB1.2.6");
+            return s7PLC.readBoolean("DB200.38.0"); //进站 B
         }catch (Exception e){
             e.printStackTrace();
             return false;
@@ -259,8 +259,8 @@ public class PlcUtil {
     // 获取B的结束状态
     public static Boolean getBFinish(S7PLC s7PLC){
         try{
-            boolean a = s7PLC.readBoolean("DB1.2.7");
-            boolean b = s7PLC.readBoolean("DB1.2.4");
+            boolean a = s7PLC.readBoolean("DB200.38.1"); //返回 B
+            boolean b = s7PLC.readBoolean("DB200.0.1"); //进站 A,B当做完成
             return a || b;
         }catch (Exception e){
             e.printStackTrace();
@@ -269,12 +269,11 @@ public class PlcUtil {
     }
 
     // 修改设备的禁用开关
-//    DB9.26.4  MES允许启动信号
+//    MES 使能 A / MES 使能 B
     public static Boolean changeEnable(S7PLC s7PLC,Boolean result){
         try{
-            //DB9.21.7 A//DB9.26.4 B
-            s7PLC.writeBoolean("DB9.23.7",result);
-//            s7PLC.writeBoolean("DB9.21.7",result);
+            s7PLC.writeBoolean("DB200.186.1",result); //MES 使能 A
+            s7PLC.writeBoolean("DB200.186.2",result); //MES 使能 B
             return true;
         }catch (Exception e){
             e.printStackTrace();
@@ -286,11 +285,11 @@ public class PlcUtil {
     public static String getCurAside(S7PLC s7PLC){
         String str = "A";
         try{
-            Boolean ret = s7PLC.readBoolean("DB1.2.0"); // 当前A面
-            if(!ret){
+            Boolean aSide = s7PLC.readBoolean("DB200.156.3"); //A 位置
+            Boolean bSide = s7PLC.readBoolean("DB200.156.4"); //B 位置
+            if(bSide && !aSide){
                 str = "B";
             }
-
         }catch (Exception e){
             e.printStackTrace();
         }

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

@@ -1,6 +1,6 @@
 mes.gw=OP110
 #mes.server_ip=127.0.0.1
-mes.server_ip=192.168.22.99
+mes.server_ip=192.168.15.99
 mes.tcp_port=3000
 mes.heart_beat_cycle=60
 mes.line_sn=XT