Extend python<->PLC global variable description "GlobalDesc" to support Initial value setting.
Rebased from dporopat change "add initial value to runtime.py file", which means :
- GlobalDesc is used by some customized beremiz python runtime
- Those runtimes need to know what is initial value of these special variables
--- a/py_ext/PythonFileCTNMixin.py Wed Jan 10 14:35:04 2018 +0100
+++ b/py_ext/PythonFileCTNMixin.py Wed Jan 10 15:36:03 2018 +0100
@@ -119,6 +119,7 @@
"configname": configname.upper(),
"uppername": variable.getname().upper(),
"IECtype": variable.gettype(),
+ "initial" : repr(variable.getinitial()),
"pyextname": pyextname
},
self.CodeFile.variables.variable)
@@ -136,6 +137,7 @@
_%(pyextname)sGlobalsDesc.append((
"%(name)s",
"%(IECtype)s",
+ %(initial)s,
%(desc)s,
%(onchange)s,
%(opts)s))