| | |
| | | private List<JSONObject> socketReadResults = new ArrayList<>(); |
| | | private List<DeviceMsgModel> socketResults = new ArrayList<>(); |
| | | |
| | | private Long requestReadTime = System.currentTimeMillis(); |
| | | //原始设备数据 |
| | | private Object originDeviceData; |
| | | |
| | |
| | | //指令超过2条,不再下发任务状态请求 |
| | | TreeSet<String> deviceCommandMsgListKey = deviceMsgUtils.getDeviceCommandMsgListKey(SlaveType.Shuttle, deviceConfig.getDeviceNo()); |
| | | if (deviceCommandMsgListKey.size() < 2) { |
| | | requestCommand(readStatusCommand);//请求状态 |
| | | if ((System.currentTimeMillis() - requestReadTime) > 500) { |
| | | requestCommand(readStatusCommand);//请求状态 |
| | | requestReadTime = System.currentTimeMillis(); |
| | | } |
| | | } |
| | | |
| | | if (this.socketReadResults.isEmpty()) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ShuttleCommand getMoveCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes) { |
| | | public ShuttleCommand getMoveCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes, Boolean shuttleDirectionReverse) { |
| | | NavigateMapData navigateMapData = SpringUtils.getBean(NavigateMapData.class); |
| | | NyShuttleHttpCommand httpStandard = getHttpStandard(deviceConfig.getDeviceNo(), taskNo); |
| | | NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest(); |
| | |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ()); |
| | | Map<String, Object> nyNode = navigateNodeToNyPointNode(NavigatePositionConvert.codeToNode(codeNum)); |
| | | int xp = Integer.parseInt(String.valueOf(nyNode.get("y"))); |
| | | int yp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | |
| | | int xp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | int yp = Integer.parseInt(String.valueOf(nyNode.get("y"))); |
| | | if (shuttleDirectionReverse) { |
| | | xp = Integer.parseInt(String.valueOf(nyNode.get("y"))); |
| | | yp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | } |
| | | |
| | | int z = Integer.parseInt(String.valueOf(nyNode.get("z"))); |
| | | |
| | | List<MapNode> mapNodes = mapData.get(node.getX()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ShuttleCommand getMoveLiftCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes, Boolean moveIn) { |
| | | public ShuttleCommand getMoveLiftCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes, Boolean moveIn, Boolean shuttleDirectionReverse) { |
| | | NavigateMapData navigateMapData = SpringUtils.getBean(NavigateMapData.class); |
| | | NyShuttleHttpCommand httpStandard = getHttpStandard(deviceConfig.getDeviceNo(), taskNo); |
| | | NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest(); |
| | |
| | | |
| | | Integer taskId = getTaskId(); |
| | | HashMap<String, Object> body = new HashMap<>(); |
| | | if (moveIn) { |
| | | body.put("requestType", "intoLift");//进提升机 |
| | | }else { |
| | | body.put("requestType", "outLift");//出提升机 |
| | | } |
| | | // if (moveIn) { |
| | | // body.put("requestType", "intoLift");//进提升机 |
| | | // } else { |
| | | // body.put("requestType", "outLift");//出提升机 |
| | | // } |
| | | body.put("requestType", "move");//移动命令 |
| | | body.put("taskId", taskId);//TaskID需要随机 |
| | | body.put("path", path); |
| | | request.setBody(body); |
| | |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ()); |
| | | Map<String, Object> nyNode = navigateNodeToNyPointNode(NavigatePositionConvert.codeToNode(codeNum)); |
| | | int xp = Integer.parseInt(String.valueOf(nyNode.get("y"))); |
| | | int yp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | |
| | | int xp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | int yp = Integer.parseInt(String.valueOf(nyNode.get("y"))); |
| | | if (shuttleDirectionReverse) { |
| | | xp = Integer.parseInt(String.valueOf(nyNode.get("y"))); |
| | | yp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | } |
| | | |
| | | int z = Integer.parseInt(String.valueOf(nyNode.get("z"))); |
| | | |
| | | List<MapNode> mapNodes = mapData.get(node.getX()); |
| | |
| | | |
| | | //WCS系统坐标转牛眼坐标 |
| | | private static int[] WCSXyzToNyXyz(int x, int y, int z) { |
| | | // //WCS系统Y轴 => 牛眼X轴转换公式 |
| | | // int x1 = Math.abs(y - 61) + 11; |
| | | // //WCS系统X轴 => 牛眼Y轴转换公式 |
| | | // int y1 = x + 10; |
| | | |
| | | // int x1 = x + 10; |
| | | // int y1 = y + 10; |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", x) |
| | |
| | | |
| | | String qrCodeValue = locMast.getQrCodeValue(); |
| | | JSONObject data = JSON.parseObject(qrCodeValue); |
| | | return new int[]{data.getInteger("y"), data.getInteger("x"), z}; |
| | | return new int[]{data.getInteger("x"), data.getInteger("y"), z}; |
| | | } |
| | | |
| | | @Override |