graphics/SFC_Objects.py
changeset 361 62570186dad4
parent 327 7fd5233ce5ce
child 368 591ba4003d74
--- a/graphics/SFC_Objects.py	Thu May 28 08:10:18 2009 +0200
+++ b/graphics/SFC_Objects.py	Sat May 30 17:15:22 2009 +0200
@@ -41,11 +41,12 @@
 Class that implements the graphic representation of a step
 """
 
-class SFC_Step(Graphic_Element):
+class SFC_Step(Graphic_Element, DebugDataConsumer):
     
     # Create a new step
     def __init__(self, parent, name, initial = False, id = None):
         Graphic_Element.__init__(self, parent)
+        DebugDataConsumer.__init__(self)
         self.SetName(name)
         self.Initial = initial
         self.Id = id
@@ -58,7 +59,6 @@
             self.Input = None
         self.Output = None
         self.Action = None
-        self.Value = None
         self.PreviousValue = None
         self.PreviousSpreading = False
     
@@ -77,7 +77,7 @@
         self.PreviousValue = self.Value
         self.Value = value
         if self.Value != self.PreviousValue:
-            self.Refresh()
+            self.Parent.UpdateRefreshRect(self.GetRedrawRect())
             self.SpreadCurrent()
     
     def SpreadCurrent(self):
@@ -547,11 +547,12 @@
 Class that implements the graphic representation of a transition
 """
 
-class SFC_Transition(Graphic_Element):
+class SFC_Transition(Graphic_Element, DebugDataConsumer):
     
     # Create a new transition
     def __init__(self, parent, type = "reference", condition = None, priority = 0, id = None):
         Graphic_Element.__init__(self, parent)
+        DebugDataConsumer.__init__(self)
         self.Type = None
         self.Id = id
         self.Priority = 0
@@ -562,7 +563,6 @@
         self.SetType(type, condition)
         self.SetPriority(priority)
         self.Errors = {}
-        self.Value = None
         self.PreviousValue = None
         self.PreviousSpreading = False
     
@@ -581,7 +581,7 @@
         self.PreviousValue = self.Value
         self.Value = value
         if self.Value != self.PreviousValue:
-            self.Refresh()
+            self.Parent.UpdateRefreshRect(self.GetRedrawRect())
             self.SpreadCurrent()
     
     def SpreadCurrent(self):
@@ -1029,11 +1029,11 @@
             else:
                 self.Value = False
             if self.Value and not self.PreviousValue:
-                self.Refresh()
+                self.Parent.UpdateRefreshRect(self.GetRedrawRect())
                 for output in self.Outputs:
                     output.SpreadCurrent(True)
             elif not self.Value and self.PreviousValue:
-                self.Refresh()
+                self.Parent.UpdateRefreshRect(self.GetRedrawRect())
                 for output in self.Outputs:
                     output.SpreadCurrent(False)
     
@@ -1469,7 +1469,7 @@
             self.PreviousValue = self.Value
             self.Value = self.Input.ReceivingCurrent()
             if self.Value != self.PreviousValue:
-                self.Refresh()
+                self.Parent.UpdateRefreshRect(self.GetRedrawRect())
     
     # Make a clone of this SFC_Jump
     def Clone(self, parent, id = None, pos = None):
@@ -1714,7 +1714,7 @@
             self.PreviousValue = self.Value
             self.Value = self.Input.ReceivingCurrent()
             if self.Value != self.PreviousValue:
-                self.Refresh()
+                self.Parent.UpdateRefreshRect(self.GetRedrawRect())
     
     # Make a clone of this SFC_ActionBlock
     def Clone(self, parent, id = None, pos = None):