runtime/PLCObject.py
changeset 2324 1cf3768ebf85
parent 2309 d8fb90a2e11f
child 2429 15f18dc8b56a
equal deleted inserted replaced
2323:33a0dbabccd3 2324:1cf3768ebf85
    31 from time import time
    31 from time import time
    32 import _ctypes  # pylint: disable=wrong-import-order
    32 import _ctypes  # pylint: disable=wrong-import-order
    33 
    33 
    34 from runtime.typemapping import TypeTranslator
    34 from runtime.typemapping import TypeTranslator
    35 from runtime.loglevels import LogLevelsDefault, LogLevelsCount
    35 from runtime.loglevels import LogLevelsDefault, LogLevelsCount
       
    36 from runtime.Stunnel import getPSKID
    36 from runtime import MainWorker
    37 from runtime import MainWorker
    37 
    38 
    38 if os.name in ("nt", "ce"):
    39 if os.name in ("nt", "ce"):
    39     dlopen = _ctypes.LoadLibrary
    40     dlopen = _ctypes.LoadLibrary
    40     dlclose = _ctypes.FreeLibrary
    41     dlclose = _ctypes.FreeLibrary
   436     @RunInMain
   437     @RunInMain
   437     def GetPLCstatus(self):
   438     def GetPLCstatus(self):
   438         return self.PLCStatus, map(self.GetLogCount, xrange(LogLevelsCount))
   439         return self.PLCStatus, map(self.GetLogCount, xrange(LogLevelsCount))
   439 
   440 
   440     @RunInMain
   441     @RunInMain
       
   442     def GetPLCID(self):
       
   443         return getPSKID()
       
   444 
       
   445     @RunInMain
   441     def NewPLC(self, md5sum, data, extrafiles):
   446     def NewPLC(self, md5sum, data, extrafiles):
   442         if self.PLCStatus in ["Stopped", "Empty", "Broken"]:
   447         if self.PLCStatus in ["Stopped", "Empty", "Broken"]:
   443             NewFileName = md5sum + lib_ext
   448             NewFileName = md5sum + lib_ext
   444             extra_files_log = os.path.join(self.workingdir, "extra_files.txt")
   449             extra_files_log = os.path.join(self.workingdir, "extra_files.txt")
   445 
   450