FBD_Variable don't remove wire when just expression changed
authorlbessard
Tue, 10 Jul 2007 17:30:41 +0200
changeset 32 cf9efccff009
parent 31 d833bf7567b1
child 33 0dd4a876392f
FBD_Variable don't remove wire when just expression changed
graphics/FBD_Objects.py
--- a/graphics/FBD_Objects.py	Tue Jul 10 14:29:31 2007 +0200
+++ b/graphics/FBD_Objects.py	Tue Jul 10 17:30:41 2007 +0200
@@ -392,9 +392,8 @@
     
     # Changes the variable type
     def SetType(self, type, value_type):
-        if type != self.Type or value_type != self.ValueType:
+        if type != self.Type:
             self.Type = type
-            self.ValueType = value_type
             self.Clean()
             self.Input = None
             self.Output = None
@@ -404,6 +403,12 @@
             if self.Type != OUTPUT:
                 self.Output = Connector(self, "", value_type, wxPoint(0, 0), EAST)
             self.RefreshConnectors()
+        elif value_type != self.ValueType:
+            if self.Input:
+                self.Input.SetType(value_type)
+            if self.Output:
+                self.Output.SetType(value_type)            
+        self.RefreshConnectors()
     
     # Returns the variable type
     def GetType(self):