| | |
| | | private RedisUtil redisUtil; |
| | | private ZyStationConnectDriver zyStationConnectDriver; |
| | | private int deviceLogCollectTime = 200; |
| | | private boolean initStatus = false; |
| | | private long deviceDataLogTime = System.currentTimeMillis(); |
| | | private ExecutorService executor = Executors.newFixedThreadPool(9999); |
| | | |
| | |
| | | Thread readThread = new Thread(() -> { |
| | | while (true) { |
| | | try { |
| | | deviceLogCollectTime = Utils.getDeviceLogCollectTime(); |
| | | if (initStatus) { |
| | | deviceLogCollectTime = Utils.getDeviceLogCollectTime(); |
| | | } |
| | | readStatus(); |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | | log.error("StationV4Thread Fail", e); |
| | | } |
| | | } |
| | | }); |
| | | }, "DevpRead-" + deviceConfig.getDeviceNo()); |
| | | readThread.start(); |
| | | |
| | | Thread processThread = new Thread(() -> { |
| | |
| | | log.error("StationV4Process Fail", e); |
| | | } |
| | | } |
| | | }); |
| | | }, "DevpProcess-" + deviceConfig.getDeviceNo()); |
| | | processThread.start(); |
| | | } |
| | | |
| | |
| | | stationProtocol.setStationId(entity.getStationId()); |
| | | statusList.add(stationProtocol); |
| | | } |
| | | initStatus = true; |
| | | } |
| | | |
| | | List<ZyStationStatusEntity> zyStationStatusEntities = zyStationConnectDriver.getStatus(); |
| | |
| | | List<Integer> path = JSON.parseArray(JSON.toJSONString(original.getNavigatePath(), SerializerFeature.DisableCircularReferenceDetect), Integer.class); |
| | | List<Integer> liftTransferPath = JSON.parseArray(JSON.toJSONString(original.getLiftTransferPath(), SerializerFeature.DisableCircularReferenceDetect), Integer.class); |
| | | if (path == null || path.isEmpty()) { |
| | | // 同站点任务不会生成路径,但仍需下发命令写入任务数据 |
| | | if (Objects.equals(original.getStationId(), original.getTargetStaNo())) { |
| | | while (true) { |
| | | CommandResponse commandResponse = sendCommand(original); |
| | | if (commandResponse != null && commandResponse.getResult()) { |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(200); |
| | | } catch (Exception ignore) {} |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | |