--- a/graphics/FBD_Objects.py Mon Oct 13 16:07:52 2008 +0200
+++ b/graphics/FBD_Objects.py Fri Oct 17 16:22:15 2008 +0200
@@ -61,10 +61,15 @@
block.SetSize(self.Size[0], self.Size[1])
if pos is not None:
block.SetPosition(pos.x, pos.y)
+ else:
+ block.SetPosition(self.Pos.x, self.Pos.y)
block.Inputs = [input.Clone(block) for input in self.Inputs]
block.Outputs = [output.Clone(block) for output in self.Outputs]
return block
+ def GetConnectorTranslation(self, element):
+ return dict(zip(self.Inputs + self.Outputs, element.Inputs + element.Outputs))
+
def Flush(self):
for input in self.Inputs:
input.Flush()
@@ -440,12 +445,22 @@
variable.SetSize(self.Size[0], self.Size[1])
if pos is not None:
variable.SetPosition(pos.x, pos.y)
+ else:
+ variable.SetPosition(self.Pos.x, self.Pos.y)
if self.Input:
variable.Input = self.Input.Clone(variable)
if self.Output:
variable.Output = self.Output.Clone(variable)
return variable
+ def GetConnectorTranslation(self, element):
+ connectors = {}
+ if self.Input is not None:
+ connector[self.Input] = element.Input
+ if self.Output is not None:
+ connectors[self.Output] = element.Output
+ return connectors
+
def Flush(self):
if self.Input is not None:
self.Input.Flush()
@@ -706,9 +721,14 @@
connection.SetSize(self.Size[0], self.Size[1])
if pos is not None:
connection.SetPosition(pos.x, pos.y)
+ else:
+ connection.SetPosition(self.Pos.x, self.Pos.y)
connection.Connector = self.Connector.Clone(connection)
return connection
+ def GetConnectorTranslation(self, element):
+ return {self.Connector : element.Connector}
+
# Unconnect connector
def Clean(self):
if self.Connector: