Fix bug when reloading project layout, PouIntanceVariablesPanel not updated
authorLaurent Bessard
Mon, 04 Jun 2012 02:04:29 +0200
changeset 703 1a14560e10ed
parent 702 ece862b07321
child 704 aca0c83ed82e
Fix bug when reloading project layout, PouIntanceVariablesPanel not updated
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Mon Jun 04 01:27:17 2012 +0200
+++ b/PLCOpenEditor.py	Mon Jun 04 02:04:29 2012 +0200
@@ -1521,10 +1521,16 @@
         selected = self.TabsOpened.GetSelection()
         if selected >= 0:
             window = self.TabsOpened.GetPage(selected)
+            tagname = window.GetTagName()
             if not window.IsDebugging():
-                self.SelectProjectTreeItem(window.GetTagName())
+                self.SelectProjectTreeItem(tagname)
+                self.PouInstanceVariablesPanel.SetPouType(tagname)
             else:
-                self.PouInstanceVariablesPanel.SetPouType(window.GetTagName(), window.GetInstancePath())
+                instance_path = window.GetInstancePath()
+                if tagname == "":
+                    instance_path = instance_path.rsplit(".", 1)[0]
+                    tagname = self.Controler.GetPouInstanceTagName(instance_path, self.EnableDebug)
+                self.PouInstanceVariablesPanel.SetPouType(tagname, instance_path)
             for child in self.TabsOpened.GetChildren():
                 if isinstance(child, wx.aui.AuiTabCtrl):
                     active_page = child.GetActivePage()