From 50435a81915932eda06b7f1afd48f9ff1ae84f19 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期四, 10 四月 2025 17:50:28 +0800
Subject: [PATCH] 1
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
index c03eb2c..0be1c20 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
@@ -286,20 +286,16 @@
}
LiftDispatcher liftDispatcher = SpringUtils.getBean(LiftDispatcher.class);
- Integer lev = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), liftProtocol.getLev());
- if (null == lev){
- News.error("鎻愬崌鏈鸿幏鍙栧綋鍓嶅眰涓虹┖");
- response.setMessage("鎻愬崌鏈鸿幏鍙栧綋鍓嶅眰涓虹┖");
- return response;
+
+ Integer origin = command.getOriginLev();
+ Integer target = command.getTargetLev();
+ if (command.getMode() == 2) {
+ origin = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), liftProtocol.getLev());
+ target = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), command.getTargetLev());
}
- array[1] = lev.shortValue();
- Integer targetLev = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), command.getTargetLev());
- if (null == targetLev){
- News.error("鎻愬崌鏈鸿幏鍙栫洰鏍囧眰涓虹┖");
- response.setMessage("鎻愬崌鏈鸿幏鍙栫洰鏍囧眰涓虹┖");
- return response;
- }
- array[2] = targetLev.shortValue();
+
+ array[1] = origin.shortValue();
+ array[2] = target.shortValue();
OperateResult result = siemensS7Net.Write("DB83.0", array);
if (result != null && result.IsSuccess) {
@@ -413,12 +409,16 @@
public List<LiftCommand> getMoveCommand(Integer taskNo, Integer sourceLev, Integer targetLev, LiftCommandModeType mode) {
/**
* 浠诲姟绫诲瀷
- * 1=绉绘墭鐩橈紱鍗囬檷鏈哄皢婧愮珯鍙版墭鐩樼Щ鍒扮洰鏍囩珯鍙�
- * 2=绉诲皬杞︼紝鍗囬檷鏈虹Щ鍒扮洰鏍囧眰锛岀瓑寰�
+ 1=绉绘墭鐩橈紱鍗囬檷鏈哄皢婧愮珯鍙版墭鐩樼Щ鍒扮洰鏍囩珯鍙�
+ 2=鎹㈠眰锛屽崌闄嶆満绉诲埌鐩爣灞傦紝绛夊緟
+ 3=鍏ュ簱鎵樼洏,鍗囬檷鏈哄皢婧愮珯鍙版墭鐩樼Щ鍒扮洰鏍囧眰鏁帮紱
+ 4=鍑哄簱鎵樼洏锛屽崌闄嶆満灏嗘簮绔欏彴鎵樼洏绉诲埌鐩爣绔欏彴
*/
short taskMode = 2;
- if (mode.equals(LiftCommandModeType.PALLET_INOUT)) {
- taskMode = 1;
+ if (mode.equals(LiftCommandModeType.PALLET_IN)) {
+ taskMode = 3;
+ } else if (mode.equals(LiftCommandModeType.PALLET_OUT)) {
+ taskMode = 4;
}
// 寮�濮嬩换鍔�
@@ -435,7 +435,7 @@
LiftCommand command = new LiftCommand();
command.setLiftNo(Integer.valueOf(this.device.getDeviceNo()));
command.setBody(JSON.toJSONString(array));
- command.setMode(LiftCommandModeType.MOVE.id);
+ command.setMode(mode.id);
command.setOriginLev(sourceLev);
command.setTargetLev(targetLev);
--
Gitblit v1.9.1