use of org.eclipse.milo.opcua.sdk.core.DataTypeTree in project milo by eclipse.
the class MethodExample2 method logArguments.
private void logArguments(OpcUaClient client, UaMethod method) throws UaException {
DataTypeTree dataTypeTree = DataTypeTreeBuilder.build(client);
Argument[] inputArguments = method.getInputArguments();
Argument[] outputArguments = method.getOutputArguments();
logArguments(inputArguments, dataTypeTree, true);
logArguments(outputArguments, dataTypeTree, false);
}
use of org.eclipse.milo.opcua.sdk.core.DataTypeTree in project milo by eclipse.
the class MethodExample2 method logArguments.
private void logArguments(Argument[] arguments, DataTypeTree dataTypeTree, boolean input) {
if (arguments.length == 0) {
logger.info("{} arguments: none", input ? "Input" : "Output");
} else {
logger.info("{} arguments:", input ? "Input" : "Output");
for (Argument argument : arguments) {
NodeId dataTypeId = argument.getDataType();
DataTypeTree.DataType dataType = dataTypeTree.getDataType(dataTypeId);
assert dataType != null;
String dataTypeName = dataType.getBrowseName().getName();
logger.info(" {}: {} ({})", argument.getName(), dataTypeName, dataTypeId.toParseableString());
}
}
}
Aggregations