--- a/Viewer.py Fri Oct 02 18:14:43 2009 +0200
+++ b/Viewer.py Tue Oct 06 09:26:05 2009 +0200
@@ -271,9 +271,7 @@
if len(values) > 2 and pou_type == "program":
var_name = values[3]
if var_name.upper() in [name.upper() for name in self.ParentWindow.Controler.GetProjectPouNames(self.ParentWindow.Debug)]:
- message = _("\"%s\" pou already exists!")%blockname
- elif var_name.upper() in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(tagname, self.ParentWindow.Debug)]:
- message = _("\"%s\" element for this pou already exists!")%blockname
+ message = _("\"%s\" pou already exists!")%var_name
else:
if values[0][1] == "Q":
var_class = OUTPUT
@@ -294,7 +292,8 @@
variable.SetPosition(x, y)
variable.SetSize(width, height)
self.ParentWindow.AddBlock(variable)
- self.ParentWindow.Controler.AddEditedElementPouVar(tagname, var_type, var_name, values[0], values[4])
+ if not var_name.upper() in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(tagname, self.ParentWindow.Debug)]:
+ self.ParentWindow.Controler.AddEditedElementPouVar(tagname, var_type, var_name, values[0], values[4])
self.ParentWindow.Controler.AddEditedElementVariable(tagname, id, var_class)
self.ParentWindow.RefreshVariableModel(variable)
self.ParentWindow.RefreshBuffer()