Skip to content

Commit

Permalink
feat: support nested structures.
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 30, 2024
1 parent af1b102 commit 1cf169e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions asyncua/common/structures104.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ class {struct_name}{base_class}:
uatype = ua.basetype_by_datatype[sfield.DataType]
elif sfield.DataType == data_type:
uatype = struct_name
elif sfield.DataType != data_type and isinstance(sfield, ua.uaprotocol_auto.StructureField):
uatype = "uaprotocol_auto.StructureField" #field name is also a structure
else:
if log_error:
_logger.error("Unknown datatype for field: %s in structure:%s, please report", sfield, struct_name)
Expand Down Expand Up @@ -260,6 +262,7 @@ def {name}(self, value: {uatype}) -> None:
else:
for fname, uatype, default_value in fields:
code += f" {fname}: {uatype} = {default_value}\n"
print(f"testprint: structure {fname} has Python class {code}")
return code


Expand Down

0 comments on commit 1cf169e

Please sign in to comment.