From 97aa2cd09e92f73cd4dff3d99eaef64e748c80b3 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 28 六月 2023 19:04:32 +0800
Subject: [PATCH] 优化出库小车避让
---
src/main/java/com/zy/core/thread/LiftThread.java | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java
index 2504792..a399c9e 100644
--- a/src/main/java/com/zy/core/thread/LiftThread.java
+++ b/src/main/java/com/zy/core/thread/LiftThread.java
@@ -375,6 +375,43 @@
int size = commands.size();
LiftAssignCommand assignCommand = redisCommand.getAssignCommand();
+ if (commandStep != 0) {
+ //鍒ゆ柇涓婁竴鏉℃寚浠ゆ槸鍚﹀畬鎴�
+ LiftCommand command = commands.get(commandStep - 1);
+ if (command.getRun().intValue() == 1) {
+ //鎻愬崌鏈哄崌闄嶅懡浠�
+ if (command.getDistPosition().intValue() == liftProtocol.getPositionArrivalFeedback().intValue()) {
+ //鎻愬崌鏈虹洰鏍囨ゼ灞傚拰瀹為檯妤煎眰鐩稿悓锛屽垯璁ゅ畾鍛戒护瀹屾垚
+ command.setComplete(true);
+ }
+ } else if (command.getRun().intValue() == 2 || command.getRun().intValue() == 3) {
+ //鏃犺揣姝h浆锛屾湁璐ф杞�
+ if (!liftProtocol.getForwardRotationFeedback()) {
+ //杈撻�佺嚎姝h浆鍙嶉涓嶅湪杩愯涓紝璁ゅ畾鍛戒护瀹屾垚
+ command.setComplete(true);
+ }
+ } else if (command.getRun().intValue() == 6 || command.getRun().intValue() == 7) {
+ //鏈夎揣鍙嶈浆锛屾棤璐у弽杞�
+ if (!liftProtocol.getReverseFeedback()) {
+ //杈撻�佺嚎鍙嶈浆鍙嶉涓嶅湪杩愯涓紝璁ゅ畾鍛戒护瀹屾垚
+ command.setComplete(true);
+ }
+ } else if (command.getRun().intValue() == 4) {
+ //杈撻�佺嚎鍋滄
+ if (!liftProtocol.getForwardRotationFeedback() && !liftProtocol.getReverseFeedback()) {
+ //杈撻�佺嚎姝h浆鍙嶈浆閮戒笉鍦ㄨ繍琛屼腑锛岃瀹氬懡浠ゅ畬鎴�
+ command.setComplete(true);
+ }
+ }
+ //浠诲姟鏁版嵁淇濆瓨鍒皉edis
+ redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
+
+ if (!command.getComplete()) {
+ //涓婁竴鏉′换鍔℃湭瀹屾垚锛岀姝笅鍙戝懡浠�
+ return false;
+ }
+ }
+
//鍙栧嚭鍛戒护
LiftCommand command = commands.get(commandStep);
if (command.getOperaStaNo() != null && command.getDevpId() != null) {
--
Gitblit v1.9.1