Fix bug when modifying IEC_Channel
authorLaurent Bessard
Sun, 23 Sep 2012 23:56:53 +0200
changeset 842 3c4c1e076a34
parent 841 8e19df12b596
child 843 7e6fb43804a8
Fix bug when modifying IEC_Channel
ConfigTreeNode.py
ProjectController.py
--- a/ConfigTreeNode.py	Sun Sep 23 23:34:04 2012 +0200
+++ b/ConfigTreeNode.py	Sun Sep 23 23:56:53 2012 +0200
@@ -136,8 +136,9 @@
         if path == "BaseParams.IEC_Channel":
             old_leading = ".".join(map(str, self.GetCurrentLocation()))
             new_value = self.FindNewIEC_Channel(value)
-            new_leading = ".".join(map(str, self.CTNParent.GetCurrentLocation() + (new_value,)))
-            self.GetCTRoot().UpdateProjectVariableLocation(old_leading, new_leading)
+            if new_value != value:
+                new_leading = ".".join(map(str, self.CTNParent.GetCurrentLocation() + (new_value,)))
+                self.GetCTRoot().UpdateProjectVariableLocation(old_leading, new_leading)
             return new_value, True
         elif path == "BaseParams.Name":
             res = self.FindNewName(value)
--- a/ProjectController.py	Sun Sep 23 23:34:04 2012 +0200
+++ b/ProjectController.py	Sun Sep 23 23:56:53 2012 +0200
@@ -408,7 +408,7 @@
             self.AppFrame.RefreshPouInstanceVariablesPanel()
             self.AppFrame.RefreshFileMenu()
             self.AppFrame.RefreshEditMenu()
-            self.AppFrame.RefreshEditor()
+            wx.CallAfter(self.AppFrame.RefreshEditor)
     
     def GetVariableLocationTree(self):
         '''