connectors/PYRO/__init__.py
changeset 465 67d32a91d70b
parent 446 1edde533db19
child 477 f66a092b6e74
equal deleted inserted replaced
464:46dd4358e8a8 465:67d32a91d70b
    90             pluginsroot._connector.GetPyroProxy() is used 
    90             pluginsroot._connector.GetPyroProxy() is used 
    91             rather than RemotePLCObjectProxy because
    91             rather than RemotePLCObjectProxy because
    92             object is recreated meanwhile, 
    92             object is recreated meanwhile, 
    93             so we must not keep ref to it here
    93             so we must not keep ref to it here
    94             """
    94             """
    95             if pluginsroot._connector.GetPyroProxy().GetPLCstatus() == "Dirty":
    95             current_status = pluginsroot._connector.GetPyroProxy().GetPLCstatus()
       
    96             if current_status == "Dirty":
    96                 """
    97                 """
    97                 Some bad libs with static symbols may polute PLC
    98                 Some bad libs with static symbols may polute PLC
    98                 ask runtime to suicide and come back again
    99                 ask runtime to suicide and come back again
    99                 """
   100                 """
   100                 pluginsroot.logger.write(_("Force runtime reload\n"))
   101                 pluginsroot.logger.write(_("Force runtime reload\n"))
   110 
   111 
   111         def _PyroGetTraceVariables(self):
   112         def _PyroGetTraceVariables(self):
   112             """
   113             """
   113             for safe use in from debug thread, must use the copy
   114             for safe use in from debug thread, must use the copy
   114             """
   115             """
       
   116             if self.RemotePLCObjectProxyCopy is None:
       
   117                 self.RemotePLCObjectProxyCopy = copy.copy(pluginsroot._connector.GetPyroProxy())
   115             return self.RemotePLCObjectProxyCopy.GetTraceVariables()
   118             return self.RemotePLCObjectProxyCopy.GetTraceVariables()
   116         GetTraceVariables = PyroCatcher(_PyroGetTraceVariables,("Broken",None,None))
   119         GetTraceVariables = PyroCatcher(_PyroGetTraceVariables,("Broken",None,None))
   117 
   120 
   118         def _PyroGetPLCstatus(self):
   121         def _PyroGetPLCstatus(self):
   119             return RemotePLCObjectProxy.GetPLCstatus()
   122             return RemotePLCObjectProxy.GetPLCstatus()