Commit a2e39cf5 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Almost there...

parent d194fdf3
......@@ -548,11 +548,14 @@ class asn1Editor(QTreeView):
# get the mapping to retrieve the integer value
intMappings = self.model.item(row, 3).data(INTMAP)
for enumerant, num in intMappings.viewitems():
# XXX if value is not initialized and no enum has value 0
# an error will be raised
print type(num), num, enumerant
if num == value:
self.model.item(row, 3).setText(enumerant)
break
else:
self.log.error("ENUMERATED value '{}'not found".format(value))
self.log.error("ENUMERATED value '{}' not found".format(value))
else: # SEQUENCE or SET
self.updateModel(root, asn1Instance)
if asnType in ('INTEGER', 'REAL', 'SEQOF'):
......
......@@ -276,8 +276,7 @@ def valueNotationToCTypes(gser, dest, sort, ASN1Mod, ASN1_AST, var=None):
if 'Enum' in inp:
# Get proper enum id from the ASN1SCC AST
enum_id = sort.EnumValues[inp['Enum'].replace('_', '-')].EnumID
print ASN1Mod.DV.__file__
#print ASN1Mod.DV.__file__
val = getattr(ASN1Mod.DV, enum_id)
outp.Set(val)
elif 'Choice' in inp:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment