controls/PouInstanceVariablesPanel.py
changeset 1238 24577755485d
parent 1233 5e6d0969bb5d
child 1277 358db9d64aa1
equal deleted inserted replaced
1237:0c8b8ef9559b 1238:24577755485d
   139         self.RefreshView()
   139         self.RefreshView()
   140     
   140     
   141     def RefreshView(self):
   141     def RefreshView(self):
   142         self.Freeze()
   142         self.Freeze()
   143         self.VariablesList.DeleteAllItems()
   143         self.VariablesList.DeleteAllItems()
   144         self.InstanceChoice.Clear()
       
   145         self.InstanceChoice.SetValue("")
       
   146         
   144         
   147         if self.Controller is not None and self.PouTagName is not None:
   145         if self.Controller is not None and self.PouTagName is not None:
   148             self.PouInfos = self.Controller.GetPouVariables(self.PouTagName, self.Debug)
   146             self.PouInfos = self.Controller.GetPouVariables(self.PouTagName, self.Debug)
   149         else:
   147         else:
   150             self.PouInfos = None
   148             self.PouInfos = None
   200                 
   198                 
   201                 item = self.VariablesList.AppendItem(root, text, wnd=panel)
   199                 item = self.VariablesList.AppendItem(root, text, wnd=panel)
   202                 self.VariablesList.SetItemImage(item, self.ParentWindow.GetTreeImage(var_infos["class"]))
   200                 self.VariablesList.SetItemImage(item, self.ParentWindow.GetTreeImage(var_infos["class"]))
   203                 self.VariablesList.SetPyData(item, var_infos)
   201                 self.VariablesList.SetPyData(item, var_infos)
   204             
   202             
   205             self.RefreshInstanceChoice()
   203         self.RefreshInstanceChoice()
   206         
       
   207         self.RefreshButtons()
   204         self.RefreshButtons()
   208         
   205         
   209         self.Thaw()
   206         self.Thaw()
   210     
   207     
   211     def RefreshInstanceChoice(self):
   208     def RefreshInstanceChoice(self):
       
   209         self.InstanceChoice.Clear()
       
   210         self.InstanceChoice.SetValue("")
   212         if self.Controller is not None and self.PouInfos is not None:
   211         if self.Controller is not None and self.PouInfos is not None:
   213             instances = self.Controller.SearchPouInstances(self.PouTagName, self.Debug)
   212             instances = self.Controller.SearchPouInstances(self.PouTagName, self.Debug)
   214             for instance in instances:
   213             for instance in instances:
   215                 self.InstanceChoice.Append(instance)
   214                 self.InstanceChoice.Append(instance)
   216             if len(instances) == 1:
   215             if len(instances) == 1: