rev 更新驱动字符串读取
This commit is contained in:
@@ -190,7 +190,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
|
||||
* @return
|
||||
*/
|
||||
default String getStringValue(String protocol) {
|
||||
return this.getOpcValueAccessor().getValue(this.getItem(protocol)).toString();
|
||||
return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -153,7 +153,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -207,10 +207,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
|
||||
if (!UnifiedDataAppService.isEquals(value, his)) {
|
||||
OpcItemDto itemDto = this.getItem(itemId);
|
||||
if (true) {
|
||||
this.logItemChanged(itemId, accessor_value, value, itemDto);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(value)) {
|
||||
this.logItemChanged(itemId, accessor_value, value, itemDto);
|
||||
accessor_value.setValue(itemId, value);
|
||||
}
|
||||
}
|
||||
@@ -436,7 +434,6 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
String.valueOf(itemDto.getHis_item_value()), String.valueOf(itemDto.getItem_value()));
|
||||
luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc());
|
||||
log.info("{}", JSON.toJSONString(luceneLogDto));
|
||||
|
||||
}
|
||||
} else {
|
||||
if(his instanceof int[]){
|
||||
|
||||
Reference in New Issue
Block a user