|
@@ -478,14 +478,8 @@ def printe(string):
|
|
|
def printc(string):
|
|
|
print(string, end='\n', file=fc)
|
|
|
|
|
|
-printh('''/**
|
|
|
-* @file ''' + outname + '''_generated.h
|
|
|
-*
|
|
|
-* @brief Autogenerated data types
|
|
|
-*
|
|
|
-* Generated from ''' + inname + ''' with script ''' + sys.argv[0] + '''
|
|
|
-* on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + '''
|
|
|
-*/
|
|
|
+printh('''/* Generated from ''' + inname + ''' with script ''' + sys.argv[0] + '''
|
|
|
+ * on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + ''' */
|
|
|
|
|
|
|
|
|
|
|
@@ -501,17 +495,12 @@ extern "C" {
|
|
|
+ ('\n#include "ua_types_generated.h"\n' if args.namespace_id != 0 else '') + '''
|
|
|
|
|
|
/**
|
|
|
-* @ingroup types
|
|
|
-*
|
|
|
-* @defgroup ''' + outname + '''_generated Autogenerated ''' + outname + ''' Types
|
|
|
-*
|
|
|
-* @brief Data structures that are autogenerated from an XML-Schema.
|
|
|
-*
|
|
|
-* @{
|
|
|
-*/
|
|
|
+ * Additional Data Type Definitions
|
|
|
+ * ================================
|
|
|
+ */
|
|
|
''')
|
|
|
-printh("#define " + outname.upper() + "_COUNT %s\n" % (str(len(types))))
|
|
|
-printh("extern UA_EXPORT const UA_DataType " + outname.upper() + "[];\n")
|
|
|
+printh("#define " + outname.upper() + "_COUNT %s" % (str(len(types))))
|
|
|
+printh("extern UA_EXPORT const UA_DataType " + outname.upper() + "[" + outname.upper() + "_COUNT];")
|
|
|
|
|
|
i = 0
|
|
|
if sys.version_info[0] < 3:
|
|
@@ -520,41 +509,33 @@ else:
|
|
|
values = types.values()
|
|
|
|
|
|
for t in values:
|
|
|
- printh("")
|
|
|
+ printh("\n/**\n * " + t.name)
|
|
|
+ printh(" * " + "-" * len(t.name))
|
|
|
+ if t.description == "":
|
|
|
+ printh(" */")
|
|
|
+ else:
|
|
|
+ printh(" * " + t.description + " */")
|
|
|
if type(t) != BuiltinType:
|
|
|
- if t.description != "":
|
|
|
- printh("/** @brief " + t.description + " */")
|
|
|
- printh(t.typedef_c())
|
|
|
+ printh(t.typedef_c() + "\n")
|
|
|
printh("#define " + outname.upper() + "_" + t.name[3:].upper() + " " + str(i))
|
|
|
printh(t.functions_c(outname.upper()))
|
|
|
i += 1
|
|
|
|
|
|
printh('''
|
|
|
-/// @} /* end of group */\n
|
|
|
|
|
|
} // extern "C"
|
|
|
|
|
|
|
|
|
|
|
|
-printe('''/**
|
|
|
-* @file ''' + outname + '''_generated_encoding_binary.h
|
|
|
-*
|
|
|
-* @brief Binary encoding for autogenerated data types
|
|
|
-*
|
|
|
-* Generated from ''' + inname + ''' with script ''' + sys.argv[0] + '''
|
|
|
-* on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + '''
|
|
|
-*/\n
|
|
|
+printe('''/* Generated from ''' + inname + ''' with script ''' + sys.argv[0] + '''
|
|
|
+ * on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + ''' */
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
-printc('''/**
|
|
|
-* @file ''' + outname + '''_generated.c
|
|
|
-*
|
|
|
-* @brief Autogenerated data types
|
|
|
-*
|
|
|
-* Generated from ''' + inname + ''' with script ''' + sys.argv[0] + '''
|
|
|
-* on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + '''
|
|
|
-*/\n
|
|
|
+printc('''/* Generated from ''' + inname + ''' with script ''' + sys.argv[0] + '''
|
|
|
+ * on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + ''' */
|
|
|
+
|
|
|
|
|
|
|
|
|
|