From 6495eba615cba5efba0a208e7105bce933948a53 Mon Sep 17 00:00:00 2001
From: qlsxk <qlsxk@qq.com>
Date: 星期日, 28 九月 2025 08:33:55 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/NyLiftThread.java | 115 ++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 84 insertions(+), 31 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/NyLiftThread.java b/src/main/java/com/zy/core/thread/impl/NyLiftThread.java
index a11eccf..cb077fb 100644
--- a/src/main/java/com/zy/core/thread/impl/NyLiftThread.java
+++ b/src/main/java/com/zy/core/thread/impl/NyLiftThread.java
@@ -181,8 +181,6 @@
liftProtocol.setHasTray(data.getInteger("hasTray") == 1);
//鏈夊皬杞�
liftProtocol.setHasCar(data.getInteger("hasCar") == 1);
- //鍑哄叆搴撴ā寮�
- liftProtocol.setIOMode(data.getInteger("iOMode"));
//鏁呴殰鐮�
liftProtocol.setErrorCode(data.getInteger("errorCode"));
//褰撳墠灞�
@@ -355,7 +353,7 @@
@Override
public CommandResponse switchIOMode(LiftIoModeType type) {
CommandResponse response = new CommandResponse(true);
- liftProtocol.setIOModeType(type);
+ liftProtocol.setIOMode(type);
return response;
}
@@ -382,20 +380,51 @@
InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend();
- boolean res = this.liftProtocol.getProtocolStatus() == LiftProtocolStatusType.IDLE.id
-// && this.liftProtocol.getPlcTaskNo() == 0
- && this.liftProtocol.getTaskNo() == 0
- && this.liftProtocol.getModel() == 2
- && this.liftProtocol.getDeviceStatus() == LiftDeviceStatusType.IDLE.id
- && this.liftProtocol.getErrorCode() == 0
- && !extend.getFrontOverrun()
- && !extend.getBackOverrun()
- && !extend.getLeftOverrun()
- && !extend.getRightOverrun()
- && !extend.getOverHeight()
- && !extend.getOverWeight()
- ;
- return res;
+ if (this.liftProtocol.getProtocolStatus() != LiftProtocolStatusType.IDLE.id) {
+ return false;//浠诲姟涓嶇┖闂�
+ }
+
+ if (this.liftProtocol.getTaskNo() != 0) {
+ return false;//鏈変换鍔″彿
+ }
+
+ if (this.liftProtocol.getModel() != 2) {
+ return false;//闈炶嚜鍔�
+ }
+
+ if (this.liftProtocol.getDeviceStatus() != LiftDeviceStatusType.IDLE.id) {
+ return false;//闈炵┖闂�
+ }
+
+ if (this.liftProtocol.getErrorCode() != 0) {
+ return false;//鏈夋晠闅�
+ }
+
+ if (extend.getFrontOverrun()) {
+ return false;
+ }
+
+ if (extend.getBackOverrun()) {
+ return false;
+ }
+
+ if (extend.getLeftOverrun()) {
+ return false;
+ }
+
+ if (extend.getRightOverrun()) {
+ return false;
+ }
+
+ if (extend.getOverHeight()) {
+ return false;
+ }
+
+ if (extend.getOverWeight()) {
+ return false;
+ }
+
+ return true;
}
@Override
@@ -412,8 +441,7 @@
}
}
- if (this.liftProtocol.getProtocolStatus() == null
- || this.liftProtocol.getModel() == null
+ if (this.liftProtocol.getModel() == null
|| this.liftProtocol.getDeviceStatus() == null
|| this.liftProtocol.getErrorCode() == null
|| this.liftProtocol.getExtend() == null
@@ -423,18 +451,43 @@
InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend();
- boolean res = this.liftProtocol.getProtocolStatus() == LiftProtocolStatusType.IDLE.id
- && this.liftProtocol.getModel() == 2
- && this.liftProtocol.getDeviceStatus() == LiftDeviceStatusType.IDLE.id
- && this.liftProtocol.getErrorCode() == 0
- && !extend.getFrontOverrun()
- && !extend.getBackOverrun()
- && !extend.getLeftOverrun()
- && !extend.getRightOverrun()
- && !extend.getOverHeight()
- && !extend.getOverWeight()
- ;
- return res;
+ if (this.liftProtocol.getModel() != 2) {
+ return false;//闈炶嚜鍔�
+ }
+
+ if (this.liftProtocol.getDeviceStatus() != LiftDeviceStatusType.IDLE.id) {
+ return false;//闈炵┖闂�
+ }
+
+ if (this.liftProtocol.getErrorCode() != 0) {
+ return false;//鏈夋晠闅�
+ }
+
+ if (extend.getFrontOverrun()) {
+ return false;
+ }
+
+ if (extend.getBackOverrun()) {
+ return false;
+ }
+
+ if (extend.getLeftOverrun()) {
+ return false;
+ }
+
+ if (extend.getRightOverrun()) {
+ return false;
+ }
+
+ if (extend.getOverHeight()) {
+ return false;
+ }
+
+ if (extend.getOverWeight()) {
+ return false;
+ }
+
+ return true;
}
@Override
--
Gitblit v1.9.1