|
@ -84,7 +84,7 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
itemsMap.put(string, group.addItem(string)); |
|
|
itemsMap.put(string, group.addItem(string)); |
|
|
log.trace("添加成功 {}", string); |
|
|
log.info("添加成功 {}", string); |
|
|
} catch (Exception var29) { |
|
|
} catch (Exception var29) { |
|
|
err_message.append(string + ":" + var29.getMessage()); |
|
|
err_message.append(string + ":" + var29.getMessage()); |
|
|
if (!is_error) { |
|
|
if (!is_error) { |
|
@ -116,9 +116,9 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
long begin = System.currentTimeMillis(); |
|
|
long begin = System.currentTimeMillis(); |
|
|
Map<Item, ItemState> itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); |
|
|
Map<Item, ItemState> itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); |
|
|
long end = System.currentTimeMillis(); |
|
|
long end = System.currentTimeMillis(); |
|
|
log.trace("{} 开始记时{}", tag, DateUtil.now()); |
|
|
log.info("{} 开始记时{}", tag, DateUtil.now()); |
|
|
long duration = end - begin; |
|
|
long duration = end - begin; |
|
|
log.trace("{} 读取耗时:{}", tag, duration); |
|
|
log.info("{} 读取耗时:{}", tag, duration); |
|
|
if (duration > 1000L) { |
|
|
if (duration > 1000L) { |
|
|
if (!time_out) { |
|
|
if (!time_out) { |
|
|
log.warn("{} 读取超时 : {}", tag, duration); |
|
|
log.warn("{} 读取超时 : {}", tag, duration); |
|
@ -141,8 +141,8 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
do { |
|
|
do { |
|
|
if (!var18.hasNext()) { |
|
|
if (!var18.hasNext()) { |
|
|
end = System.currentTimeMillis(); |
|
|
end = System.currentTimeMillis(); |
|
|
log.trace("{}", itemsString); |
|
|
log.info("{}", itemsString); |
|
|
log.trace("{} 计算完成耗时{}", tag, end - begin); |
|
|
log.info("{} 计算完成耗时{}", tag, end - begin); |
|
|
Thread.sleep((long) OpcConfig.synchronized_millisecond); |
|
|
Thread.sleep((long) OpcConfig.synchronized_millisecond); |
|
|
if (this.error_num != 0) { |
|
|
if (this.error_num != 0) { |
|
|
this.error_num = 0; |
|
|
this.error_num = 0; |
|
|