From b78b9ca2ef71de6b9af4a31b45defb12304289b7 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 25 十月 2022 08:18:24 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/SteThread.java |   15 ++++++++++++++-
 1 files changed, 14 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..5da933e 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;
@@ -137,6 +138,14 @@
                 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));
                 steProtocol.setCharge(siemensS7Net.getByteTransform().TransSingle(result.Content, 10));
@@ -171,6 +180,8 @@
 
                 // 澶嶄綅淇″彿
                 if (steProtocol.getWaiting()) {
+                    log.error("-------------------------------------------绗竴姝ャ�乕绌挎杞﹀彿锛歿}, 宸ヤ綔鍙凤細{}]==>> 鐘舵�佷负3锛岀瓑寰匴CS纭锛侊紒",
+                            slave.getId(),steProtocol.getTaskNo());
                     if (resetFlag) {
                         SteCommand steCommand = new SteCommand();
                         steCommand.setComplete(true);
@@ -297,7 +308,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