| | |
| | | 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; |
| | |
| | | assignCommand.setNodes(result.getNodes()); |
| | | } else if (shuttleTaskModeType == ShuttleTaskModeType.MOVE_LOC_NO) { |
| | | //移动到目标库位 |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo()); |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo(), NavigationMapType.NORMAL.id); |
| | | if (result == null) { |
| | | throw new CoolException("路径计算失败"); |
| | | } |
| | |
| | | return false;//小车已被独占,禁止再派发任务 |
| | | } |
| | | |
| | | //判断小车是否存在移动任务 |
| | | WrkMast hasMoveWorking = wrkMastMapper.selectShuttleHasMoveWorking(wrkMast.getShuttleNo()); |
| | | if (hasMoveWorking != null) { |
| | | return false;//存在移动任务,禁止执行入库任务 |
| | | } |
| | | |
| | | //判断小车是否到达输送站点库位 |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(liftStaProtocol.getLocNo())) { |
| | | //小车不在输送站点位置 |
| | |
| | | } |
| | | |
| | | //获取小车到输送站点行走命令 |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleThread.getSlave().getId(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), liftSta.getLocNo()); |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleThread.getSlave().getId(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), liftSta.getLocNo(), NavigationMapType.NORMAL.id); |
| | | List<NyShuttleHttpCommand> commands = result.getCommands(); |
| | | |
| | | ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); |
| | |
| | | // liftNode.setZ(basLift.getPoint$().getZ()); |
| | | |
| | | //获取小车到目标库位命令 |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleThread.getSlave().getId(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo()); |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleThread.getSlave().getId(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo(), NavigationMapType.NORMAL.id); |
| | | if (result == null) { |
| | | return false;//路径计算失败 |
| | | } |
| | |
| | | ArrayList<NyShuttleHttpCommand> commands = new ArrayList<>(); |
| | | |
| | | //计算起点到目标点命令 |
| | | NyShuttleOperaResult result = getStartToTargetCommands(shuttleNo, wrkNo, startPoint, targetPoint); |
| | | NyShuttleOperaResult result = getStartToTargetCommands(shuttleNo, wrkNo, startPoint, targetPoint, NavigationMapType.DFX.id); |
| | | if (result == null) { |
| | | //计算结果必须不为空,否则计算失败 |
| | | return null; |
| | |
| | | |
| | | if (!startPoint.equals(middlePoint)) {//起点和中间点不一致,需要计算起点到中间点路径 |
| | | //计算起点到中间点命令 |
| | | NyShuttleOperaResult result1 = getStartToTargetCommands(shuttleNo, wrkNo, startPoint, middlePoint); |
| | | NyShuttleOperaResult result1 = getStartToTargetCommands(shuttleNo, wrkNo, startPoint, middlePoint, NavigationMapType.NORMAL.id); |
| | | if (result1 == null) { |
| | | //计算结果必须不为空,否则计算失败 |
| | | return null; |
| | |
| | | } |
| | | |
| | | //计算中间点到目标点命令 |
| | | NyShuttleOperaResult result2 = getStartToTargetCommands(shuttleNo, wrkNo, middlePoint, targetPoint); |
| | | NyShuttleOperaResult result2 = getStartToTargetCommands(shuttleNo, wrkNo, middlePoint, targetPoint, NavigationMapType.DFX.id); |
| | | if (result2 == null) { |
| | | //计算结果必须不为空,否则计算失败 |
| | | return null; |
| | |
| | | /** |
| | | * 获取起点到目标点行走命令 |
| | | */ |
| | | public static NyShuttleOperaResult getStartToTargetCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint) { |
| | | public static NyShuttleOperaResult getStartToTargetCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint, Integer mapType) { |
| | | //计算起点到目标点行走节点 |
| | | List<NavigateNode> calc = NavigateUtils.calc(startPoint, targetPoint, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startPoint))); |
| | | List<NavigateNode> calc = NavigateUtils.calc(startPoint, targetPoint, mapType, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startPoint))); |
| | | if (calc == null) { |
| | | return null; |
| | | } |