|
@@ -15,6 +15,7 @@ from io import open
|
|
|
parser = argparse.ArgumentParser()
|
|
|
parser.add_argument('statuscodes', help='path/to/Opc.Ua.NodeIds.csv')
|
|
|
parser.add_argument('outfile', help='outfile w/o extension')
|
|
|
+parser.add_argument('namespace', help='NS0')
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
rows = []
|
|
@@ -33,23 +34,22 @@ def printh(string):
|
|
|
|
|
|
printh(u'''/*---------------------------------------------------------
|
|
|
* Autogenerated -- do not modify
|
|
|
- * Generated from %s with script %s
|
|
|
+ * Generated from {0} with script {1}
|
|
|
*-------------------------------------------------------*/
|
|
|
|
|
|
-#ifndef UA_NODEIDS_H_
|
|
|
-#define UA_NODEIDS_H_
|
|
|
+#ifndef UA_NODEIDS_{2}_H_
|
|
|
+#define UA_NODEIDS_{2}_H_
|
|
|
|
|
|
/**
|
|
|
* Namespace Zero NodeIds
|
|
|
* ----------------------
|
|
|
* Numeric identifiers of standard-defined nodes in namespace zero. The
|
|
|
- * following definitions are autogenerated from the ``NodeIds.csv`` file
|
|
|
- * provided with the OPC UA standard. */
|
|
|
-''' % (args.statuscodes, sys.argv[0]))
|
|
|
+ * following definitions are autogenerated from the ``{0}`` file */
|
|
|
+'''.format(args.statuscodes, sys.argv[0], args.namespace))
|
|
|
|
|
|
for row in rows:
|
|
|
- printh(u"#define UA_NS0ID_%s %s /* %s */" % (row[0].upper(), row[1], row[2]))
|
|
|
+ printh(u"#define UA_{namespace}ID_{name} {id} /* {description} */".format(namespace=args.namespace, name=row[0].upper(), id=row[1], description=row[2]))
|
|
|
|
|
|
-printh(u'''#endif /* UA_NODEIDS_H_ */ ''')
|
|
|
+printh(u'''#endif /* UA_NODEIDS_{0}_H_ */ '''.format(args.namespace))
|
|
|
|
|
|
fh.close()
|