# HG changeset patch # User lbessard # Date 1239284427 -7200 # Node ID 0acc2bd658f060eb12a4da5a4ed8adf2871e83a0 # Parent dc8ff76b39fd682b10db2b0c0b673d650c7aac7f Bug while closing GraphicViewer and PLC running generating errors fixed diff -r dc8ff76b39fd -r 0acc2bd658f0 GraphicViewer.py --- 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)