--- 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):