| | |
| | | @Value("${mes.secondLength}") |
| | | private String secondLength; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 5000000) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String taskRequestTypeValue = plcParameterObject.getPlcParameter("A06_request_word").getValue(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 当前切割版图信息 |
| | | * 当前切割版图信息 +磨边任务+磨边前 缓存内信息 |
| | | * |
| | | * @param |
| | | * @return |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边任务 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgTask(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String,Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String,Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |
| | | jsonObject.append("EdgTasks1", EdgTasks1); |
| | | jsonObject.append("EdgTasks2", EdgTasks2); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边前 缓存内信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgStorageCage(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> EdgStorageCageinfos=edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |