PLCOpenEditor.py
changeset 703 1a14560e10ed
parent 700 cf3db1775105
child 705 1a343b239e9c
--- 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()