| | |
| | | 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 { |
| | | 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(); |