From 311d1d7ac6cf52e9edd6d43a40ab6d324d49c27f Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 05 六月 2024 16:52:14 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java | 46 ++++++++++++++++++++++++++++++----------------
1 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
index 4e4122d..697f489 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -210,7 +210,7 @@
//鐢垫睜鐢靛帇
shuttleProtocol.setBatteryVoltage(data.getInteger("voltage"));
//鏁呴殰
- shuttleProtocol.setErrorCode(data.getString("errState"));
+ shuttleProtocol.setErrorCode(data.getJSONArray("errCode").getString(0));
//鏄惁椤跺崌
shuttleProtocol.setHasLift(data.getInteger("liftPosition") == 1 ? true : false);
@@ -276,6 +276,7 @@
basShuttle.setStatus(1);
basShuttle.setDeleted(0);
basShuttle.setHostId(device.getHostId());
+ basShuttle.setDeviceId(device.getId().intValue());
shuttleService.save(basShuttle);
}
//浠诲姟鍙�
@@ -323,6 +324,7 @@
Integer requestId = resultHeader.getInteger("requestId");
if (requestType.equals("init")) {
Integer code = resultBody.getInteger("code");
+ OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆戝洓鍚戣溅澶嶄綅涓婃姤 ===>> [code:{1}] [ip:{2}] [port:{3}]", code, device.getId(), device.getIp(), device.getPort()));
//灏忚溅澶嶄綅璇锋眰
ShuttleCommand initCommand = getInitCommand(requestId, code);
//鍙戝嚭璇锋眰
@@ -445,6 +447,7 @@
public boolean reset(ShuttleCommand command) {
setSyncTaskNo(0);
setProtocolStatus(ShuttleProtocolStatusType.IDLE);
+ enableMoveLoc(null, false);
return true;
}
@@ -658,15 +661,26 @@
}
@Override
- public boolean enableMoveLoc(ShuttleMoveLocParam param) {
- shuttleProtocol.setMoveLoc(true);//寮�鍚窇搴�
- shuttleProtocol.setMoveType(param.getMoveType());
- shuttleProtocol.setXStart(param.getStartX());
- shuttleProtocol.setXTarget(param.getTargetX());
- shuttleProtocol.setXCurrent(param.getStartX());
- shuttleProtocol.setYStart(param.getStartY());
- shuttleProtocol.setYTarget(param.getTargetY());
- shuttleProtocol.setYCurrent(param.getStartY());
+ public boolean enableMoveLoc(ShuttleMoveLocParam param, boolean enable) {
+ if (enable) {
+ shuttleProtocol.setMoveLoc(true);//寮�鍚窇搴�
+ shuttleProtocol.setMoveType(param.getMoveType());
+ shuttleProtocol.setXStart(param.getStartX());
+ shuttleProtocol.setXTarget(param.getTargetX());
+ shuttleProtocol.setXCurrent(param.getStartX());
+ shuttleProtocol.setYStart(param.getStartY());
+ shuttleProtocol.setYTarget(param.getTargetY());
+ shuttleProtocol.setYCurrent(param.getStartY());
+ }else {
+ shuttleProtocol.setMoveLoc(false);
+ shuttleProtocol.setMoveType(0);
+ shuttleProtocol.setXStart(0);
+ shuttleProtocol.setXTarget(0);
+ shuttleProtocol.setXCurrent(0);
+ shuttleProtocol.setYStart(0);
+ shuttleProtocol.setYTarget(0);
+ shuttleProtocol.setYCurrent(0);
+ }
return true;
}
@@ -692,8 +706,8 @@
HashMap<String, Object> data = new HashMap<>();
String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ(), device.getHostId());
Map<String, Object> nyNode = navigateNodeToNyPointNode(NavigatePositionConvert.codeToNode(codeNum, device.getHostId()));
- int xp = Integer.parseInt(String.valueOf(nyNode.get("x")));
- int yp = Integer.parseInt(String.valueOf(nyNode.get("y")));
+ int xp = Integer.parseInt(String.valueOf(nyNode.get("y")));
+ int yp = Integer.parseInt(String.valueOf(nyNode.get("x")));
int z = Integer.parseInt(String.valueOf(nyNode.get("z")));
List<List<MapNode>> mapData = navigateMapData.getJsonData(NavigationMapType.NONE.id, null, null);
@@ -703,8 +717,8 @@
data.put("xp", xp);
data.put("yp", yp);
data.put("z", z);
- data.put("x", mapNode.getXBase());
- data.put("y", mapNode.getYBase());
+ data.put("x", mapNode.getYBase());
+ data.put("y", mapNode.getXBase());
path.add(data);
}
@@ -799,8 +813,8 @@
location.put("xp", row);
location.put("yp", bay);
location.put("z", lev);
- location.put("x", mapNode.getXBase());
- location.put("y", mapNode.getYBase());
+ location.put("x", mapNode.getYBase());
+ location.put("y", mapNode.getXBase());
HashMap<String, Object> body = new HashMap<>();
body.put("responseType", "init");//澶嶄綅
--
Gitblit v1.9.1