|
@@ -54,7 +54,7 @@ class opcua_value_t():
|
|
self.value = None
|
|
self.value = None
|
|
self.parent = parent
|
|
self.parent = parent
|
|
self.stringRepresentation = ""
|
|
self.stringRepresentation = ""
|
|
- self.setStringReprentation()
|
|
|
|
|
|
+ self.setStringRepresentation()
|
|
self.__binTypeId__ = 0
|
|
self.__binTypeId__ = 0
|
|
self.setNumericRepresentation()
|
|
self.setNumericRepresentation()
|
|
self.__alias__ = None
|
|
self.__alias__ = None
|
|
@@ -313,7 +313,7 @@ class opcua_value_t():
|
|
ebodypart = getNextElementNode(ebodypart)
|
|
ebodypart = getNextElementNode(ebodypart)
|
|
return extobj
|
|
return extobj
|
|
|
|
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
pass
|
|
pass
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -368,7 +368,7 @@ class opcua_value_t():
|
|
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:
|
|
logger.debug("Building extObj array index " + str(self.value.index(v)))
|
|
logger.debug("Building extObj array index " + str(self.value.index(v)))
|
|
- code = code + v.printOpen62541CCode_SubType_build(arrayIndex=self.value.index(v))
|
|
|
|
|
|
+ code.extend(v.printOpen62541CCode_SubType_build(arrayIndex=self.value.index(v)))
|
|
#code.append("attr.value.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:
|
|
@@ -394,7 +394,7 @@ class opcua_value_t():
|
|
else:
|
|
else:
|
|
# 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.extend(self.value[0].printOpen62541CCode_SubType_build())
|
|
#code.append("attr.value.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() + ";")
|
|
@@ -420,7 +420,7 @@ class opcua_value_t():
|
|
###
|
|
###
|
|
|
|
|
|
class opcua_BuiltinType_extensionObject_t(opcua_value_t):
|
|
class opcua_BuiltinType_extensionObject_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "ExtensionObject"
|
|
self.stringRepresentation = "ExtensionObject"
|
|
self.__typeId__ = None
|
|
self.__typeId__ = None
|
|
|
|
|
|
@@ -539,7 +539,7 @@ class opcua_BuiltinType_extensionObject_t(opcua_value_t):
|
|
return "'" + self.alias() + "':" + self.stringRepresentation + "(" + str(self.value) + ")"
|
|
return "'" + self.alias() + "':" + self.stringRepresentation + "(" + str(self.value) + ")"
|
|
|
|
|
|
class opcua_BuiltinType_localizedtext_t(opcua_value_t):
|
|
class opcua_BuiltinType_localizedtext_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "LocalizedText"
|
|
self.stringRepresentation = "LocalizedText"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -606,7 +606,7 @@ class opcua_BuiltinType_localizedtext_t(opcua_value_t):
|
|
return code
|
|
return code
|
|
|
|
|
|
class opcua_BuiltinType_expandednodeid_t(opcua_value_t):
|
|
class opcua_BuiltinType_expandednodeid_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "ExpandedNodeId"
|
|
self.stringRepresentation = "ExpandedNodeId"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -625,7 +625,7 @@ class opcua_BuiltinType_expandednodeid_t(opcua_value_t):
|
|
return code
|
|
return code
|
|
|
|
|
|
class opcua_BuiltinType_nodeid_t(opcua_value_t):
|
|
class opcua_BuiltinType_nodeid_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "NodeId"
|
|
self.stringRepresentation = "NodeId"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -677,7 +677,7 @@ class opcua_BuiltinType_nodeid_t(opcua_value_t):
|
|
return "UA_NODEID_NUMERIC(0,0)"
|
|
return "UA_NODEID_NUMERIC(0,0)"
|
|
|
|
|
|
class opcua_BuiltinType_datetime_t(opcua_value_t):
|
|
class opcua_BuiltinType_datetime_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "DateTime"
|
|
self.stringRepresentation = "DateTime"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -718,7 +718,7 @@ class opcua_BuiltinType_datetime_t(opcua_value_t):
|
|
self.value = strptime(strftime("%Y-%m-%dT%H:%M%S"), "%Y-%m-%dT%H:%M%S")
|
|
self.value = strptime(strftime("%Y-%m-%dT%H:%M%S"), "%Y-%m-%dT%H:%M%S")
|
|
|
|
|
|
class opcua_BuiltinType_qualifiedname_t(opcua_value_t):
|
|
class opcua_BuiltinType_qualifiedname_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "QualifiedName"
|
|
self.stringRepresentation = "QualifiedName"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -764,7 +764,7 @@ class opcua_BuiltinType_qualifiedname_t(opcua_value_t):
|
|
return code
|
|
return code
|
|
|
|
|
|
class opcua_BuiltinType_statuscode_t(opcua_value_t):
|
|
class opcua_BuiltinType_statuscode_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "StatusCode"
|
|
self.stringRepresentation = "StatusCode"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -777,7 +777,7 @@ class opcua_BuiltinType_statuscode_t(opcua_value_t):
|
|
logger.warn("Not implemented")
|
|
logger.warn("Not implemented")
|
|
|
|
|
|
class opcua_BuiltinType_diagnosticinfo_t(opcua_value_t):
|
|
class opcua_BuiltinType_diagnosticinfo_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "StatusCode"
|
|
self.stringRepresentation = "StatusCode"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -790,7 +790,7 @@ class opcua_BuiltinType_diagnosticinfo_t(opcua_value_t):
|
|
logger.warn("Not implemented")
|
|
logger.warn("Not implemented")
|
|
|
|
|
|
class opcua_BuiltinType_guid_t(opcua_value_t):
|
|
class opcua_BuiltinType_guid_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Guid"
|
|
self.stringRepresentation = "Guid"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -833,7 +833,7 @@ class opcua_BuiltinType_guid_t(opcua_value_t):
|
|
self.value = tmp
|
|
self.value = tmp
|
|
|
|
|
|
class opcua_BuiltinType_boolean_t(opcua_value_t):
|
|
class opcua_BuiltinType_boolean_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Boolean"
|
|
self.stringRepresentation = "Boolean"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -867,7 +867,7 @@ class opcua_BuiltinType_boolean_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_byte_t(opcua_value_t):
|
|
class opcua_BuiltinType_byte_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Byte"
|
|
self.stringRepresentation = "Byte"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -901,7 +901,7 @@ class opcua_BuiltinType_byte_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_sbyte_t(opcua_value_t):
|
|
class opcua_BuiltinType_sbyte_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "SByte"
|
|
self.stringRepresentation = "SByte"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -935,7 +935,7 @@ class opcua_BuiltinType_sbyte_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_int16_t(opcua_value_t):
|
|
class opcua_BuiltinType_int16_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Int16"
|
|
self.stringRepresentation = "Int16"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -969,7 +969,7 @@ class opcua_BuiltinType_int16_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_uint16_t(opcua_value_t):
|
|
class opcua_BuiltinType_uint16_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "UInt16"
|
|
self.stringRepresentation = "UInt16"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1003,7 +1003,7 @@ class opcua_BuiltinType_uint16_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_int32_t(opcua_value_t):
|
|
class opcua_BuiltinType_int32_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Int32"
|
|
self.stringRepresentation = "Int32"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1037,7 +1037,7 @@ class opcua_BuiltinType_int32_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_uint32_t(opcua_value_t):
|
|
class opcua_BuiltinType_uint32_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "UInt32"
|
|
self.stringRepresentation = "UInt32"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1071,7 +1071,7 @@ class opcua_BuiltinType_uint32_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_int64_t(opcua_value_t):
|
|
class opcua_BuiltinType_int64_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Int64"
|
|
self.stringRepresentation = "Int64"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1101,7 +1101,7 @@ class opcua_BuiltinType_int64_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_uint64_t(opcua_value_t):
|
|
class opcua_BuiltinType_uint64_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "UInt64"
|
|
self.stringRepresentation = "UInt64"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1135,7 +1135,7 @@ class opcua_BuiltinType_uint64_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_float_t(opcua_value_t):
|
|
class opcua_BuiltinType_float_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Float"
|
|
self.stringRepresentation = "Float"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1169,7 +1169,7 @@ class opcua_BuiltinType_float_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_double_t(opcua_value_t):
|
|
class opcua_BuiltinType_double_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "Double"
|
|
self.stringRepresentation = "Double"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1203,7 +1203,7 @@ class opcua_BuiltinType_double_t(opcua_value_t):
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
return "(UA_" + self.stringRepresentation + ") " + str(self.value)
|
|
|
|
|
|
class opcua_BuiltinType_string_t(opcua_value_t):
|
|
class opcua_BuiltinType_string_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "String"
|
|
self.stringRepresentation = "String"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1240,7 +1240,7 @@ class opcua_BuiltinType_string_t(opcua_value_t):
|
|
return code
|
|
return code
|
|
|
|
|
|
class opcua_BuiltinType_xmlelement_t(opcua_BuiltinType_string_t):
|
|
class opcua_BuiltinType_xmlelement_t(opcua_BuiltinType_string_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "XmlElement"
|
|
self.stringRepresentation = "XmlElement"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|
|
@@ -1251,7 +1251,7 @@ class opcua_BuiltinType_xmlelement_t(opcua_BuiltinType_string_t):
|
|
return code
|
|
return code
|
|
|
|
|
|
class opcua_BuiltinType_bytestring_t(opcua_value_t):
|
|
class opcua_BuiltinType_bytestring_t(opcua_value_t):
|
|
- def setStringReprentation(self):
|
|
|
|
|
|
+ def setStringRepresentation(self):
|
|
self.stringRepresentation = "ByteString"
|
|
self.stringRepresentation = "ByteString"
|
|
|
|
|
|
def setNumericRepresentation(self):
|
|
def setNumericRepresentation(self):
|