# HG changeset patch # User lbessard # Date 1187021059 -7200 # Node ID 8fbff50141f8c4487b77176a95d4d92fda0ce8c5 # Parent 66308e07402c2ceee1179aafaac07d9aad585f69 Bug on transition connection fixed diff -r 66308e07402c -r 8fbff50141f8 plcopen/plcopen.py --- a/plcopen/plcopen.py Fri Aug 10 16:14:33 2007 +0200 +++ b/plcopen/plcopen.py Mon Aug 13 18:04:19 2007 +0200 @@ -849,6 +849,8 @@ condition = PLCOpenClasses["condition_inline"]() condition.setContent("ST", PLCOpenClasses["formattedText"]()) condition.setText(value) + elif type == "connection": + condition = [] self.condition.setContent(type, condition) setattr(cls, "setConditionContent", setConditionContent) @@ -875,14 +877,12 @@ setattr(cls, "updateElementName", updateElementName) def addConnection(self): - print "addConnection" - if not self.condition: - self.addCondition() - content = self.condition.getContent() - if content["name"] != "connection": - self.condition.setContent("connection", []) + if self.condition: content = self.condition.getContent() - content["value"].append(PLCOpenClasses["connection"]()) + if content["name"] != "connection": + self.condition.setContent("connection", []) + content = self.condition.getContent() + content["value"].append(PLCOpenClasses["connection"]()) setattr(cls, "addConnection", addConnection) def removeConnection(self, idx): @@ -902,7 +902,6 @@ def getConnections(self): if self.condition: content = self.condition.getContent() - print "getConnections", content if content["name"] == "connection": return content["value"] setattr(cls, "getConnections", getConnections) @@ -912,7 +911,6 @@ content = self.condition.getContent() if content["name"] == "connection": content["value"][idx].setRefLocalId(id) - print "SetId", content setattr(cls, "setConnectionId", setConnectionId) def getConnectionId(self, idx): @@ -928,7 +926,6 @@ content = self.condition.getContent() if content["name"] == "connection": content["value"][idx].setPoints(points) - print "SetPoints", content setattr(cls, "setConnectionPoints", setConnectionPoints) def getConnectionPoints(self, idx): @@ -944,7 +941,6 @@ content = self.condition.getContent() if content["name"] == "connection": content["value"][idx].setFormalParameter(parameter) - print "SetParameter", content setattr(cls, "setConnectionParameter", setConnectionParameter) def getConnectionParameter(self, idx):