# HG changeset patch # User lbessard # Date 1201715329 -3600 # Node ID de1845119cdd5f29384b4d94fae06ddb2c45277b # Parent e464a4e4e06d9b43386d71dd0a302955d07855d8 Bug on transition connection fixed diff -r e464a4e4e06d -r de1845119cdd plcopen/plcopen.py --- a/plcopen/plcopen.py Wed Jan 30 18:48:05 2008 +0100 +++ b/plcopen/plcopen.py Wed Jan 30 18:48:49 2008 +0100 @@ -24,7 +24,7 @@ from xmlclass import * from types import * -import os +import os, re """ Dictionary that makes the relation between var names in plcopen and displayed values @@ -993,7 +993,7 @@ condition.setcontent({"name" : "ST", "value" : PLCOpenClasses["formattedText"]()}) condition.settext(value) elif type == "connection": - condition = [] + condition = [PLCOpenClasses["connection"]()] self.condition.setcontent({"name" : type, "value" : condition}) setattr(cls, "setconditionContent", setconditionContent) @@ -1023,9 +1023,10 @@ if self.condition: content = self.condition.getcontent() if content["name"] != "connection": - self.condition.setcontent({"name" : "connection", "value" : []}) + self.condition.setcontent({"name" : "connection", "value" : [PLCOpenClasses["connection"]()]}) content = self.condition.getcontent() - content["value"].append(PLCOpenClasses["connection"]()) + else: + content["value"].append(PLCOpenClasses["connection"]()) setattr(cls, "addconnection", addconnection) def removeconnection(self, idx): @@ -1039,7 +1040,7 @@ if self.condition: content = self.condition.getcontent() if content["name"] == "connection": - content["value"] = [] + content["value"] = [PLCOpenClasses["connection"]()] setattr(cls, "removeconnections", removeconnections) def getconnections(self):