| | |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | } |
| | | |
| | | //环流风机-关 |
| | | if (DeviceStatus.F_CLOSE.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getStop(); |
| | | } |
| | | |
| | | //环流风机-开 |
| | | if (DeviceStatus.F_OPEN.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | } |
| | | |
| | | if (StringUtils.isBlank(exeDevice.getLink()) || "null".equals(exeDevice.getLink())) { |
| | | //根据设备目标状态,调用MODBUS执行 |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getOpen())) return; |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getOpenEnd())) return; |
| | | int addrExe = ServerUtil.getAddrExe(modbusTcp.getDeviceModbus().getOpenEnd()); |
| | | |
| | | boolean result = ModbusUtil2.readInputStatus(modbusTcp.getIp(), modbusTcp.getPort(), addrExe); |
| | |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), DeviceStatus.OPEN.getCode()); |
| | | } |
| | | |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getCloseEnd())) return; |
| | | addrExe = ServerUtil.getAddrExe(modbusTcp.getDeviceModbus().getCloseEnd()); |
| | | result = ModbusUtil2.readInputStatus(modbusTcp.getIp(), modbusTcp.getPort(), addrExe); |
| | | log.debug("---------读关到位状态------{}-{}-{}", modbusTcp.getBizCode(), addrExe, result); |