controls/VariablePanel.py
changeset 1083 40af794ecd4b
parent 1016 3d79c31e4697
child 1122 84de51ab40d2
equal deleted inserted replaced
1082:5a08404d5dda 1083:40af794ecd4b
   301                     else:
   301                     else:
   302                         self.ParentWindow.Table.SetValue(row, col, values[0])
   302                         self.ParentWindow.Table.SetValue(row, col, values[0])
   303                         self.ParentWindow.Table.ResetView(self.ParentWindow.VariablesGrid)
   303                         self.ParentWindow.Table.ResetView(self.ParentWindow.VariablesGrid)
   304                         self.ParentWindow.SaveValues()
   304                         self.ParentWindow.SaveValues()
   305             elif (element_type not in ["config", "resource"] and values[1] == "Global" and self.ParentWindow.Filter in ["All", "Interface", "External"] or
   305             elif (element_type not in ["config", "resource"] and values[1] == "Global" and self.ParentWindow.Filter in ["All", "Interface", "External"] or
   306                   element_type in ["config", "resource"] and values[1] == "location"):
   306                   element_type in ["config", "resource", "program"] and values[1] == "location"):
   307                 if values[1] == "location":
   307                 if values[1] == "location":
   308                     var_name = values[3]
   308                     var_name = values[3]
   309                 else:
   309                 else:
   310                     var_name = values[0]
   310                     var_name = values[0]
   311                 tagname = self.ParentWindow.GetTagName()
   311                 tagname = self.ParentWindow.GetTagName()
   314                 elif not var_name.upper() in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(tagname, self.ParentWindow.Debug)]:
   314                 elif not var_name.upper() in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(tagname, self.ParentWindow.Debug)]:
   315                     var_infos = self.ParentWindow.DefaultValue.copy()
   315                     var_infos = self.ParentWindow.DefaultValue.copy()
   316                     var_infos["Name"] = var_name
   316                     var_infos["Name"] = var_name
   317                     var_infos["Type"] = values[2]
   317                     var_infos["Type"] = values[2]
   318                     if values[1] == "location":
   318                     if values[1] == "location":
   319                         var_infos["Class"] = "Global"
   319                         if element_type == "program":
       
   320                             var_infos["Class"] = "Local"
       
   321                         else:
       
   322                             var_infos["Class"] = "Global"
   320                         var_infos["Location"] = values[0]
   323                         var_infos["Location"] = values[0]
   321                     else:
   324                     else:
   322                         var_infos["Class"] = "External"
   325                         var_infos["Class"] = "External"
   323                     var_infos["Number"] = len(self.ParentWindow.Values)
   326                     var_infos["Number"] = len(self.ParentWindow.Values)
   324                     self.ParentWindow.Values.append(var_infos)
   327                     self.ParentWindow.Values.append(var_infos)