Fix bug when resetting graphs values
authorLaurent Bessard
Thu, 07 Feb 2013 00:49:52 +0100
changeset 927 bd3e5b65e8be
parent 926 2323981f5d41
child 928 a94e7fea7051
Fix bug when resetting graphs values
controls/DebugVariablePanel.py
--- a/controls/DebugVariablePanel.py	Wed Feb 06 01:21:01 2013 +0100
+++ b/controls/DebugVariablePanel.py	Thu Feb 07 00:49:52 2013 +0100
@@ -1162,6 +1162,8 @@
     
     def NewDataAvailable(self, tick, *args, **kwargs):
         if USE_MPL and tick is not None:
+            if len(self.Ticks) == 0:
+                self.StartTick = tick 
             self.Ticks = numpy.append(self.Ticks, [tick])
             if not self.Fixed or tick < self.StartTick + self.CurrentRange:
                 self.StartTick = max(self.StartTick, tick - self.CurrentRange)
@@ -1340,6 +1342,7 @@
     def ResetView(self):
         self.DeleteDataConsumers()
         if USE_MPL:
+            self.Fixed = False
             for panel in self.GraphicPanels:
                 panel.Destroy()
             self.GraphicPanels = []
@@ -1448,11 +1451,7 @@
         event.Skip()
     
     def OnResetButton(self, event):
-        self.StartTick = 0
-        self.Fixed = False
-        for panel in self.GraphicPanels:
-            panel.ResetData()
-        self.ForceRefresh()
+        self.ResetGraphicsValues()
         event.Skip()
 
     def OnCurrentButton(self, event):
@@ -1695,6 +1694,7 @@
         if USE_MPL:
             self.Ticks = numpy.array([])
             self.StartTick = 0
+            self.Fixed = False
             for panel in self.GraphicPanels:
                 panel.ResetData()