Changeset b2d9826 in sasview for sansview/perspectives/fitting
- Timestamp:
- Mar 11, 2011 12:14:57 PM (14 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- a3149c5
- Parents:
- aae7a8d
- Location:
- sansview/perspectives/fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
ra5701e6 rb2d9826 1712 1712 Fill panel's combo box according to the type of model selected 1713 1713 """ 1714 self.model_list_box = self.parent.update_model_list() 1714 1715 if self.shape_rbutton.GetValue(): 1715 1716 ##fill the combobox with form factor list … … 1762 1763 item must model class 1763 1764 """ 1764 st = time.time()1765 1765 for models in list: 1766 1766 model= models() -
sansview/perspectives/fitting/fitpage.py
ra5701e6 rb2d9826 1053 1053 event = PageInfoEvent(page = self) 1054 1054 wx.PostEvent(self.parent, event) 1055 # 1055 1056 1056 1057 -
sansview/perspectives/fitting/fitpanel.py
rae4ade7 rb2d9826 42 42 #dictionary of miodel {model class name, model class} 43 43 self.menu_mng = models.ModelManager() 44 self.model_list_box = self.menu_mng.get_model_list() .get_list()44 self.model_list_box = self.menu_mng.get_model_list() 45 45 #pageClosedEvent = fnb.EVT_FLATNOTEBOOK_PAGE_CLOSING 46 46 self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSING , self.on_close_page) … … 60 60 self.add_default_pages() 61 61 62 def update_model_list(self): 63 """ 64 """ 65 self.model_list_box = self.menu_mng.update() 66 return self.model_list_box 67 68 62 69 def get_page_by_id(self, id): 63 70 """ -
sansview/perspectives/fitting/fitting.py
rae4ade7 rb2d9826 256 256 return True 257 257 258 def set_data(self, data_list ):258 def set_data(self, data_list=None, theory_list=None): 259 259 """ 260 260 receive a list of data to fit 261 261 """ 262 if data_list is None: 263 data_list = [] 262 264 selected_data_list = [] 263 265 if len(data_list) > MAX_NBR_DATA : … … 1163 1165 if data is None: 1164 1166 theory_data = self.page_finder[id].get_theory_data() 1165 self.parent.add_data_helper( data_list=[theory_data])1167 self.parent.add_data_helper({theory_data.id:theory_data}) 1166 1168 data_id = theory_data.id 1167 1169 else: … … 1249 1251 if data is None: 1250 1252 theory_data = self.page_finder[id].get_theory_data() 1251 self.parent.add_data_helper( data_list=[theory_data])1253 self.parent.add_data_helper({theory_data.id:theory_data}) 1252 1254 data_id = theory_data.id 1253 1255 else: -
sansview/perspectives/fitting/models.py
r6bbeacd4 rb2d9826 78 78 """ 79 79 # List of plugin objects 80 plugins = []80 plugins = {} 81 81 # Go through files in plug-in directory 82 82 try: … … 95 95 try: 96 96 if _check_plugin(module.Model, name)!=None: 97 plugins .append(module.Model)97 plugins[name] = module.Model 98 98 except: 99 99 msg="Error accessing Model" … … 150 150 struct_factor_dict = {} 151 151 ##list of form factors 152 shape_list = []152 shape_list = [] 153 153 ## independent shape model list 154 154 shape_indep_list = [] 155 155 ##list of structure factors 156 struct_list = []156 struct_list = [] 157 157 ##list of model allowing multiplication 158 multiplication_factor =[]158 multiplication_factor = [] 159 159 ##list of multifunctional shapes 160 multi_func_list = []160 multi_func_list = [] 161 161 ## list of added models 162 plugins =[]162 plugins = [] 163 163 ## Event owner (guiframe) 164 164 event_owner = None … … 166 166 """ 167 167 """ 168 self.stored_plugins = {} 168 169 self._getModelList() 169 170 … … 388 389 389 390 #Looking for plugins 390 self. plugins = findModels()391 self. _get_multifunc_models()391 self.stored_plugins = findModels() 392 self.plugins = self.stored_plugins.values() 392 393 self.plugins.append(ReflectivityModel) 393 394 self.plugins.append(ReflectivityIIModel) 395 self._get_multifunc_models() 396 394 397 return 0 395 398 396 399 400 def update(self): 401 """ 402 """ 403 new_plugins = findModels() 404 for name, plug in new_plugins.iteritems(): 405 if name not in self.stored_plugins.keys(): 406 self.stored_plugins[name] = plug 407 self.plugins.append(plug) 408 self.model_combobox.set_list("Customized Models", self.plugins) 409 return self.model_combobox.get_list() 410 397 411 def populate_menu(self, modelmenu, event_owner): 398 412 """ … … 563 577 self.model_combobox.set_list("multiplication", self.multiplication_factor) 564 578 self.model_combobox.set_list("Multi-Functions", self.multi_func_list) 565 return self.model_combobox 579 return self.model_combobox.get_list() 566 580 567 581
Note: See TracChangeset
for help on using the changeset viewer.