--- a/GraphicViewer.py Thu Apr 09 15:39:45 2009 +0200
+++ b/GraphicViewer.py Thu Apr 09 15:40:27 2009 +0200
@@ -206,12 +206,15 @@
pass
def AddPoint(self, tick, value):
- self.Datas.append((float(tick), {True:1., False:0.}.get(value, float(value))))
- if self.CurrentValue + self.CurrentRange == len(self.Datas) - 1:
- self.CurrentValue += 1
- self.RefreshView()
- elif len(self.Datas) < self.CurrentValue + self.CurrentRange:
- self.RefreshView()
+ if self:
+ self.Datas.append((float(tick), {True:1., False:0.}.get(value, float(value))))
+ if self.CurrentValue + self.CurrentRange == len(self.Datas) - 1:
+ self.CurrentValue += 1
+ self.RefreshView()
+ elif len(self.Datas) < self.CurrentValue + self.CurrentRange:
+ self.RefreshView()
+ else:
+ self.RefreshScrollBar()
def RefreshScrollBar(self):
self.CanvasPosition.SetScrollbar(self.CurrentValue, self.CurrentRange, len(self.Datas), self.CurrentRange)