Commit 8d6b8540 authored by Maxime Perrotin's avatar Maxime Perrotin

Add support for optional fields in python A mapper

Generate .exist.<field> getters and setters
(used by autogenerated guis)
parent 35b09347
......@@ -408,6 +408,13 @@ def CreateGettersAndSetters(
for child in node._members:
childNode = child[1]
childVarname = CleanNameAsPythonWants(child[0])
if child[3]: # OPTIONAL field in a sequence
CreateGettersAndSetters(path + "_exist_" + childVarname,
accessPathInC + union + ".exist." + childVarname,
AsnInt(), # exist field is an int
names, # ignored
leafTypeDict) # ignored
if isinstance(childNode, AsnMetaMember):
baseTypeOfChild = names[childNode._containedType]._leafType
baseTypeOfChild = leafTypeDict.get(baseTypeOfChild, baseTypeOfChild)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment