| | |
| | | |
| | | @Override |
| | | public boolean connect() { |
| | | Thread checkThread = new Thread(() -> { |
| | | while (true) { |
| | | try { |
| | | for (Map.Entry<Integer, List<ZyStationStatusEntity>> entry : deviceStatusMap.entrySet()) { |
| | | List<ZyStationStatusEntity> stationList = entry.getValue(); |
| | | for (ZyStationStatusEntity statusEntity : stationList) { |
| | | if (statusEntity.isAutoing() |
| | | && statusEntity.isLoading() |
| | | && statusEntity.getTaskNo() > 0 |
| | | && !statusEntity.isRunBlock() |
| | | && !statusEntity.getStationId().equals(statusEntity.getTargetStaNo())) { |
| | | BlockingQueue<StationCommand> commands = taskQueues.get(statusEntity.getTaskNo()); |
| | | if (commands == null) { |
| | | statusEntity.setRunBlock(true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | | // checkThread.start(); |
| | | return true; |
| | | } |
| | | |