From 0d04e9440d19f30a8220f498ebdde5a8bfcc48a8 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期二, 10 十月 2023 13:50:03 +0800 Subject: [PATCH] #机械臂任务下发 --- src/main/java/com/zy/asrs/controller/ShuttleController.java | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/ShuttleController.java b/src/main/java/com/zy/asrs/controller/ShuttleController.java index 3c7508f..ce01db0 100644 --- a/src/main/java/com/zy/asrs/controller/ShuttleController.java +++ b/src/main/java/com/zy/asrs/controller/ShuttleController.java @@ -17,6 +17,7 @@ import com.zy.asrs.service.WrkMastService; import com.zy.asrs.utils.Utils; import com.zy.common.model.NyShuttleOperaResult; +import com.zy.common.model.enums.NavigationMapType; import com.zy.common.service.CommonService; import com.zy.common.utils.NyHttpUtils; import com.zy.common.utils.NyShuttleOperaUtils; @@ -299,7 +300,11 @@ assignCommand.setNodes(result.getNodes()); } else if (shuttleTaskModeType == ShuttleTaskModeType.MOVE_LOC_NO) { //绉诲姩鍒扮洰鏍囧簱浣� - NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo()); + Integer mapType = NavigationMapType.NORMAL.id; + if (shuttleProtocol.getLiftPosition() == 2) { + mapType = NavigationMapType.DFX.id; + } + NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo(), mapType); if (result == null) { throw new CoolException("璺緞璁$畻澶辫触"); } @@ -338,6 +343,15 @@ shuttleProtocol.setToken(0);//浠ょ墝娓呯┖ shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);//浠诲姟鐘舵��-绌洪棽 shuttleProtocol.setPakMk(false);//浣滀笟鏍囪澶嶄綅 + + 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 R.ok(); } else if (shuttleTaskModeType == ShuttleTaskModeType.SHUTTLE_CONTROL) { //灏忚溅绠″埗 @@ -410,4 +424,40 @@ return R.ok(); } + /** + * 璺戝簱绋嬪簭 + */ + @PostMapping("/moveLoc") + @ManagerAuth + public R moveLoc(@RequestParam Integer shuttleNo, + @RequestParam Integer moveType, + @RequestParam Integer xStart, + @RequestParam Integer xTarget, + @RequestParam Integer yStart, + @RequestParam Integer yTarget) { + NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo); + if (shuttleThread == null) { + return R.error(); + } + + NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); + if (shuttleProtocol == null) { + return R.error(); + } + + if (!shuttleProtocol.isIdle()) { + return R.error("灏忚溅蹇欑涓�"); + } + + shuttleProtocol.setMoveLoc(true);//寮�鍚窇搴� + shuttleProtocol.setMoveType(moveType); + shuttleProtocol.setXStart(xStart); + shuttleProtocol.setXTarget(xTarget); + shuttleProtocol.setXCurrent(xStart); + shuttleProtocol.setYStart(yStart); + shuttleProtocol.setYTarget(yTarget); + shuttleProtocol.setYCurrent(yStart); + return R.ok(); + } + } -- Gitblit v1.9.1