|
@@ -522,8 +522,7 @@ class DataTypeNode(Node):
|
|
|
|
|
|
return self.__baseTypeEncoding__
|
|
return self.__baseTypeEncoding__
|
|
|
|
|
|
- isEnum = True
|
|
|
|
- isSubType = True
|
|
|
|
|
|
+ isEnum = False
|
|
# An option set is at the same time also an enum, at least for the encoding below
|
|
# An option set is at the same time also an enum, at least for the encoding below
|
|
isOptionSet = parentType is not None and parentType.id.ns == 0 and parentType.id.i==12755
|
|
isOptionSet = parentType is not None and parentType.id.ns == 0 and parentType.id.i==12755
|
|
|
|
|
|
@@ -545,26 +544,20 @@ class DataTypeNode(Node):
|
|
fdtype = str(av)
|
|
fdtype = str(av)
|
|
if fdtype in nodeset.aliases:
|
|
if fdtype in nodeset.aliases:
|
|
fdtype = nodeset.aliases[fdtype]
|
|
fdtype = nodeset.aliases[fdtype]
|
|
- isEnum = False
|
|
|
|
elif at == "Name":
|
|
elif at == "Name":
|
|
fname = str(av)
|
|
fname = str(av)
|
|
#elif at == "SymbolicName":
|
|
#elif at == "SymbolicName":
|
|
# symbolicName = str(av)
|
|
# symbolicName = str(av)
|
|
elif at == "Value":
|
|
elif at == "Value":
|
|
enumVal = int(av)
|
|
enumVal = int(av)
|
|
- isSubType = False
|
|
|
|
|
|
+ isEnum = True
|
|
elif at == "ValueRank":
|
|
elif at == "ValueRank":
|
|
valueRank = int(av)
|
|
valueRank = int(av)
|
|
else:
|
|
else:
|
|
logger.warn("Unknown Field Attribute " + str(at))
|
|
logger.warn("Unknown Field Attribute " + str(at))
|
|
# This can either be an enumeration OR a structure, not both.
|
|
# This can either be an enumeration OR a structure, not both.
|
|
# Figure out which of the dictionaries gets the newly read value pair
|
|
# Figure out which of the dictionaries gets the newly read value pair
|
|
- if isEnum == isSubType:
|
|
|
|
- # This is an error
|
|
|
|
- logger.warn("DataType contains both enumeration and subtype (or neither)")
|
|
|
|
- self.__encodable__ = False
|
|
|
|
- break
|
|
|
|
- elif isEnum:
|
|
|
|
|
|
+ if isEnum:
|
|
# This is an enumeration
|
|
# This is an enumeration
|
|
enumDict.append((fname, enumVal))
|
|
enumDict.append((fname, enumVal))
|
|
continue
|
|
continue
|
|
@@ -588,7 +581,7 @@ class DataTypeNode(Node):
|
|
subenc = dtnode.buildEncoding(nodeset=nodeset, indent=indent+1)
|
|
subenc = dtnode.buildEncoding(nodeset=nodeset, indent=indent+1)
|
|
self.__baseTypeEncoding__ = self.__baseTypeEncoding__ + [[fname, subenc, valueRank]]
|
|
self.__baseTypeEncoding__ = self.__baseTypeEncoding__ + [[fname, subenc, valueRank]]
|
|
if not dtnode.isEncodable():
|
|
if not dtnode.isEncodable():
|
|
- # If we inherit an encoding from an unencodable not, this node is
|
|
|
|
|
|
+ # If we inherit an encoding from an unencodable node, this node is
|
|
# also not encodable
|
|
# also not encodable
|
|
self.__encodable__ = False
|
|
self.__encodable__ = False
|
|
break
|
|
break
|