- fixed Bug #270: Static model generator does not consider default values from "DataTypeTemplates" section of ICD file

This commit is contained in:
Michael Zillgith 2015-01-13 11:09:00 +01:00
parent 3faca719cb
commit b04b11d886
2 changed files with 19 additions and 6 deletions

Binary file not shown.

View file

@ -536,17 +536,30 @@ public class StaticModelGenerator {
cOut.println("};\n");
if (dataAttribute.getSubDataAttributes() != null)
printDataAttributeDefinitions(daName, dataAttribute.getSubDataAttributes());
if (dataAttribute.getValue() != null) {
printValue(daName, dataAttribute);
printDataAttributeDefinitions(daName, dataAttribute.getSubDataAttributes());
DataModelValue value = dataAttribute.getValue();
/* if no value is given use default value for type if present */
if (value == null) {
value = dataAttribute.getDefinition().getValue();
if (value != null)
if (value.getValue() == null)
value.updateEnumOrdValue(ied.getTypeDeclarations());
}
if (value != null) {
printValue(daName, dataAttribute, value);
}
}
}
private void printValue(String daName, DataAttribute dataAttribute) {
DataModelValue value = dataAttribute.getValue();
private void printValue(String daName, DataAttribute dataAttribute, DataModelValue value) {
StringBuffer buffer = this.initializerBuffer;