| | |
| | | private DeviceConfigService deviceConfigService; |
| | | |
| | | public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, List<NavigationMapType> mapTypes, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) { |
| | | return getStartToTargetCommands(startLocNo, endLocNo, mapTypes, null, assignCommand, shuttleThread); |
| | | return getStartToTargetCommands(startLocNo, endLocNo, mapTypes, null, assignCommand, shuttleThread, "move"); |
| | | } |
| | | |
| | | public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, List<NavigationMapType> mapTypes, List<int[]> whites, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) { |
| | | public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, List<NavigationMapType> mapTypes, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread, String moveType) { |
| | | return getStartToTargetCommands(startLocNo, endLocNo, mapTypes, null, assignCommand, shuttleThread, moveType); |
| | | } |
| | | |
| | | public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, List<NavigationMapType> mapTypes, List<int[]> whites, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread, String moveType) { |
| | | ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); |
| | | if (shuttleProtocol == null) { |
| | | return null; |
| | |
| | | if (whites != null) { |
| | | boolean flag = false; |
| | | for (int[] white : whites) { |
| | | if(white[0] == node.getX() && white[1] == node.getY()) { |
| | | if (white[0] == node.getX() && white[1] == node.getY()) { |
| | | flag = true; |
| | | break; |
| | | } |
| | |
| | | long endTime = System.currentTimeMillis(); |
| | | News.info("getSection path time:{}", (endTime - startTime)); |
| | | //将每一段路径分成command指令 |
| | | for (List<NavigateNode> nodes : data) { |
| | | for (int i = 0; i < data.size(); i++) { |
| | | List<NavigateNode> nodes = data.get(i); |
| | | |
| | | //开始路径 |
| | | NavigateNode startPath = nodes.get(0); |
| | | |
| | |
| | | String distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ()); |
| | | //获取移动命令 |
| | | ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes); |
| | | |
| | | if (i + 1 == data.size()) { |
| | | if (moveType.equals("inLift")) { |
| | | command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, true); |
| | | }else if (moveType.equals("outLift")) { |
| | | command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, false); |
| | | } |
| | | } |
| | | |
| | | command.setNodes(nodes);//将行走节点添加到每一步命令中 |
| | | commands.add(command); |
| | | } |