| | |
| | | private DeviceConfig deviceConfig; |
| | | private RedisUtil redisUtil; |
| | | private ShuttleProtocol shuttleProtocol; |
| | | private ShuttleAction shuttleAction = null; |
| | | |
| | | private static final boolean DEBUG = false;//调试模式 |
| | | |
| | |
| | | // Thread executeThread = new Thread(() -> { |
| | | // while (true) { |
| | | // try { |
| | | // ShuttleAction shuttleAction = null; |
| | | // try { |
| | | // shuttleAction = SpringUtils.getBean(ShuttleAction.class); |
| | | // }catch (Exception e){ |
| | | // continue; |
| | | // } |
| | | // |
| | | // if (shuttleAction == null) { |
| | | // try { |
| | | // shuttleAction = SpringUtils.getBean(ShuttleAction.class); |
| | | // }catch (Exception e){ |
| | | // } |
| | | // continue; |
| | | // } |
| | | // |
| | |
| | | return false; |
| | | } |
| | | |
| | | List<NavigationMapType> restartCalcMapTypes = new ArrayList<>(mapTypes); |
| | | restartCalcMapTypes.add(NavigationMapType.SHUTTLE); |
| | | |
| | | String currentLocNo = shuttleProtocol.getCurrentLocNo(); |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(currentLocNo, locNo, mapTypes, assignCommand, this); |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(currentLocNo, locNo, restartCalcMapTypes, assignCommand, this); |
| | | if (commands == null) { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | ShuttleCommand firstCommand = originCommands.get(0); |
| | | ShuttleCommand endCommand = originCommands.get(commands.size() - 1); |
| | | ShuttleCommand endCommand = originCommands.get(originCommands.size() - 1); |
| | | |
| | | if (firstCommand.getMode() != ShuttleCommandModeType.PALLET_LIFT.id) { |
| | | return false; |
| | |
| | | |
| | | private JSONObject queryCommandStatus(String resultKey) { |
| | | // 获取服务器响应 |
| | | // 尝试50次 |
| | | JSONObject result = null; |
| | | for (int i = 0; i < 50; i++) { |
| | | long startTime = System.currentTimeMillis(); |
| | | while (true) { |
| | | if((System.currentTimeMillis() - startTime) > 1000 * 10) { |
| | | break; |
| | | } |
| | | |
| | | result = getRequestBody(resultKey); |
| | | if (result == null) { |
| | | try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | continue; |
| | | }else { |
| | | break; |
| | | } |