|
@@ -353,8 +353,7 @@ class opcua_value_t():
|
|
for v in self.value:
|
|
for v in self.value:
|
|
log(self, "Building extObj array index " + str(self.value.index(v)))
|
|
log(self, "Building extObj array index " + str(self.value.index(v)))
|
|
code = code + v.printOpen62541CCode_SubType_build(arrayIndex=self.value.index(v))
|
|
code = code + v.printOpen62541CCode_SubType_build(arrayIndex=self.value.index(v))
|
|
- code.append("UA_Variant *" + self.parent.getCodePrintableID() + "_variant = UA_Variant_new();")
|
|
|
|
- code.append(self.parent.getCodePrintableID() + "_variant->type = &UA_TYPES[UA_TYPES_" + self.value[0].stringRepresentation.upper() + "];")
|
|
|
|
|
|
+ code.append("attr.value.type = &UA_TYPES[UA_TYPES_" + self.value[0].stringRepresentation.upper() + "];")
|
|
code.append("UA_" + self.value[0].stringRepresentation + " " + valueName + "[" + str(len(self.value)) + "];")
|
|
code.append("UA_" + self.value[0].stringRepresentation + " " + valueName + "[" + str(len(self.value)) + "];")
|
|
if self.value[0].__binTypeId__ == BUILTINTYPE_TYPEID_EXTENSIONOBJECT:
|
|
if self.value[0].__binTypeId__ == BUILTINTYPE_TYPEID_EXTENSIONOBJECT:
|
|
for v in self.value:
|
|
for v in self.value:
|
|
@@ -380,8 +379,7 @@ class opcua_value_t():
|
|
# The following strategy applies to all other types, in particular strings and numerics.
|
|
# The following strategy applies to all other types, in particular strings and numerics.
|
|
if self.value[0].__binTypeId__ == BUILTINTYPE_TYPEID_EXTENSIONOBJECT:
|
|
if self.value[0].__binTypeId__ == BUILTINTYPE_TYPEID_EXTENSIONOBJECT:
|
|
code = code + self.value[0].printOpen62541CCode_SubType_build()
|
|
code = code + self.value[0].printOpen62541CCode_SubType_build()
|
|
- code.append("UA_Variant *" + self.parent.getCodePrintableID() + "_variant = UA_Variant_new();")
|
|
|
|
- code.append(self.parent.getCodePrintableID() + "_variant->type = &UA_TYPES[UA_TYPES_" + self.value[0].stringRepresentation.upper() + "];")
|
|
|
|
|
|
+ code.append("attr.value.type = &UA_TYPES[UA_TYPES_" + self.value[0].stringRepresentation.upper() + "];")
|
|
if self.value[0].__binTypeId__ == BUILTINTYPE_TYPEID_EXTENSIONOBJECT:
|
|
if self.value[0].__binTypeId__ == BUILTINTYPE_TYPEID_EXTENSIONOBJECT:
|
|
code.append("UA_" + self.value[0].stringRepresentation + " *" + valueName + " = " + self.value[0].printOpen62541CCode_SubType() + ";")
|
|
code.append("UA_" + self.value[0].stringRepresentation + " *" + valueName + " = " + self.value[0].printOpen62541CCode_SubType() + ";")
|
|
code.append("UA_Variant_setScalarCopy( &attr.value, " + valueName + ", &UA_TYPES[UA_TYPES_" + self.value[0].stringRepresentation.upper() + "]);")
|
|
code.append("UA_Variant_setScalarCopy( &attr.value, " + valueName + ", &UA_TYPES[UA_TYPES_" + self.value[0].stringRepresentation.upper() + "]);")
|