--- a/graphics/GraphicCommons.py Tue Oct 06 09:26:05 2009 +0200
+++ b/graphics/GraphicCommons.py Thu Oct 08 16:39:08 2009 +0200
@@ -247,6 +247,8 @@
consumer.Inhibit(inhibit)
def AddDataConsumer(self, iec_path, consumer):
+ if self.DataProducer is None:
+ return False
result = self.DataProducer.SubscribeDebugIECVariable(iec_path, consumer) is not None
if result is not None and consumer != self:
self.DataConsumers[consumer] = iec_path
@@ -258,8 +260,9 @@
self.DataProducer.UnsubscribeDebugIECVariable(iec_path, consumer)
def DeleteDataConsumers(self):
- for consumer, iec_path in self.DataConsumers.iteritems():
- self.DataProducer.UnsubscribeDebugIECVariable(iec_path, consumer)
+ if self.DataProducer is not None:
+ for consumer, iec_path in self.DataConsumers.iteritems():
+ self.DataProducer.UnsubscribeDebugIECVariable(iec_path, consumer)
self.DataConsumers = {}
def OnRefreshTimer(self, event):