connectors/PYRO/__init__.py
changeset 446 1edde533db19
parent 411 8261c8f1e365
child 465 67d32a91d70b
equal deleted inserted replaced
441:379c66468cf6 446:1edde533db19
   110 
   110 
   111         def _PyroGetTraceVariables(self):
   111         def _PyroGetTraceVariables(self):
   112             """
   112             """
   113             for safe use in from debug thread, must use the copy
   113             for safe use in from debug thread, must use the copy
   114             """
   114             """
   115             if self.RemotePLCObjectProxyCopy is not None and self.RemotePLCObjectProxyCopy.GetPLCstatus() == "Started":
   115             return self.RemotePLCObjectProxyCopy.GetTraceVariables()
   116                 return self.RemotePLCObjectProxyCopy.GetTraceVariables()
   116         GetTraceVariables = PyroCatcher(_PyroGetTraceVariables,("Broken",None,None))
   117             else:
       
   118                 return None,None
       
   119         GetTraceVariables = PyroCatcher(_PyroGetTraceVariables,(None,None))
       
   120 
   117 
   121         def _PyroPLCIsStarting(self):
   118         def _PyroGetPLCstatus(self):
   122             """
   119             return RemotePLCObjectProxy.GetPLCstatus()
   123             for safe use in from debug thread, must use the copy
   120         GetPLCstatus = PyroCatcher(_PyroGetPLCstatus, "Broken")
   124             """
   121 
   125             return self.RemotePLCObjectProxyCopy is not None and self.RemotePLCObjectProxyCopy.GetPLCstatus() == "Starting"
       
   126         PLCIsStarting = PyroCatcher(_PyroPLCIsStarting,False)
       
   127         
       
   128         def __getattr__(self, attrName):
   122         def __getattr__(self, attrName):
   129             member = self.__dict__.get(attrName, None)
   123             member = self.__dict__.get(attrName, None)
   130             if member is None:
   124             if member is None:
   131                 def my_local_func(*args,**kwargs):
   125                 def my_local_func(*args,**kwargs):
   132                     return RemotePLCObjectProxy.__getattr__(attrName)(*args,**kwargs)
   126                     return RemotePLCObjectProxy.__getattr__(attrName)(*args,**kwargs)