runtime/PLCObject.py
changeset 2600 0e20a0d48fae
parent 2596 779e8dbf1ee1
child 2602 19dc6b830e7d
equal deleted inserted replaced
2599:b4649f014a39 2600:0e20a0d48fae
   386         self.PythonRuntimeCall("init", use_evaluator=False)
   386         self.PythonRuntimeCall("init", use_evaluator=False)
   387 
   387 
   388         self.PythonThreadCondLock = Lock()
   388         self.PythonThreadCondLock = Lock()
   389         self.PythonThreadCond = Condition(self.PythonThreadCondLock)
   389         self.PythonThreadCond = Condition(self.PythonThreadCondLock)
   390         self.PythonThreadCmd = "Wait"
   390         self.PythonThreadCmd = "Wait"
   391         self.PythonThread = Thread(target=self.PythonThreadProc)
   391         self.PythonThread = Thread(target=self.PythonThreadProc, name="PLCPythonThread")
   392         self.PythonThread.start()
   392         self.PythonThread.start()
   393 
   393 
   394     # used internaly
   394     # used internaly
   395     def PythonRuntimeCleanup(self):
   395     def PythonRuntimeCleanup(self):
   396         if self.python_runtime_vars is not None:
   396         if self.python_runtime_vars is not None:
   643         return None
   643         return None
   644 
   644 
   645     def _TracesSwap(self):
   645     def _TracesSwap(self):
   646         self.LastSwapTrace = time()
   646         self.LastSwapTrace = time()
   647         if self.TraceThread is None and self.PLCStatus == PlcStatus.Started:
   647         if self.TraceThread is None and self.PLCStatus == PlcStatus.Started:
   648             self.TraceThread = Thread(target=self.TraceThreadProc)
   648             self.TraceThread = Thread(target=self.TraceThreadProc, name="PLCTrace")
   649             self.TraceThread.start()
   649             self.TraceThread.start()
   650         self.TraceLock.acquire()
   650         self.TraceLock.acquire()
   651         Traces = self.Traces
   651         Traces = self.Traces
   652         self.Traces = []
   652         self.Traces = []
   653         self.TraceLock.release()
   653         self.TraceLock.release()