Fixed bug Viewer not refreshed when debugging
authorLaurent Bessard
Fri, 31 May 2013 14:17:23 +0200
changeset 1205 638d1d430d24
parent 1204 8a620b460b49
child 1206 35046bc74554
Fixed bug Viewer not refreshed when debugging
editors/DebugViewer.py
editors/Viewer.py
--- a/editors/DebugViewer.py	Fri May 31 13:31:11 2013 +0200
+++ b/editors/DebugViewer.py	Fri May 31 14:17:23 2013 +0200
@@ -180,7 +180,7 @@
         if self.SubscribeTick and self.Debug and self.DataProducer is not None:
             self.DataProducer.SubscribeDebugIECVariable("__tick__", self)
     
-    def UnsubscribeAllDataConsumers(self):
+    def UnsubscribeAllDataConsumers(self, tick=True):
         """
         Called to Unsubscribe all data consumers.
         """
@@ -192,7 +192,7 @@
                             iec_path, consumer)
             
             # Unscribe tick if needed
-            if self.SubscribeTick and self.Debug:
+            if self.SubscribeTick and tick and self.Debug:
                 self.DataProducer.UnsubscribeDebugIECVariable("__tick__", self)
         
         self.DataConsumers = {}
--- a/editors/Viewer.py	Fri May 31 13:31:11 2013 +0200
+++ b/editors/Viewer.py	Fri May 31 14:17:23 2013 +0200
@@ -903,10 +903,10 @@
         self.ToolTipElement = None
     
     def Flush(self):
-        self.UnsubscribeAllDataConsumers()
+        self.UnsubscribeAllDataConsumers(tick=False)
         for block in self.Blocks.itervalues():
             block.Flush()
-    
+        
     # Remove all elements
     def CleanView(self):
         for block in self.Blocks.itervalues():
@@ -1062,7 +1062,7 @@
     def SubscribeAllDataConsumers(self):
         self.RefreshView()
         DebugViewer.SubscribeAllDataConsumers(self)
-    
+        
     # Refresh Viewer elements
     def RefreshView(self, variablepanel=True, selection=None):
         EditorPanel.RefreshView(self, variablepanel)