hfy преди 2 седмици
родител
ревизия
d152af9c03
променени са 2 файла, в които са добавени 369 реда и са изтрити 124 реда
  1. 289 93
      src/com/mes/ui/WorkStationPanel.java
  2. 80 31
      src/com/mes/util/PLCUtils.java

+ 289 - 93
src/com/mes/ui/WorkStationPanel.java

@@ -12,13 +12,21 @@ import javax.swing.border.TitledBorder;
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.util.ArrayList;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Timer;
 import java.util.TimerTask;
 
 public class WorkStationPanel extends JPanel {
     private static final Logger log = LoggerFactory.getLogger(WorkStationPanel.class);
+    private static final long PLC_STATUS_REFRESH_INTERVAL_MS = 3000L;
+    private static final long PLC_STATUS_RETRY_BACKOFF_MS = 10000L;
+    private static final long PLC_STATUS_WARN_INTERVAL_MS = 30000L;
+    private static final long PLC_WORKFLOW_WARN_INTERVAL_MS = 30000L;
     private String gw;
     private String gwDes;
     private String lineSn;
@@ -45,10 +53,18 @@ public class WorkStationPanel extends JPanel {
     private JLabel statusLabel;
     private JLabel heartBeatLabel;
     private JLabel fxLabel;
+    private final Map<String, JLabel> plcStatusDots = new LinkedHashMap<>();
+    private final Map<String, Boolean> plcStatusValues = new LinkedHashMap<>();
     public static Object[][] rowData = null;
     
     private Timer heartBeatTimer;
     private Timer getSnBeatTimer;
+    private Timer plcStatusTimer;
+    private int plcStatusReadFailCount = 0;
+    private long nextPlcStatusReadTime = 0L;
+    private long lastPlcStatusWarnTime = 0L;
+    private int plcWorkflowFailCount = 0;
+    private long lastPlcWorkflowWarnTime = 0L;
 
     private boolean iconREDFlag = true;
 
@@ -63,6 +79,7 @@ public class WorkStationPanel extends JPanel {
         this.stopMethod = stopMethod;
         initUI();
         startHeartBeatTimer();
+        startPlcStatusTimer();
         startGetCurSn();
     }
 
@@ -78,6 +95,7 @@ public class WorkStationPanel extends JPanel {
         this.stationConfig = stationConfig;
         initUI();
         startHeartBeatTimer();
+        startPlcStatusTimer();
         startGetCurSn();
     }
 
@@ -203,6 +221,10 @@ public class WorkStationPanel extends JPanel {
         buttonPanel.add(finishNgButton);
 
         centerPanel.add(buttonPanel);
+
+        JPanel plcStatusPanel = createPlcStatusPanel();
+        centerPanel.add(plcStatusPanel);
+
         add(centerPanel, BorderLayout.CENTER);
 
         JPanel bottomPanel = new JPanel(new BorderLayout());
@@ -242,19 +264,129 @@ public class WorkStationPanel extends JPanel {
         add(bottomPanel, BorderLayout.SOUTH);
     }
 
-    private void scanBarcode() {
-        if (workStatus == 1) {
-            JOptionPane.showMessageDialog(this, "[" + gw + "] 工作中,勿扫码", "提示", JOptionPane.INFORMATION_MESSAGE);
+    private JPanel createPlcStatusPanel() {
+        JPanel plcStatusPanel = new JPanel(new GridLayout(3, 1, 0, 3));
+        plcStatusPanel.setBackground(Color.WHITE);
+        plcStatusPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
+
+        JPanel firstLine = createPlcStatusLine();
+        addPlcStatusItem(firstLine, "allowStart", "允许启动", true);
+        addPlcStatusItem(firstLine, "allowDown", "允许下料", true);
+        plcStatusPanel.add(firstLine);
+
+        JPanel secondLine = createPlcStatusLine();
+        addPlcStatusItem(secondLine, "start", "开始加工", false);
+        addPlcStatusItem(secondLine, "finish", "加工结束", false);
+        plcStatusPanel.add(secondLine);
+
+        JPanel thirdLine = createPlcStatusLine();
+        addPlcStatusItem(thirdLine, "fault", "故障", false);
+        plcStatusPanel.add(thirdLine);
+        return plcStatusPanel;
+    }
+
+    private JPanel createPlcStatusLine() {
+        JPanel linePanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 14, 0));
+        linePanel.setBackground(Color.WHITE);
+        return linePanel;
+    }
+
+    private void addPlcStatusItem(JPanel parent, final String key, String title, boolean clickable) {
+        JPanel itemPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 4, 0));
+        itemPanel.setBackground(Color.WHITE);
+
+        JLabel titleLabel = new JLabel(title);
+        titleLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        titleLabel.setPreferredSize(new Dimension(62, 20));
+        titleLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+        itemPanel.add(titleLabel);
+
+        JLabel dotLabel = new JLabel(greyDotIcon());
+        dotLabel.setPreferredSize(new Dimension(20, 20));
+        if (clickable) {
+            dotLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+            titleLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+            MouseAdapter adapter = new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    toggleWritablePlcStatus(key);
+                }
+            };
+            dotLabel.addMouseListener(adapter);
+            titleLabel.addMouseListener(adapter);
+        }
+        itemPanel.add(dotLabel);
+
+        plcStatusDots.put(key, dotLabel);
+        plcStatusValues.put(key, false);
+        parent.add(itemPanel);
+    }
+
+    private ImageIcon greenDotIcon() {
+        return new ImageIcon(getClass().getResource("/bg/green_dot.png"));
+    }
+
+    private ImageIcon greyDotIcon() {
+        return new ImageIcon(getClass().getResource("/bg/grey_dot.png"));
+    }
+
+    private void toggleWritablePlcStatus(final String key) {
+        if (stationConfig == null) {
+            JOptionPane.showMessageDialog(this, "未加载PLC工位配置,无法切换状态", "提示", JOptionPane.WARNING_MESSAGE);
             return;
         }
-        
-        String scanBarcode = JOptionPane.showInputDialog(null, "[" + gw + "] 请扫工件码");
-        if (scanBarcode != null && !scanBarcode.isEmpty()) {
-            productSnField.setText(scanBarcode);
-            checkQuality(scanBarcode);
+
+        final boolean newValue = !Boolean.TRUE.equals(plcStatusValues.get(key));
+        String statusName = "allowStart".equals(key) ? "允许启动" : "允许下料";
+        String actionName = newValue ? "开启" : "关闭";
+        int confirm = JOptionPane.showConfirmDialog(
+                this,
+                "确定要" + actionName + "【" + statusName + "】吗?",
+                "确认更改",
+                JOptionPane.YES_NO_OPTION,
+                JOptionPane.QUESTION_MESSAGE);
+        if (confirm != JOptionPane.YES_OPTION) {
+            return;
+        }
+
+        setPlcStatusDot(key, newValue);
+
+        SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
+            @Override
+            protected Boolean doInBackground() {
+                if ("allowStart".equals(key)) {
+                    return PLCUtils.writeAllowStart(stationConfig, newValue);
+                }
+                if ("allowDown".equals(key)) {
+                    return PLCUtils.writeAllowDown(stationConfig, newValue);
+                }
+                return false;
+            }
+
+            @Override
+            protected void done() {
+                try {
+                    if (!get()) {
+                        setPlcStatusDot(key, !newValue);
+                    }
+                } catch (Exception ex) {
+                    setPlcStatusDot(key, !newValue);
+                    JOptionPane.showMessageDialog(WorkStationPanel.this, "PLC状态切换失败:" + ex.getMessage(), "错误", JOptionPane.ERROR_MESSAGE);
+                }
+            }
+        };
+        worker.execute();
+    }
+
+    private void setPlcStatusDot(String key, boolean value) {
+        plcStatusValues.put(key, value);
+        JLabel dot = plcStatusDots.get(key);
+        if (dot != null) {
+            dot.setIcon(value ? greenDotIcon() : greyDotIcon());
         }
     }
 
