From 7c7c26161435045bf3449a4e4436084eb2ee9d33 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 13 七月 2023 14:49:25 +0800
Subject: [PATCH] #提升机数据更新
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 45 ++++++++++++++++++++++++++++++---------------
1 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 27a9864..9726b44 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -797,7 +797,7 @@
Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//绔欑偣浜岀淮鐮�
//澧炲姞绉诲姩杩涙彁鍗囨満鍛戒护
- ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, null, null, 500);
+ ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, null, null, 500);
commands.add(moveCommand);
//鍒嗛厤鐩爣搴撲綅
@@ -822,7 +822,7 @@
Short distCode = Short.parseShort(basDevp.getQrCodeValue());//鎻愬崌鏈哄彛绔欑偣浜岀淮鐮�
Short runDirection = ShuttleRunDirection.BOTTOM.id;//杩愯鏂瑰悜
//鑾峰彇鍛戒护
- ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, null, null, 500);
+ ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, null, null, 500);
commands.add(0, moveCommand);//灏嗚鎸囦护娣诲姞鍒伴槦澶�
assignCommand.setCommands(commands);
@@ -849,7 +849,7 @@
// Short distCode = Short.parseShort(basDevp.getQrCodeValue());//鎻愬崌鏈哄彛绔欑偣浜岀淮鐮�
// Short runDirection = ShuttleRunDirection.BOTTOM.id;//杩愯鏂瑰悜
// //鑾峰彇鍛戒护
-// ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, startCode, 1400, 500);
+// ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, startCode, 1600, 500);
// commands.add(0, moveCommand);//灏嗚鎸囦护娣诲姞鍒伴槦澶�
// }
// assignCommand.setCommands(commands);
@@ -872,7 +872,7 @@
// Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//绔欑偣浜岀淮鐮�
//
// //澧炲姞绉诲姩杩涙彁鍗囨満鍛戒护
-// ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, endStartCode, 1400, 500);
+// ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, endStartCode, 1600, 500);
// commands.add(moveCommand);
//
// //鍒嗛厤鐩爣搴撲綅
@@ -1049,17 +1049,32 @@
for (ArrayList<NavigateNode> nodes : data2) {
//寮�濮嬭矾寰�
NavigateNode startPath = nodes.get(0);
+
//涓棿璺緞
- NavigateNode middlePath = nodes.get(nodes.size() - 2);
+ NavigateNode middlePath = null;
+ //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+ Short middleCodeNum = null;
+ Integer middleToDistDistance = null;//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
+ if (nodes.size() > 10) {//涓鐮佷紶鍊掓暟绗笁涓�
+ //涓棿璺緞
+ middlePath = nodes.get(nodes.size() - 3);
+ //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+ middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ());
+ middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes);//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
+ } else if (nodes.size() > 5) {//涓鐮佷紶鍊掓暟绗簩涓�
+ //涓棿璺緞
+ middlePath = nodes.get(nodes.size() - 2);
+ //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+ middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ());
+ middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes);//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
+ }
+
//鐩爣璺緞
NavigateNode endPath = nodes.get(nodes.size() - 1);
Integer allDistance = NavigateUtils.getCurrentPathAllDistance(nodes);//璁$畻褰撳墠璺緞琛岃蛋鎬昏窛绂�
- Integer middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes);//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
//閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
Short startCodeNum = NavigatePositionConvert.xyToPosition(startPath.getX(), startPath.getY(), startPath.getZ());
- //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
- Short middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ());
//閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
Short distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ());
ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id, middleCodeNum, middleToDistDistance, runSpeed);
@@ -1247,7 +1262,7 @@
Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//绔欑偣浜岀淮鐮�
//澧炲姞绉诲姩杩涙彁鍗囨満鍛戒护
- ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, null, null, 500);
+ ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, null, null, 500);
commands.add(moveCommand);
//鐩爣搴撲綅
@@ -1288,7 +1303,7 @@
short startCode = liftProtocol.getBarcode();//鎻愬崌鏈哄唴閮ㄤ簩缁寸爜
Short distCode = commands.get(0).getStartCodeNum();//鐩爣浜岀淮鐮�
//鑾峰彇绉诲姩鍛戒护
- ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, commands.get(0).getRunDirection(), null, null, 500);
+ ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, commands.get(0).getRunDirection(), null, null, 500);
commands.add(0, moveCommand);//灏嗚鎸囦护娣诲姞鍒伴槦澶�
//鍒嗛厤鐩爣搴撲綅
@@ -2772,7 +2787,7 @@
shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING);
assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo());
- assignCommand.setTaskMode((short) 9);//鍏呯數
+ assignCommand.setTaskMode(ShuttleTaskModeType.CHARGE.id.shortValue());//鍏呯數
assignCommand.setTaskNo(wrkCharge.getWrkNo().shortValue());
assignCommand.setCharge(true);//鍏呯數浠诲姟
@@ -2810,13 +2825,13 @@
Short basDevpQrCode = Short.parseShort(basDevp.getQrCodeValue());//绔欑偣浜岀淮鐮�
//澧炲姞绉诲姩杩涙彁鍗囨満鍛戒护
- ShuttleCommand moveCommand = shuttleThread.getMoveCommand(basDevpQrCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, basDevpQrCode, 1400, 500);
+ ShuttleCommand moveCommand = shuttleThread.getMoveCommand(basDevpQrCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, basDevpQrCode, 1600, 500);
commands.add(moveCommand);
//鍒嗛厤鐩爣搴撲綅
shuttleProtocol.setLocNo(chargeLocNo);
assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo());
- assignCommand.setTaskMode((short) 9);//鍏呯數
+ assignCommand.setTaskMode(ShuttleTaskModeType.CHARGE.id.shortValue());//鍏呯數
assignCommand.setTaskNo(wrkCharge.getWrkNo().shortValue());
assignCommand.setCharge(true);//鍏呯數浠诲姟
//鐩爣搴撲綅
@@ -2900,14 +2915,14 @@
Short distCode = Short.parseShort(basDevp.getQrCodeValue());//鎻愬崌鏈哄彛绔欑偣浜岀淮鐮�
Short runDirection = ShuttleRunDirection.BOTTOM.id;//杩愯鏂瑰悜
//鑾峰彇鍛戒护
- ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, startCode, 1400, 500);
+ ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, startCode, 1600, 500);
commands.add(0, moveCommand);//灏嗚鎸囦护娣诲姞鍒伴槦澶�
//杩涜鍏呯數涓�
shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING);
assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo());
- assignCommand.setTaskMode((short) 9);//鍏呯數
+ assignCommand.setTaskMode(ShuttleTaskModeType.CHARGE.id.shortValue());//鍏呯數
assignCommand.setTaskNo(wrkCharge.getWrkNo().shortValue());
assignCommand.setCharge(true);//鍏呯數浠诲姟
--
Gitblit v1.9.1