PLCOpenEditor.py
changeset 703 1a14560e10ed
parent 700 cf3db1775105
child 705 1a343b239e9c
equal deleted inserted replaced
702:ece862b07321 703:1a14560e10ed
  1519 
  1519 
  1520     def RefreshEditor(self):
  1520     def RefreshEditor(self):
  1521         selected = self.TabsOpened.GetSelection()
  1521         selected = self.TabsOpened.GetSelection()
  1522         if selected >= 0:
  1522         if selected >= 0:
  1523             window = self.TabsOpened.GetPage(selected)
  1523             window = self.TabsOpened.GetPage(selected)
       
  1524             tagname = window.GetTagName()
  1524             if not window.IsDebugging():
  1525             if not window.IsDebugging():
  1525                 self.SelectProjectTreeItem(window.GetTagName())
  1526                 self.SelectProjectTreeItem(tagname)
       
  1527                 self.PouInstanceVariablesPanel.SetPouType(tagname)
  1526             else:
  1528             else:
  1527                 self.PouInstanceVariablesPanel.SetPouType(window.GetTagName(), window.GetInstancePath())
  1529                 instance_path = window.GetInstancePath()
       
  1530                 if tagname == "":
       
  1531                     instance_path = instance_path.rsplit(".", 1)[0]
       
  1532                     tagname = self.Controler.GetPouInstanceTagName(instance_path, self.EnableDebug)
       
  1533                 self.PouInstanceVariablesPanel.SetPouType(tagname, instance_path)
  1528             for child in self.TabsOpened.GetChildren():
  1534             for child in self.TabsOpened.GetChildren():
  1529                 if isinstance(child, wx.aui.AuiTabCtrl):
  1535                 if isinstance(child, wx.aui.AuiTabCtrl):
  1530                     active_page = child.GetActivePage()
  1536                     active_page = child.GetActivePage()
  1531                     if active_page >= 0:
  1537                     if active_page >= 0:
  1532                         window = child.GetWindowFromIdx(active_page)
  1538                         window = child.GetWindowFromIdx(active_page)