+
     private void checkQuality(String sn) {
         JSONObject retObj = DataUtil.checkQuality(sn, currentUser, gw, lineSn, serverIp);
         if (retObj != null && "true".equalsIgnoreCase(retObj.getString("result"))) {
@@ -380,6 +512,52 @@ public class WorkStationPanel extends JPanel {
         }, 100, 1000);
     }
 
+    private void startPlcStatusTimer() {
+        if (plcStatusTimer != null) {
+            plcStatusTimer.cancel();
+        }
+        plcStatusTimer = new Timer();
+        long initialDelay = 500L + Math.abs(gw == null ? 0 : gw.hashCode() % 2000);
+        plcStatusTimer.schedule(new TimerTask() {
+            @Override
+            public void run() {
+                refreshPlcStatus();
+            }
+        }, initialDelay, PLC_STATUS_REFRESH_INTERVAL_MS);
+    }
+
+    private void refreshPlcStatus() {
+        if (stationConfig == null) {
+            return;
+        }
+        long now = System.currentTimeMillis();
+        if (now < nextPlcStatusReadTime) {
+            return;
+        }
+        try {
+            final PLCUtils.StationStatus status = PLCUtils.readStationStatus(stationConfig);
+            plcStatusReadFailCount = 0;
+            nextPlcStatusReadTime = 0L;
+            SwingUtilities.invokeLater(new Runnable() {
+                @Override
+                public void run() {
+                    setPlcStatusDot("allowStart", status.isAllowStart());
+                    setPlcStatusDot("allowDown", status.isAllowDown());
+                    setPlcStatusDot("start", status.isStart());
+                    setPlcStatusDot("finish", status.isFinish());
+                    setPlcStatusDot("fault", status.isFault());
+                }
+            });
+        } catch (Exception e) {
+            plcStatusReadFailCount++;
+            nextPlcStatusReadTime = now + PLC_STATUS_RETRY_BACKOFF_MS;
+            if (now - lastPlcStatusWarnTime >= PLC_STATUS_WARN_INTERVAL_MS) {
+                lastPlcStatusWarnTime = now;
+                log.warn("读取PLC状态失败,工位={},连续失败{}次,{}ms后重试", gw, plcStatusReadFailCount, PLC_STATUS_RETRY_BACKOFF_MS, e);
+            }
+        }
+    }
+
     private void startGetCurSn(){
         if (getSnBeatTimer != null) {
             getSnBeatTimer.cancel();
@@ -388,104 +566,122 @@ public class WorkStationPanel extends JPanel {
         getSnBeatTimer.schedule(new TimerTask() {
             @Override
             public void run() {
-                if (workStatus == 1) {
-                    // TODO
-                    //  加入工作流程
-                    if (plcStatus == 0){
-                        // 等待扫码
-                        String sn = productSnField.getText().trim();
-                        if (!sn.isEmpty()) {
-                            plcStatus = 1;
-                        }
-                    } else if (plcStatus == 1) {
-                        // 发送允许启动信号
-                        Boolean ret = PLCUtils.writeStartMethod(stationConfig);
-                        if (ret) {
-                            plcStatus = 2;
-                        }
-                    } else if (plcStatus == 2) {
-                        // 等待开始加工信号
-                        Boolean ret = PLCUtils.readStartMethod(stationConfig);
-                        if (ret){
-                            // 将允许启动置空
-                            boolean ret2 = PLCUtils.writeStopMethod(stationConfig);
-                            if (ret2){
-                                plcStatus = 3;
-                            }
-                        }
-                    } else if (plcStatus ==3) {
-                        // 等待加工结束信号
-                        Boolean ret = PLCUtils.readStopMethod(stationConfig);
-                        if (ret){
-                            // 发送结果
-                            String sn = productSnField.getText().trim();
-                            if (lastWeldingParamContent == null || lastWeldingParamContent.trim().isEmpty()) {
-                                lastWeldingParamContent = PLCUtils.getWeldingParamContent(stationConfig);
-                            }
-                            JSONObject retObj = DataUtil.sendQuality( sn,"OK", currentUser, gw, lineSn, serverIp);
-                            if (retObj != null && "true".equalsIgnoreCase(retObj.getString("result"))) {
-                                if (lastWeldingParamContent != null && !lastWeldingParamContent.trim().isEmpty()) {
-                                    JSONObject saveParamRet = DataUtil.saveWeldingParams(sn, gw, lineSn, serverIp, lastWeldingParamContent);
-                                    if (saveParamRet == null || !"true".equalsIgnoreCase(saveParamRet.getString("result"))) {
-                                        log.warn("焊接参数上传失败,工位={}, 工件码={}", gw, sn);
-                                    }
-                                }
-                                // 发送允许下料
-                                PLCUtils.writeDownMethod(stationConfig);
-                                statusLabel.setForeground(Color.GREEN);
-                                statusLabel.setText("结果提交成功,请扫下一件");
-                                finishNgButton.setEnabled(false);
-                                plcStatus = 4;
-                            } else {
-                                statusLabel.setForeground(Color.RED);
-                                String msg = (retObj != null && retObj.containsKey("message")) ? retObj.getString("message") : "提交失败";
-                                statusLabel.setText(msg);
-                            }
-                        }else {
-                            // 获取参数
-                            lastWeldingParamContent = PLCUtils.getWeldingParamContent(stationConfig);
-                            hjparams = new ArrayList<>();
-                            if (lastWeldingParamContent != null && !lastWeldingParamContent.trim().isEmpty()) {
-                                hjparams.add(lastWeldingParamContent);
+                runWorkFlowSafely();
+            }
+
+        }, 100, 1000);
+    }
+
+    private void runWorkFlowSafely() {
+        try {
+            runWorkFlow();
+            plcWorkflowFailCount = 0;
+        } catch (Exception e) {
+            handleWorkflowException(e);
+        }
+    }
+
+    private void runWorkFlow() {
+        if (workStatus == 1) {
+            if (plcStatus == 0){
+                // 等待扫码
+                String sn = productSnField.getText().trim();
+                if (!sn.isEmpty()) {
+                    plcStatus = 1;
+                }
+            } else if (plcStatus == 1) {
+                // 质量检查合格后,发送允许启动信号。
+                Boolean ret = PLCUtils.writeStartMethod(stationConfig);
+                if (ret) {
+                    statusLabel.setForeground(Color.GREEN);
+                    statusLabel.setText("已允许启动,等待开始加工");
+                    plcStatus = 2;
+                }
+            } else if (plcStatus == 2) {
+                // 等待开始加工信号为 true,收到后将允许启动置为 false。
+                Boolean ret = PLCUtils.readStartMethod(stationConfig);
+                System.out.println("开始加工信号"+stationConfig.getGw()+ret);
+                if (ret){
+                    boolean ret2 = PLCUtils.writeStopMethod(stationConfig);
+                    if (ret2) {
+                        statusLabel.setForeground(Color.GREEN);
+                        statusLabel.setText("加工中,等待加工结束");
+                        plcStatus = 3;
+                    }
+                }
+            } else if (plcStatus ==3) {
+                // 等待加工结束信号为 true,提交结果后发送允许下料信号。
+                Boolean ret = PLCUtils.readStopMethod(stationConfig);
+                if (ret){
+                    // 发送结果
+                    String sn = productSnField.getText().trim();
+                    if (lastWeldingParamContent == null || lastWeldingParamContent.trim().isEmpty()) {
+                        lastWeldingParamContent = PLCUtils.getWeldingParamContent(stationConfig);
+                        log.info("PLC中读取"+lastWeldingParamContent);
+                    }
+                    JSONObject retObj = DataUtil.sendQuality( sn,"OK", currentUser, gw, lineSn, serverIp);
+                    if (retObj != null && "true".equalsIgnoreCase(retObj.getString("result"))) {
+                        if (lastWeldingParamContent != null && !lastWeldingParamContent.trim().isEmpty()) {
+                            JSONObject saveParamRet = DataUtil.saveWeldingParams(sn, gw, lineSn, serverIp, lastWeldingParamContent);
+                            if (saveParamRet == null || !"true".equalsIgnoreCase(saveParamRet.getString("result"))) {
+                                log.warn("焊接参数上传失败,工位={}, 工件码={}", gw, sn);
                             }
                         }
-                    }else if (plcStatus == 4){
-                        // 等待加工结束为空
-                        Boolean ret = PLCUtils.readStopMethod(stationConfig);
-                        if (!ret){
-                            PLCUtils.writeDownStopMethod(stationConfig);
-                            resetState();
+                        Boolean downRet = PLCUtils.writeDownMethod(stationConfig);
+                        if (downRet) {
+                            statusLabel.setForeground(Color.GREEN);
+                            statusLabel.setText("已允许下料,等待加工结束信号复位");
+                            finishOkButton.setEnabled(false);
+                            finishNgButton.setEnabled(false);
+                            plcStatus = 4;
                         }
+                    } else {
+                        statusLabel.setForeground(Color.RED);
+                        String msg = (retObj != null && retObj.containsKey("message")) ? retObj.getString("message") : "提交失败";
+                        statusLabel.setText(msg);
                     }
-
-                    return;
-                } else if (workStatus == 0) {
-                    JSONObject result = DataUtil.getCurSn(gw, serverIp, lineSn);
-                    // 正常处理结果
-                    if (result.containsKey("data")) {
-                        String data = result.getString("data");
-                        if (data != null && !data.isEmpty()) {
-                            productSnField.setText(data);
-                            checkQuality(data);
-                        } else {
-                            JOptionPane.showMessageDialog(WorkStationPanel.this, "获取工件码为空", "提示", JOptionPane.INFORMATION_MESSAGE);
-                        }
+                }else {
+                    // 获取参数
+                    lastWeldingParamContent = PLCUtils.getWeldingParamContent(stationConfig);
+                    hjparams = new ArrayList<>();
+                    if (lastWeldingParamContent != null && !lastWeldingParamContent.trim().isEmpty()) {
+                        hjparams.add(lastWeldingParamContent);
                     }
                 }
+            }else if (plcStatus == 4){
+                // 等待加工结束信号为 false,收到后将允许下料置为 false。
+                Boolean ret = PLCUtils.readStopMethod(stationConfig);
+                if (!ret){
+                    PLCUtils.writeDownStopMethod(stationConfig);
+                    resetState();
+                }
             }
 
-        }, 100, 1000);
+            return;
+        } else if (workStatus == 0) {
+            JSONObject result = DataUtil.getCurSn(gw, serverIp, lineSn);
+            // 正常处理结果
+            if (result.containsKey("data")) {
+                String data = result.getString("data");
+                if (data != null && !data.isEmpty()) {
+                    productSnField.setText(data);
+                    checkQuality(data);
+                } else {
+                    JOptionPane.showMessageDialog(WorkStationPanel.this, "获取工件码为空", "提示", JOptionPane.INFORMATION_MESSAGE);
+                }
+            }
+        }
     }
 
-    public void stopHeartBeat() {
-        if (heartBeatTimer != null) {
-            heartBeatTimer.cancel();
+    private void handleWorkflowException(Exception e) {
+        plcWorkflowFailCount++;
+        long now = System.currentTimeMillis();
+        if (now - lastPlcWorkflowWarnTime >= PLC_WORKFLOW_WARN_INTERVAL_MS) {
+            lastPlcWorkflowWarnTime = now;
+            log.warn("PLC自动流程执行失败,工位={},流程状态={},连续失败{}次,下次继续等待", gw, plcStatus, plcWorkflowFailCount, e);
         }
     }
 
-    public String getGw() {
-        return gw;
-    }
 
     public void setCurrentUser(String user) {
         this.currentUser = user;

+ 80 - 31
src/com/mes/util/PLCUtils.java

@@ -85,6 +85,78 @@ public class PLCUtils {
         return true;
     }
 
+    public static boolean readAllowStart(StationConfig config) {
+        return readBoolean(config, config.getAllowStart());
+    }
+
+    public static boolean writeAllowStart(StationConfig config, boolean value) {
+        writeBoolean(config, config.getAllowStart(), value);
+        return true;
+    }
+
+    public static boolean readAllowDown(StationConfig config) {
+        return readBoolean(config, config.getAllowDown());
+    }
+
+    public static boolean writeAllowDown(StationConfig config, boolean value) {
+        writeBoolean(config, config.getAllowDown(), value);
+        return true;
+    }
+
+    public static boolean readFault(StationConfig config) {
+        return readBoolean(config, config.getFault());
+    }
+
+    public static StationStatus readStationStatus(StationConfig config) {
+        McPLC plc = createPlc(config);
+        try {
+            return new StationStatus(
+                    readBoolean(plc, config, config.getAllowStart()),
+                    readBoolean(plc, config, config.getAllowDown()),
+                    readBoolean(plc, config, config.getStartMethod()),
+                    readBoolean(plc, config, config.getStopMethod()),
+                    readBoolean(plc, config, config.getFault()));
+        } finally {
+            plc.close();
+        }
+    }
+
+    public static class StationStatus {
+        private final boolean allowStart;
+        private final boolean allowDown;
+        private final boolean start;
+        private final boolean finish;
+        private final boolean fault;
+
+        public StationStatus(boolean allowStart, boolean allowDown, boolean start, boolean finish, boolean fault) {
+            this.allowStart = allowStart;
+            this.allowDown = allowDown;
+            this.start = start;
+            this.finish = finish;
+            this.fault = fault;
+        }
+
+        public boolean isAllowStart() {
+            return allowStart;
+        }
+
+        public boolean isAllowDown() {
+            return allowDown;
+        }
+
+        public boolean isStart() {
+            return start;
+        }
+
+        public boolean isFinish() {
+            return finish;
+        }
+
+        public boolean isFault() {
+            return fault;
+        }
+    }
+
     // 旧调用保留,不读取任何工位参数。
     public static void getParameter() {
         getParameter((StationConfig) null);
@@ -157,27 +229,21 @@ public class PLCUtils {
 
     // 读取单个 M 点状态,例如开始加工、加工结束。
     private static boolean readBoolean(StationConfig config, String address) {
-        if (isEmpty(address)) {
-            log.warn("PLC读取跳过:点位地址为空,工位={}", config == null ? "" : config.getGw());
-            return false;
-        }
-
         McPLC plc = createPlc(config);
         try {
-            return plc.readBoolean(address);
+            return readBoolean(plc, config, address);
         } finally {
             plc.close();
         }
     }
 
-    // 弧焊参数:目前只读电流、电压。倍率在这里统一换算,后面存储可直接用。
-    private static List<String> readArcWeldParams(McPLC plc, StationConfig config) {
-        List<String> values = baseValues(config, "弧焊");
-        addScaledInt16(plc, values, "1号机器人电流", config.getRobot1Current(), 1, false);
-        addScaledInt16(plc, values, "1号机器人电压", config.getRobot1Voltage(), 10, false);
-        addScaledInt16(plc, values, "2号机器人电流", config.getRobot2Current(), 1, false);
-        addScaledInt16(plc, values, "2号机器人电压", config.getRobot2Voltage(), 10, false);
-        return values;
+    private static boolean readBoolean(McPLC plc, StationConfig config, String address) {
+        if (isEmpty(address)) {
+            log.warn("PLC读取跳过:点位地址为空,工位={}", config == null ? "" : config.getGw());
+            return false;
+        }
+
+        return plc.readBoolean(address);
     }
 
     private static JSONObject buildArcWeldContent(McPLC plc, StationConfig config) {
@@ -194,23 +260,6 @@ public class PLCUtils {
         content.put("samples", samples);
         return content;
     }
-
-    // 点焊参数:先读焊接开始/完成数量,再读压力、电流、时间。
-    private static List<String> readSpotWeldParams(McPLC plc, StationConfig config) {
-        List<String> values = baseValues(config, "点焊");
-        values.add("1号机器人焊接开始数量=" + countTrue(plc.readBoolean(config.getRobot1Start(), 50)));
-        values.add("1号机器人焊接完成数量=" + countTrue(plc.readBoolean(config.getRobot1Done(), 50)));
-        values.add("2号机器人焊接开始数量=" + countTrue(plc.readBoolean(config.getRobot2Start(), 50)));
-        values.add("2号机器人焊接完成数量=" + countTrue(plc.readBoolean(config.getRobot2Done(), 50)));
-        addInt16(plc, values, "1号机器人压力", config.getRobot1Pressure());
-        addInt16(plc, values, "2号机器人压力", config.getRobot2Pressure());
-        addScaledInt16(plc, values, "1号机器人电流", config.getRobot1Current(), 100, false);
-        addScaledInt16(plc, values, "2号机器人电流", config.getRobot2Current(), 100, false);
-        addScaledInt16(plc, values, "1号机器人焊接时间", config.getRobot1Time(), 20, true);
-        addScaledInt16(plc, values, "2号机器人焊接时间", config.getRobot2Time(), 20, true);
-        return values;
-    }
-
     private static JSONObject buildSpotWeldContent(McPLC plc, StationConfig config) {
         List<Boolean> robot1Start = plc.readBoolean(config.getRobot1Start(), 50);
         List<Boolean> robot1Done = plc.readBoolean(config.getRobot1Done(), 50);