Browse Source

OPC同步线程更新

master
管理员 2 years ago
parent
commit
ed7b6236ec
  1. 10
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java
  2. 4
      acs/nladmin-system/src/main/resources/logback-spring.xml

10
acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java

@ -185,8 +185,11 @@ public class DeviceOpcProtocolRunable implements Runnable {
} }
} while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码 } while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码
log.info("如果两次的值相等,不走下面的代码");
OpcItemDto itemDto = this.getItem(item.getId()); OpcItemDto itemDto = this.getItem(item.getId());
if (itemDto.getNeed_log() != null && itemDto.getNeed_log()) { // if (itemDto.getNeed_log() != null && itemDto.getNeed_log()) {
if (true) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
//设备的ITEM项 //设备的ITEM项
List<String> relate_items = itemDto.getRelate_items(); List<String> relate_items = itemDto.getRelate_items();
@ -203,14 +206,13 @@ public class DeviceOpcProtocolRunable implements Runnable {
} }
//设置值 //设置值
accessor_value.setValue(item.getId(), value); accessor_value.setValue(item.getId(), value);
} }
} }
System.out.println("opc线程停止。。。"); log.info("opc线程停止。。。");
return; return;
} catch (Exception var30) { } catch (Exception var30) {
if (!DeviceOpcSynchronizeAutoRun.isRun) { if (!DeviceOpcSynchronizeAutoRun.isRun) {
System.out.println("opc线程停止2。。。"); log.info("opc线程停止2。。。");
if (server != null) { if (server != null) {
try { try {
server.disconnect(); server.disconnect();

4
acs/nladmin-system/src/main/resources/logback-spring.xml

@ -183,6 +183,10 @@ https://juejin.cn/post/6844903775631572999
<appender-ref ref="asyncFileAppender"/> <appender-ref ref="asyncFileAppender"/>
<appender-ref ref="lokiAppender"/> <appender-ref ref="lokiAppender"/>
</logger> </logger>
<logger name="org.nl.modules.wql" level="info" additivity="false">
<appender-ref ref="asyncFileAppender"/>
<appender-ref ref="lokiAppender"/>
</logger>
</springProfile> </springProfile>

Loading…
Cancel
Save