| | |
| | | @SuppressWarnings("all") |
| | | public class SurayShuttleThread implements ShuttleThread { |
| | | |
| | | private static final String API_URL = "http://127.0.0.1:8082"; |
| | | private static final String API_URL = "http://192.168.7.149:8082"; |
| | | |
| | | private Device device; |
| | | private RedisUtil redisUtil; |
| | |
| | | @Override |
| | | public synchronized boolean movePath(List<NavigateNode> nodes, Integer taskNo) { |
| | | try { |
| | | //默认地图母轨方向x |
| | | String mapDirection = "x"; |
| | | DictService dictService = SpringUtils.getBean(DictService.class); |
| | | Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>() |
| | | .eq(Dict::getFlag, "direction_map") |
| | | .eq(Dict::getStatus, 1)); |
| | | if (dict != null) { |
| | | mapDirection = dict.getValue(); |
| | | } |
| | | |
| | | String loginToken = requestLoginToken(); |
| | | if (loginToken == null) { |
| | | return false; |
| | |
| | | NavigateNode startPath = sectionNodes.get(0); |
| | | //结束路径 |
| | | NavigateNode targetPath = sectionNodes.get(sectionNodes.size() - 1); |
| | | if (ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.LEFT |
| | | if (mapDirection.equals("y") && ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.LEFT |
| | | || ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.RIGHT) { |
| | | //子轨方向 |
| | | oper = 6; |
| | | } else { |
| | | //母轨方向 |
| | | oper = 5; |
| | | } else { |
| | | //子轨方向 |
| | | oper = 6; |
| | | } |
| | | |
| | | for (int i = 0; i < sectionNodes.size(); i++) { |