Fix bug when modifying Function Block instance type without changing name
authorlaurent
Wed, 15 Feb 2012 00:30:02 +0100
changeset 646 97bed1acd860
parent 645 41782a92c2de
child 647 2d53c653d8d2
Fix bug when modifying Function Block instance type without changing name
PLCControler.py
dialogs/FBDBlockDialog.py
--- a/PLCControler.py	Wed Feb 15 00:29:02 2012 +0100
+++ b/PLCControler.py	Wed Feb 15 00:30:02 2012 +0100
@@ -2079,7 +2079,7 @@
                         self.RemoveEditedElementPouVar(tagname, old_type, old_name)
                     else:
                         self.AddEditedElementPouVar(tagname, new_type, new_name)
-                elif new_typeinfos["type"] != "function" and old_name != new_name:
+                elif new_typeinfos["type"] != "function":
                     self.ChangeEditedElementPouVar(tagname, old_type, old_name, new_type, new_name)
             elif new_name != old_name:
                 self.ChangeEditedElementPouVar(tagname, old_type, old_name, new_type, new_name)
--- a/dialogs/FBDBlockDialog.py	Wed Feb 15 00:29:02 2012 +0100
+++ b/dialogs/FBDBlockDialog.py	Wed Feb 15 00:30:02 2012 +0100
@@ -319,7 +319,6 @@
         return values
 
     def OnTypeTreeItemSelected(self, event):
-        self.BlockName.SetValue("")
         selected = event.GetItem()
         pydata = self.TypeTree.GetPyData(selected)
         if pydata["type"] != CATEGORY: