--- a/editors/Viewer.py Mon Dec 03 12:31:27 2012 +0100
+++ b/editors/Viewer.py Mon Dec 03 12:33:21 2012 +0100
@@ -3093,16 +3093,16 @@
return isinstance(element, FBD_Block) and element.GetName() != "" or isinstance(element, SFC_Step)
def CopyBlock(self, element, pos):
if isinstance(element, Graphic_Group):
block = element.Clone(self, pos=pos)
+ new_id = self.GetNewId() if self.IsNamedElement(element):
name = self.GenerateNewName(element)
- block = element.Clone(self, id, name, pos)
+ block = element.Clone(self, new_id, name, pos) - block = element.Clone(self, id, pos=pos)
+ block = element.Clone(self, new_id, pos=pos) self.AddBlockInModel(block)
--- a/plcopen/plcopen.py Mon Dec 03 12:31:27 2012 +0100
+++ b/plcopen/plcopen.py Mon Dec 03 12:33:21 2012 +0100
@@ -2330,7 +2330,7 @@
setattr(cls, "compatibility", compatibility)
-cls = _initElementClass("transition", "sfcObjects_transition", "single")
+cls = _initElementClass("transition", "sfcObjects_transition") infos = _getelementinfos(self)
@@ -2382,6 +2382,46 @@
setattr(cls, "getconditionContent", getconditionContent)
+ def getconditionConnection(self): + content = self.condition.getcontent() + if content["name"] == "connectionPointIn": + return content["value"] + setattr(cls, "getconditionConnection", getconditionConnection) + def getBoundingBox(self): + bbox = _getBoundingBoxSingle(self) + condition_connection = self.getconditionConnection() + if condition_connection: + bbox.union(_getConnectionsBoundingBox(condition_connection)) + setattr(cls, "getBoundingBox", getBoundingBox) + def translate(self, dx, dy): + _translateSingle(self, dx, dy) + condition_connection = self.getconditionConnection() + if condition_connection: + _translateConnections(condition_connection, dx, dy) + setattr(cls, "translate", translate) + def filterConnections(self, connections): + _filterConnectionsSingle(self, connections) + condition_connection = self.getconditionConnection() + if condition_connection: + _filterConnections(condition_connection, self.localId, connections) + setattr(cls, "filterConnections", filterConnections) + def updateConnectionsId(self, translation): + if self.connectionPointIn is not None: + connections_end = _updateConnectionsId(self.connectionPointIn, translation) + condition_connection = self.getconditionConnection() + if condition_connection: + connections_end.extend(_updateConnectionsId(condition_connection, translation)) + return _getconnectionsdefinition(self, connections_end) + setattr(cls, "updateConnectionsId", updateConnectionsId) def updateElementName(self, old_name, new_name):
content = self.condition.getcontent()
@@ -2402,10 +2442,10 @@
setattr(cls, "updateElementAddress", updateElementAddress)
def getconnections(self):
- content = self.condition.getcontent()
- if content["name"] == "connectionPointIn":
- return content["value"].getconnections()
+ condition_connection = self.getconditionConnection() + if condition_connection: + return condition_connection.getconnections() setattr(cls, "getconnections", getconnections)
def Search(self, criteria, parent_infos=[]):