Browse Source

更新

master
gengby 2 years ago
parent
commit
b428f0686e
  1. 17
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java

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

@ -115,6 +115,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
log.info("label97_123");
long begin = System.currentTimeMillis();
Map<Item, ItemState> itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0]));
log.info("{}读取到的itemStatus结果为:", itemStatus);
long end = System.currentTimeMillis();
log.info("{} 开始记时{}", tag, DateUtil.now());
long duration = end - begin;
@ -130,6 +131,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
}
boolean valueAllNotNull = false;
Set<Item> items = itemStatus.keySet();
log.info("items值为:", items);
Iterator var18 = items.iterator();
while (true) {
@ -153,16 +155,16 @@ public class DeviceOpcProtocolRunable implements Runnable {
random *= 1000;
if (this.all_null < 3) {
log.warn("{} 所有内容都为空,暂定{}s", tag, 5000 + random);
ThreadUtl.sleep((long)(5000 + random));
ThreadUtl.sleep((long) (5000 + random));
} else if (this.all_null < 6) {
log.warn("{} 所有内容都为空,暂定{}s", tag, 30000 + random);
ThreadUtl.sleep((long)(30000 + random));
ThreadUtl.sleep((long) (30000 + random));
} else if (this.all_null < 12) {
log.warn("{} 所有内容都为空,暂定{}ms", tag, '\uea60' + random);
ThreadUtl.sleep((long)('\uea60' + random));
ThreadUtl.sleep((long) ('\uea60' + random));
} else {
log.warn("{} 所有内容都为空,暂定{}ms", tag, 120000 + random);
ThreadUtl.sleep((long)(120000 + random));
ThreadUtl.sleep((long) (120000 + random));
}
++this.all_null;
@ -174,14 +176,17 @@ public class DeviceOpcProtocolRunable implements Runnable {
}
log.info("label97A----");
item = (Item) var18.next();
log.info("读取到item:{}", item);
ItemState itemState = (ItemState) itemStatus.get(item);
log.info("读取到itemState:{}", itemState);
log.info("开始根据item,itemState读取信号值:{},{}", item, itemState);
value = OpcUtl.getValue(item, itemState);
log.info("根据item,itemState读取到信号值为:{}", value);
if (value != null) {
valueAllNotNull = true;
}
his = accessor_value.getValue(item.getId());
log.info("读取到旧的信号值:{}", his);
if (!ObjectUtil.equal(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) {
log.warn("opc 值不健康 item: {}, 状态: {}", item.getId(), itemState.getQuality());
}

Loading…
Cancel
Save