rev 更新线程

This commit is contained in:
USER-20220102CG\noblelift
2024-05-14 18:30:15 +08:00
parent 4c5642c001
commit 4741f9952d

View File

@@ -189,6 +189,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
Object value = OpcUtl.getValue(item, itemState);
if (value != null) {
valueAllNotNull = true;
} else {
log.info("item:{},velue为空value:{}", item.getId(), value);
}
String itemId = item.getId();
@@ -225,13 +227,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
}
if (!valueAllNotNull) {
int random = (new Random()).nextInt(10) + 1;
random *= 1000;
if (this.all_null < 3) {
if (log.isWarnEnabled()) {
log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3);
log.warn("OPC数据源: {} 所有内容都为空,检查网络, all_null:{} ,暂定{}s", tag, all_null,3);
}
ThreadUtl.sleep( 3000);
break start;
} else if (this.all_null < 6) {
@@ -253,9 +252,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, 5000);
}
ThreadUtl.sleep((long) (5000));
break start;
}
++this.all_null;
// ++this.all_null;
} else {
this.all_null = 0;
}