def RefreshNameList(self):
"""
Called to refresh names in name list box
"""
# Get variable class to select POU variable applicable
var_class = VARIABLE_CLASSES_DICT_REVERSE[
self.Class.GetStringSelection()]
# Refresh names in name list box by selecting variables in POU variables
# list that can be applied to variable class
self.VariableName.Clear()
for name, (var_type, value_type) in self.VariableList.iteritems():
if var_type != "Input" or var_class == INPUT:
self.VariableName.Append(name)
# Get variable expression and select corresponding value in name list
# box if it exists
selected = self.Expression.GetValue()
if selected != "" and self.VariableName.FindString(selected) != wx.NOT_FOUND:
self.VariableName.SetStringSelection(selected)
else:
self.VariableName.SetSelection(wx.NOT_FOUND)
# Disable name list box if no name present inside
self.VariableName.Enable(self.VariableName.GetCount() > 0)
评论列表
文章目录