From c6ac4fcda65f2033dbf4d0cfb57fc32cdd3eee2f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 30 十一月 2022 14:42:09 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/SteThread.java |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SteThread.java b/src/main/java/com/zy/core/thread/SteThread.java
index 8efb3e3..4adf992 100644
--- a/src/main/java/com/zy/core/thread/SteThread.java
+++ b/src/main/java/com/zy/core/thread/SteThread.java
@@ -5,6 +5,7 @@
 import HslCommunication.Profinet.Siemens.SiemensPLCS;
 import HslCommunication.Profinet.Siemens.SiemensS7Net;
 import com.alibaba.fastjson.JSON;
+import com.core.common.Cools;
 import com.core.common.DateUtils;
 import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
@@ -136,6 +137,14 @@
                 OperateResultExOne<Boolean> waitingRes = siemensS7Net.ReadBool("V2001.1");
                 if (waitingRes.IsSuccess) {
                     steProtocol.setWaiting(waitingRes.Content);
+                }
+                OperateResultExOne<Boolean> inEmptyRes = siemensS7Net.ReadBool("V2001.2");
+                if (inEmptyRes.IsSuccess) {
+                    steProtocol.setInEmpty(inEmptyRes.Content);
+                }
+                OperateResultExOne<Boolean> outEmptyRes = siemensS7Net.ReadBool("V2001.3");
+                if (outEmptyRes.IsSuccess) {
+                    steProtocol.setOutEmpty(outEmptyRes.Content);
                 }
                 steProtocol.setAlarm(siemensS7Net.getByteTransform().TransInt16(result.Content, 6));
                 steProtocol.setAlarm0(siemensS7Net.getByteTransform().TransInt16(result.Content, 8));
@@ -297,7 +306,9 @@
         if (result != null && result.IsSuccess) {
             // 缁存姢鏁版嵁搴撴帓鍒楀眰
             if (!steProtocol.getWaiting()) {
-                this.modifyPos(command.getRow().intValue(), command.getBay().intValue(), command.getLev().intValue());
+                if (!Cools.isEmpty(command.getRow(), command.getBay(), command.getLev())) {
+                    this.modifyPos(command.getRow().intValue(), command.getBay().intValue(), command.getLev().intValue());
+                }
             }
 
             log.info("绌挎杞﹀懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));

--
Gitblit v1.9.1