本文整理匯總了Java中org.eclipse.milo.opcua.sdk.core.ValueRank類的典型用法代碼示例。如果您正苦於以下問題:Java ValueRank類的具體用法?Java ValueRank怎麽用?Java ValueRank使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ValueRank類屬於org.eclipse.milo.opcua.sdk.core包,在下文中一共展示了ValueRank類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: valueRankToString
import org.eclipse.milo.opcua.sdk.core.ValueRank; //導入依賴的package包/類
public static String valueRankToString(int rank) {
Optional<ValueRank> valueRank = Arrays.stream(ValueRank.values()).filter(v -> v.getValue() == rank).findAny();
return String.format("%d (%s)", rank, valueRank.isPresent() ? valueRank.get() : "Unknown");
}
示例2: BasicProperty
import org.eclipse.milo.opcua.sdk.core.ValueRank; //導入依賴的package包/類
public BasicProperty(QualifiedName browseName, NodeId dataType, ValueRank valueRank, Class<T> javaType) {
this(browseName, dataType, valueRank.getValue(), javaType);
}
示例3: addArrayNodes
import org.eclipse.milo.opcua.sdk.core.ValueRank; //導入依賴的package包/類
private void addArrayNodes(UaFolderNode rootNode) {
UaFolderNode arrayTypesFolder = new UaFolderNode(
server.getNodeMap(),
new NodeId(namespaceIndex, "HelloWorld/ArrayTypes"),
new QualifiedName(namespaceIndex, "ArrayTypes"),
LocalizedText.english("ArrayTypes")
);
server.getNodeMap().addNode(arrayTypesFolder);
rootNode.addOrganizes(arrayTypesFolder);
for (Object[] os : STATIC_ARRAY_NODES) {
String name = (String) os[0];
NodeId typeId = (NodeId) os[1];
Object value = os[2];
Object array = Array.newInstance(value.getClass(), 4);
for (int i = 0; i < 4; i++) {
Array.set(array, i, value);
}
Variant variant = new Variant(array);
UaVariableNode node = new UaVariableNode.UaVariableNodeBuilder(server.getNodeMap())
.setNodeId(new NodeId(namespaceIndex, "HelloWorld/ArrayTypes/" + name))
.setAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)))
.setUserAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)))
.setBrowseName(new QualifiedName(namespaceIndex, name))
.setDisplayName(LocalizedText.english(name))
.setDataType(typeId)
.setTypeDefinition(Identifiers.BaseDataVariableType)
.setValueRank(ValueRank.OneDimension.getValue())
.setArrayDimensions(new UInteger[]{uint(0)})
.build();
node.setValue(new DataValue(variant));
node.setAttributeDelegate(new ValueLoggingDelegate());
server.getNodeMap().addNode(node);
arrayTypesFolder.addOrganizes(node);
}
}