py_ext/PythonFileCTNMixin.py
changeset 1897 62f9cae9a25f
parent 1878 fb73a6b6622d
child 1901 e8cf68d69447
equal deleted inserted replaced
1896:2081de16e726 1897:62f9cae9a25f
   117                 "onchange": _onchange(variable),
   117                 "onchange": _onchange(variable),
   118                 "opts": repr(variable.getopts()),
   118                 "opts": repr(variable.getopts()),
   119                 "configname": configname.upper(),
   119                 "configname": configname.upper(),
   120                 "uppername": variable.getname().upper(),
   120                 "uppername": variable.getname().upper(),
   121                 "IECtype": variable.gettype(),
   121                 "IECtype": variable.gettype(),
       
   122                 "initial" : repr(variable.getinitial()),
   122                 "pyextname": pyextname
   123                 "pyextname": pyextname
   123             },
   124             },
   124             self.CodeFile.variables.variable)
   125             self.CodeFile.variables.variable)
   125         # python side PLC global variables access stub
   126         # python side PLC global variables access stub
   126         globalstubs = "\n".join([
   127         globalstubs = "\n".join([
   134 _PySafeSetPLCGlob_%(name)s.restype = None
   135 _PySafeSetPLCGlob_%(name)s.restype = None
   135 _PySafeSetPLCGlob_%(name)s.argtypes = [ctypes.POINTER(_%(name)s_ctype)]
   136 _PySafeSetPLCGlob_%(name)s.argtypes = [ctypes.POINTER(_%(name)s_ctype)]
   136 _%(pyextname)sGlobalsDesc.append((
   137 _%(pyextname)sGlobalsDesc.append((
   137     "%(name)s",
   138     "%(name)s",
   138     "%(IECtype)s",
   139     "%(IECtype)s",
       
   140     %(initial)s,
   139     %(desc)s,
   141     %(desc)s,
   140     %(onchange)s,
   142     %(onchange)s,
   141     %(opts)s))
   143     %(opts)s))
   142 """ % varinfo for varinfo in varinfos])
   144 """ % varinfo for varinfo in varinfos])
   143 
   145