--- a/PLCControler.py Mon Sep 17 17:50:41 2007 +0200
+++ b/PLCControler.py Mon Sep 17 17:51:05 2007 +0200
@@ -1498,6 +1498,12 @@
def SetCurrentElementEditingBlockInfos(self, id, infos):
block = self.GetCurrentElementEditing().getInstance(id)
+ if "name" in infos or "type" in infos:
+ old_name = block.getInstanceName()
+ old_type = block.getTypeName()
+ new_name = infos.get("name", old_name)
+ new_type = infos.get("type", old_type)
+ self.GetCurrentElementEditing().changePouVar(old_type, old_name, new_type, new_name)
for param, value in infos.items():
if param == "name":
block.setInstanceName(value)
@@ -1975,9 +1981,7 @@
if self.CurrentElementEditing != None:
name = self.ElementsOpened[self.CurrentElementEditing]
words = name.split("::")
- if len(words) == 1:
- element.removePouVar(blocktype, instance.getInstanceName())
- elif words[0] in ['T', 'A']:
+ if words[0] in ["P","T","A"]:
pou = self.Project.getPou(words[1])
pou.removePouVar(blocktype, instance.getInstanceName())
element.removeInstance(id)