فهرست منبع

Merge branch 'master' of http://121.36.46.135:3000/mes-tw-lf/mesclient-auto

hzd 5 روز پیش
والد
کامیت
c6313c1c03

+ 39 - 18
src/com/mes/component/WorkJPanelDevice.java

@@ -74,7 +74,7 @@ public class WorkJPanelDevice extends JPanel {
 
     public String plcIp = "10.85.10.4";
 
-    public String deviceIp = "10.85.10.1";
+    public String deviceIp = "10.85.10.4";
 
     public S7Connector s7Connector;
 
@@ -137,6 +137,11 @@ public class WorkJPanelDevice extends JPanel {
         this.setBackground(Color.WHITE);
         this.pos = position;
         this.oprno = DataUtil.formatOprno(MesClient.mes_gw);
+
+        // 对于 OP140 和 OP150,增大窗口尺寸以占满主界面
+        int yScale = 1;
+
+
         s7PLC = new S7PLC(EPlcType.S1500, plcIp);
         s7PLC.setConnectTimeout(500);
         s7PLC.setReceiveTimeout(500);
@@ -147,13 +152,13 @@ public class WorkJPanelDevice extends JPanel {
         if(oprno.equals("OP110")){
             if(position.equals("A")){
                 plcDb = "DB4003";
-                deviceIp = "10.85.10.1";
+                deviceIp = "10.85.10.6";
             }else if(position.equals("B")){
                 plcDb = "DB4004";
-                deviceIp = "10.85.10.1";
+                deviceIp = "10.85.10.6";
             } else if (position.equals("C")) {
                 plcDb = "DB4005";
-                deviceIp = "10.85.10.1";
+                deviceIp = "10.85.10.6";
             }
         }else if(oprno.equals("OP170")){
             if(position.equals("A")){
@@ -169,7 +174,7 @@ public class WorkJPanelDevice extends JPanel {
                 plcDb = "DB4015";
                 deviceIp = "10.85.10.3";
             }
-        }else if(oprno.equals("OP190")){
+        }else if(oprno.equals("OP180")){
             if(position.equals("A")){
                 plcDb = "DB4017";
                 deviceIp = "10.85.10.4";
@@ -184,6 +189,22 @@ public class WorkJPanelDevice extends JPanel {
             if(position.equals("A")){
                 plcDb = "DB3011";
             }
+        }else if(oprno.equals("OP140")){
+            if(position.equals("A")){
+//                workWidth = 940;
+//                workHeight = 600;
+//                yScale = 2;
+                plcDb = "DB4008";
+                deviceIp = "10.85.10.2";
+            }
+        }else if(oprno.equals("OP150")){
+            if(position.equals("A")){
+                plcDb = "DB4009";
+                deviceIp = "10.85.10.2";
+            }else if(position.equals("B")){
+                plcDb = "DB4010";
+                deviceIp = "10.85.10.2";
+            }
         }
 
         modbusTcp = new ModbusTcp(1, deviceIp);
@@ -194,14 +215,14 @@ public class WorkJPanelDevice extends JPanel {
         oprnoLabel.setHorizontalAlignment(SwingConstants.CENTER);
         oprnoLabel.setForeground(Color.BLACK);
         oprnoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
-        oprnoLabel.setBounds(0, -10, workWidth/5, 40);
+        oprnoLabel.setBounds(0, -10*yScale, workWidth/5, 40);
         this.add(oprnoLabel);
 
         oprnoLabel2 = new JLabel(fswDeviceName);
         oprnoLabel2.setHorizontalAlignment(SwingConstants.CENTER);
         oprnoLabel2.setForeground(Color.BLACK);
         oprnoLabel2.setFont(new Font("微软雅黑", Font.PLAIN, 14));
-        oprnoLabel2.setBounds(0, 12, workWidth / 5, 40);
+        oprnoLabel2.setBounds(0, 12*yScale, workWidth / 5, 40);
         this.add(oprnoLabel2);
 
         status_menu = new JButton("等待请求扫码");
@@ -216,7 +237,7 @@ public class WorkJPanelDevice extends JPanel {
         oprnoLabelFeeding.setHorizontalAlignment(SwingConstants.CENTER);
         oprnoLabelFeeding.setForeground(Color.BLACK);
         oprnoLabelFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 20));
-        oprnoLabelFeeding.setBounds(0, 50, workWidth/5, 40);
+        oprnoLabelFeeding.setBounds(0, 50*yScale, workWidth/5, 40);
         this.add(oprnoLabelFeeding);
 
         productSnFeeding = new JTextField("");
@@ -224,7 +245,7 @@ public class WorkJPanelDevice extends JPanel {
         productSnFeeding.setForeground(Color.BLACK);
         productSnFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 16));
         productSnFeeding.setEditable(false);
-        productSnFeeding.setBounds(workWidth/5, 50, workWidth*3/5, 40);
+        productSnFeeding.setBounds(workWidth/5, 50*yScale, workWidth*3/5, 40);
         productSnFeeding.addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent e) {
                 String sn = productSnFeeding.getText().trim();
@@ -247,7 +268,7 @@ public class WorkJPanelDevice extends JPanel {
             }
         });
         resetFeedingBtn.setFont(new Font("微软雅黑", Font.PLAIN, 22));
-        resetFeedingBtn.setBounds(workWidth*4/5 + 10, 50, workWidth/5 - 10, 40);
+        resetFeedingBtn.setBounds(workWidth*4/5 + 10, 50*yScale, workWidth/5 - 10, 40);
         this.add(resetFeedingBtn);
 
         JLabel oprnoLabelWork = new JLabel("加工");
@@ -296,7 +317,7 @@ public class WorkJPanelDevice extends JPanel {
             }
         });
         checkBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
-        checkBtn.setBounds(0, 220, workWidth/4, 35);
+        checkBtn.setBounds(0, 220*yScale, workWidth/4, 35);
         this.add(checkBtn);
 
         historyBtn = new JButton("工作记录");
@@ -306,7 +327,7 @@ public class WorkJPanelDevice extends JPanel {
             }
         });
         historyBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
