Commit eb54353c authored by oroulet's avatar oroulet

data_type should be nodeid and not an int

parent 61e0ad15
This diff is collapsed.
......@@ -118,7 +118,7 @@ class CodeGenerator:
self.write('')
#FIXME: next line is a weak way to find out if object is a datatype or not...
if not "Parameter" in obj.name and not "Result" in obj.name:
self.write(f'data_type = ObjectIds.{obj.name}')
self.write(f'data_type = NodeId(ObjectIds.{obj.name})')
self.write('')
switch_written = False
for field in obj.fields:
......
......@@ -1007,3 +1007,10 @@ async def test_import_xml_data_type_definition(opc):
s2 = await var.read_value()
assert s2.structs[1].toto == ss.structs[1].toto == 0.1
async def test_struct_data_type(opc):
assert isinstance(ua.AddNodesItem.data_type, ua.NodeId)
node = opc.opc.get_node(ua.AddNodesItem.data_type)
path = await node.get_path()
assert opc.opc.nodes.base_structure_type in path
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