| | |
| | | @Resource |
| | | GlassInfoService glassInfoService; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void startOneEdgTask() throws Exception { |
| | | startEdgTaskChild("01"); |
| | |
| | | |
| | | private void startEdgTaskChild(String cell) throws Exception { |
| | | S7DataMBExtra s7DataMBExtra = s7SerializerMBExtra.read(S7DataMBExtra.class); |
| | | |
| | | log.info("MB04读取数据{}", s7DataMBExtra); |
| | | // ReadWriteEntity request = miloService.readFromOpcUa("MB04.MB04.request" + cell); |
| | | // if (null == request || "0".equals(request.getValue() + "")) { |
| | | String request = ""; |
| | |
| | | // ualist.add(generateReadWriteEntity("MB04.MB04.thickness" + cell, (int) glassInfo.getThickness() * 10)); |
| | | // miloService.writeToOpcWord(ualist); |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("MB04.MB04.mes_glass_Id_" + cell, glassId)); |
| | | |
| | | log.info("{}线发送尺寸信息宽:{},高:{},厚度:{}", cell, Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10), Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10), glassInfo.getThickness() * 10); |
| | | if ("01".equals(cell)) { |
| | | s7SerializerMBExtra.write( |
| | | S7DataMBExtra.builder() |
| | | .widthOne((short) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .heightOne((short) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .thicknessOne((short) (glassInfo.getThickness() * 10)) |
| | | .widthOne((int) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .heightOne((int) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .thicknessOne((int) (glassInfo.getThickness() * 10)) |
| | | .build() |
| | | ); |
| | | s7SerializerMBExtra.write( |
| | |
| | | } else { |
| | | s7SerializerMBExtra.write( |
| | | S7DataMBExtra.builder() |
| | | .widthTwo((short) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .heightTwo((short) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .thicknessTwo((short) (glassInfo.getThickness() * 10)) |
| | | .widthTwo((int) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .heightTwo((int) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10)) |
| | | .thicknessTwo((int) (glassInfo.getThickness() * 10)) |
| | | .build() |
| | | ); |
| | | s7SerializerMBExtra.write( |