Adding support for unsubscribe all variables while transferring
authorlbessard
Thu, 09 Apr 2009 15:27:45 +0200
changeset 334 b4131e5d10a4
parent 333 e90aebdd2af1
child 335 c5f3f71e7260
Adding support for unsubscribe all variables while transferring
plugger.py
--- a/plugger.py	Wed Apr 08 15:16:45 2009 +0200
+++ b/plugger.py	Thu Apr 09 15:27:45 2009 +0200
@@ -1476,6 +1476,13 @@
 
         self.ReArmDebugRegisterTimer()
 
+    def UnsubscribeAllDebugIECVariable(self):
+        self.IECdebug_lock.acquire()
+        IECdebug_data = {}
+        self.IECdebug_lock.release()
+
+        self.ReArmDebugRegisterTimer()        
+
     def DebugThreadProc(self):
         """
         This thread waid PLC debug data, and dispatch them to subscribers
@@ -1681,8 +1688,8 @@
                 if self._connector.NewPLC(MD5, data, extrafiles):
                     if self.PLCDebug is not None:
                         self.PLCDebug.Close()
-                        self.TracedIECPath = []
                         self.PLCDebug = None
+                    self.UnsubscribeAllDebugIECVariable()
                     self.ProgramTransferred()
                     self.logger.write("Transfer completed successfully.\n")
                 else: