Changeset 277257f in sasview for src/sas/sasgui/perspectives/fitting/basepage.py
- Timestamp:
- Jul 5, 2017 5:28:55 PM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 1386b2f
- Parents:
- 251ef684
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r65f3930 r277257f 504 504 self.state.manager = manager 505 505 506 def populate_box(self, model_ dict):506 def populate_box(self, model_list_box): 507 507 """ 508 508 Store list of model 509 509 510 :param model_dict: dictionary containing list of models 511 512 """ 513 self.model_list_box = model_dict 514 self.state.model_list_box = self.model_list_box 510 :param model_list_box: dictionary containing categorized models 511 """ 512 self.model_list_box = model_list_box 515 513 self.initialize_combox() 516 514 517 def set_model_dictionary(self, model_dict ):515 def set_model_dictionary(self, model_dictionary): 518 516 """ 519 517 Store a dictionary linking model name -> model object 520 518 521 :param model_dict : dictionary containing list ofmodels522 """ 523 self.model_dict = model_dict519 :param model_dictionary: dictionary containing all models 520 """ 521 self.model_dictionary = model_dictionary 524 522 525 523 def initialize_combox(self): … … 527 525 put default value in the combo box 528 526 """ 529 if self.model_list_box is not None and len(self.model_list_box) > 0:527 if self.model_list_box: 530 528 self._populate_box(self.structurebox, 531 529 self.model_list_box["Structure Factors"]) … … 1218 1216 self.categorybox.Select(category_pos) 1219 1217 self._show_combox(None) 1220 if self.categorybox.GetValue() == CUSTOM_MODEL \1221 and PLUGIN_NAME_BASE not in state.formfactorcombobox :1218 if (self.categorybox.GetValue() == CUSTOM_MODEL 1219 and PLUGIN_NAME_BASE not in state.formfactorcombobox): 1222 1220 state.formfactorcombobox = \ 1223 1221 PLUGIN_NAME_BASE + state.formfactorcombobox 1224 1222 formfactor_pos = 0 1225 1223 for ind_form in range(self.formfactorbox.GetCount()): 1226 if self.formfactorbox.GetString(ind_form) == \1227 (state.formfactorcombobox):1224 if (self.formfactorbox.GetString(ind_form) 1225 == state.formfactorcombobox): 1228 1226 formfactor_pos = int(ind_form) 1229 1227 break … … 1235 1233 state.structurecombobox = unicode(state.structurecombobox) 1236 1234 for ind_struct in range(self.structurebox.GetCount()): 1237 if self.structurebox.GetString(ind_struct) == \1238 (state.structurecombobox):1235 if (self.structurebox.GetString(ind_struct) 1236 == state.structurecombobox): 1239 1237 structfactor_pos = int(ind_struct) 1240 1238 break … … 1840 1838 if mod_cat == CUSTOM_MODEL: 1841 1839 for model in self.model_list_box[mod_cat]: 1842 m_list.append(self.model_dict [model.name])1840 m_list.append(self.model_dictionary[model.name]) 1843 1841 else: 1844 1842 cat_dic = self.master_category_dict[mod_cat] 1845 for (model, enabled)in cat_dic:1843 for model, enabled in cat_dic: 1846 1844 if enabled: 1847 m_list.append(self.model_dict [model])1845 m_list.append(self.model_dictionary[model]) 1848 1846 except Exception: 1849 1847 msg = traceback.format_exc() … … 3497 3495 self.model_box.Clear() 3498 3496 3499 if category == 'Plugin Models':3497 if category == CUSTOM_MODEL: 3500 3498 for model in self.model_list_box[category]: 3501 3499 str_m = str(model).split(".")[0]
Note: See TracChangeset
for help on using the changeset viewer.