From c2b0be1a368a88e4adb6dda12d0aa5d3bb0df838 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期二, 27 六月 2023 16:50:50 +0800 Subject: [PATCH] 搜索最近穿梭车,提升机完成方法 --- src/main/java/com/zy/core/thread/LiftThread.java | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java index 37d80f3..a399c9e 100644 --- a/src/main/java/com/zy/core/thread/LiftThread.java +++ b/src/main/java/com/zy/core/thread/LiftThread.java @@ -363,9 +363,6 @@ return false; } - //灏嗘爣璁扮疆涓篺alse(闃叉閲嶅彂) - liftProtocol.setPakMk(false); - Object o = redisUtil.get("lift_wrk_no_" + wrkNo); if (o == null) { return false; @@ -377,6 +374,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); @@ -408,6 +442,9 @@ News.info("鎻愬崌鏈哄懡浠や笅鍙戞垚鍔燂紝鎻愬崌鏈哄彿={}锛屼换鍔℃暟鎹�={}", command.getLiftNo(), JSON.toJSON(command)); liftProtocol.setWrkTime(new Date());//鏇存柊宸ヤ綔鏃堕棿 + //灏嗘爣璁扮疆涓篺alse(闃叉閲嶅彂) + liftProtocol.setPakMk(false); + //淇濆瓨鏁版嵁鍒版暟鎹簱鍋氭祦姘� BasLiftOptService liftOptService = SpringUtils.getBean(BasLiftOptService.class); if (liftOptService != null) { -- Gitblit v1.9.1