-        historyBtn.setBounds(workWidth*3/4, 220, workWidth/4, 35);
+        historyBtn.setBounds(workWidth*3/4, 220*yScale, workWidth/4, 35);
         this.add(historyBtn);
 
         if(oprno.equals("OP160") || oprno.equals("OP170")){
@@ -317,7 +338,7 @@ public class WorkJPanelDevice extends JPanel {
                 }
             });
             toolBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
-            toolBtn.setBounds(workWidth*1/2 - workWidth/8, 220, workWidth/4, 35);
+            toolBtn.setBounds(workWidth*1/2 - workWidth/8, 220*yScale, workWidth/4, 35);
             this.add(toolBtn);
         }
 
@@ -331,14 +352,14 @@ public class WorkJPanelDevice extends JPanel {
         feedinglabel.setHorizontalAlignment(SwingConstants.LEFT);
         feedinglabel.setIcon(imageGreen);
         feedinglabel.setForeground(Color.BLACK);
-        feedinglabel.setBounds(0, 120, workWidth/3, 30);
+        feedinglabel.setBounds(0, 120*yScale, workWidth/3, 30);
         this.add(feedinglabel);
 
         feedingmeslabel = new JLabel("MES允许上料");
         feedingmeslabel.setHorizontalAlignment(SwingConstants.LEFT);
         feedingmeslabel.setIcon(imageGreen);
         feedingmeslabel.setForeground(Color.BLACK);
-        feedingmeslabel.setBounds(workWidth/3, 120, workWidth/3, 30);
+        feedingmeslabel.setBounds(workWidth/3, 120*yScale, workWidth/3, 30);
         feedingmeslabel.addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent e) {
                 boolean ret = readAllowFeeding();
@@ -354,21 +375,21 @@ public class WorkJPanelDevice extends JPanel {
         runlabel.setHorizontalAlignment(SwingConstants.LEFT);
         runlabel.setIcon(imageGreen);
         runlabel.setForeground(Color.BLACK);
-        runlabel.setBounds(workWidth*2/3, 120, workWidth/3, 30);
+        runlabel.setBounds(workWidth*2/3, 120*yScale, workWidth/3, 30);
         this.add(runlabel);
 
         blankinglabel = new JLabel("下料请求");
         blankinglabel.setHorizontalAlignment(SwingConstants.LEFT);
         blankinglabel.setIcon(imageGreen);
         blankinglabel.setForeground(Color.BLACK);
-        blankinglabel.setBounds(0, 160, workWidth/3, 30);
+        blankinglabel.setBounds(0, 160*yScale, workWidth/3, 30);
         this.add(blankinglabel);
 
         blankingmeslabel = new JLabel("MES下料反馈");
         blankingmeslabel.setHorizontalAlignment(SwingConstants.LEFT);
         blankingmeslabel.setIcon(imageGreen);
         blankingmeslabel.setForeground(Color.BLACK);
-        blankingmeslabel.setBounds(workWidth/3, 160, workWidth/3, 30);
+        blankingmeslabel.setBounds(workWidth/3, 160*yScale, workWidth/3, 30);
         this.add(blankingmeslabel);
         blankingmeslabel.addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent e) {

+ 26 - 2
src/com/mes/ui/MesClient.java

@@ -337,7 +337,7 @@ public class MesClient extends JFrame {
         //首页
         JPanel indexPanelA = new JPanel();
         indexScrollPaneA = new JScrollPane(indexPanelA);
-        if(mes_gw.equals("OP220")){
+        if(mes_gw.equals("OP220") || mes_gw.equals("OP140") || mes_gw.equals("OP150")){
             indexPanelA.setLayout(new GridLayout(1,1, 5, 5));
         }else{
             indexPanelA.setLayout(new GridLayout(2,2, 5, 5));
@@ -401,7 +401,7 @@ public class MesClient extends JFrame {
             workJPanelDeviceD.setBounds(10, 10, workJPanelDeviceD.workWidth, workJPanelDeviceD.workHeight);
             indexPanel20D.add(workJPanelDeviceD);
             indexPanelA.add(indexPanel20D);
-        }else if(mes_gw.equals("OP190")){
+        }else if(mes_gw.equals("OP180")){
             JPanel indexPanel20A = new JPanel();
             indexPanel20A.setLayout(null);
             indexPanel20A.setBackground(Color.WHITE);
@@ -425,6 +425,30 @@ public class MesClient extends JFrame {
             workJPanelDeviceC.setBounds(10, 10, workJPanelDeviceC.workWidth, workJPanelDeviceC.workHeight);
             indexPanel20C.add(workJPanelDeviceC);
             indexPanelA.add(indexPanel20C);
+        } else if(mes_gw.equals("OP140")) {
+            JPanel indexPanel20A = new JPanel();
+            indexPanel20A.setLayout(null);
+            indexPanel20A.setBackground(Color.WHITE);
+            workJPanelDeviceA = new WorkJPanelDevice("A");
+            workJPanelDeviceA.setBounds(10, 10, workJPanelDeviceA.workWidth, workJPanelDeviceA.workHeight);
+            indexPanel20A.add(workJPanelDeviceA);
+            indexPanelA.add(indexPanel20A);
+        }else if(mes_gw.equals("OP150")) {
+            JPanel indexPanel20A = new JPanel();
+            indexPanel20A.setLayout(null);
+            indexPanel20A.setBackground(Color.WHITE);
+            workJPanelDeviceA = new WorkJPanelDevice("A");
+            workJPanelDeviceA.setBounds(10, 10, workJPanelDeviceA.workWidth, workJPanelDeviceA.workHeight);
+            indexPanel20A.add(workJPanelDeviceA);
+            indexPanelA.add(indexPanel20A);
+
+            JPanel indexPanel20B = new JPanel();
+            indexPanel20B.setLayout(null);
+            indexPanel20B.setBackground(Color.WHITE);
+            workJPanelDeviceB = new WorkJPanelDevice("B");
+            workJPanelDeviceB.setBounds(10, 10, workJPanelDeviceB.workWidth, workJPanelDeviceB.workHeight);
+            indexPanel20B.add(workJPanelDeviceB);
+            indexPanelA.add(indexPanel20B);
         }
 
         tabbedPane.addTab("工作面板", null, indexScrollPaneA, null);

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

@@ -5,10 +5,10 @@ import java.util.List;
 
 public class OprnoUtil {
     public static String[] xtoprnos = new String[]{
-            "OP110", "OP170", "OP220", "OP190",
+            "OP110","OP140","OP150", "OP170", "OP220", "OP180",
     };
     public static String[] xtoprnodes = new String[]{
-            "框架反面CNC", "总成反面CNC", "激光点焊", "总成正面CNC"
+            "框架反面CNC","液冷板点焊+水嘴焊接","液冷板FSW", "总成反面CNC", "激光点焊", "总成正面CNC"
     };
     public static String[] lboprnos = new String[]{
 

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

@@ -1,5 +1,5 @@
 mes.server_ip=127.0.0.1
 #mes.server_ip=192.168.14.99
 mes.line_sn=XT
-mes.gw=OP190
+mes.gw=OP110
 mes.line_pos=west