use of org.opcfoundation.opcua.binaryschema.EnumeratedValue in project milo by eclipse.
the class DataTypeDictionaryGenerator method createEnumeratedType.
private EnumeratedType createEnumeratedType(EnumDescription description) {
QualifiedName name = description.getName();
EnumDefinition definition = description.getEnumDefinition();
EnumeratedType enumeratedType = new EnumeratedType();
enumeratedType.setName(name.getName());
enumeratedType.setLengthInBits(32);
for (EnumField field : definition.getFields()) {
EnumeratedValue enumeratedValue = new EnumeratedValue();
enumeratedValue.setName(field.getName());
enumeratedValue.setValue(field.getValue().intValue());
enumeratedType.getEnumeratedValue().add(enumeratedValue);
}
return enumeratedType;
}
Aggregations