graphics/SFC_Objects.py
changeset 383 25ffba02b6a8
parent 381 98890d848701
child 478 dc403c47af54
--- a/graphics/SFC_Objects.py	Fri Jul 24 09:55:11 2009 +0200
+++ b/graphics/SFC_Objects.py	Fri Jul 24 10:47:35 2009 +0200
@@ -272,9 +272,18 @@
                 return self.Action
         return None
     
+    # Returns action step connector 
+    def GetActionConnector(self):
+        return self.Action
+        
     # Returns input and output step connectors 
     def GetConnectors(self):
-        return {"input":self.Input,"output":self.Output,"action":self.Action}
+        connectors = {"inputs": [], "outputs": []}
+        if self.Input:
+            connectors["inputs"].append(self.Input)
+        if self.Output:
+            connectors["outputs"].append(self.Output)
+        return connectors
     
     # Test if point given is on step input or output connector
     def TestConnector(self, pt, direction = None, exclude=True):
@@ -319,7 +328,7 @@
         return None
     
     # Returns the connector connected to action
-    def GetActionConnector(self):
+    def GetActionConnected(self):
         if self.Action:
             wires = self.Action.GetWires()
             if len(wires) == 1:
@@ -491,7 +500,7 @@
     def RefreshModel(self, move=True):
         self.Parent.RefreshStepModel(self)
         if self.Action:
-            action = self.GetActionConnector()
+            action = self.GetActionConnected()
             if action:
                 action_block = action.GetParentBlock()
                 action_block.RefreshModel(False)
@@ -748,13 +757,16 @@
                 return self.Condition
         return None
     
+    # Returns the transition condition connector
+    def GetConditionConnector(self):
+        if self.Type == "connection":
+            return self.Condition
+        return None
+        
     # Returns input and output transition connectors
     def GetConnectors(self):
-        connectors = {"input":self.Input,"output":self.Output}
-        if self.Type == "connection":
-            connectors["connection"] = self.Condition
-        return connectors
-    
+        return {"inputs": [self.Input], "outputs": [self.Output]}
+        
     # Test if point given is on transition input or output connector
     def TestConnector(self, pt, direction = None, exclude=True):
         # Test input connector
@@ -1206,7 +1218,7 @@
     
     # Returns input and output divergence connectors 
     def GetConnectors(self):
-        return {"inputs":self.Inputs,"outputs":self.Outputs}
+        return {"inputs": self.Inputs, "outputs": self.Outputs}
     
     # Test if point given is on divergence input or output connector
     def TestConnector(self, pt, direction = None, exclude=True):
@@ -1553,6 +1565,10 @@
     def GetConnector(self, position = None, name = None):
         return self.Input
     
+    # Returns all the jump connectors 
+    def GetConnectors(self):
+        return {"inputs": [self.Input], "outputs": []}
+    
     # Test if point given is on jump input connector
     def TestConnector(self, pt, direction = None, exclude = True):
         # Test input connector
@@ -1782,6 +1798,10 @@
     def GetConnector(self, position = None, name = None):
         return self.Input
     
+    # Returns all the action block connectors 
+    def GetConnectors(self):
+        return {"inputs": [self.Input], "outputs": []}
+    
     # Test if point given is on action block input connector
     def TestConnector(self, pt, direction = None, exclude = True):
         # Test input connector