Changeset cd57c7d4 in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Sep 11, 2017 10:12:16 AM (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:
- b1f20d1
- Parents:
- c9ecd1b (diff), e2b2473 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
red2276f r6a455cd3 1236 1236 wx.PostEvent(self.parent, new_event) 1237 1237 # update list of plugins if new plugin is available 1238 custom_model = CUSTOM_MODEL1239 1238 mod_cat = self.categorybox.GetStringSelection() 1240 if mod_cat == custom_model: 1239 if mod_cat == CUSTOM_MODEL: 1240 temp_id = self.model.id 1241 1241 temp = self.parent.update_model_list() 1242 for v in self.parent.model_dictionary.values(): 1243 if v.id == temp_id: 1244 self.model = v() 1245 break 1242 1246 if temp: 1243 1247 self.model_list_box = temp -
src/sas/sasgui/perspectives/fitting/fitpanel.py
r67b0a99 rc9ecd1b 92 92 # state must be cloned 93 93 state = page.get_state().clone() 94 if data is not None or page.model is not None: 94 # data_list only populated with real data 95 # Fake object in data from page.get_data() if model is selected 96 if len(page.data_list) is not 0 and page.model is not None: 95 97 new_doc = self._manager.state_reader.write_toXML(data, 96 98 state, 97 99 batch_state) 100 # Fit #2 through #n are append to first fit 98 101 if doc is not None and hasattr(doc, "firstChild"): 99 child = new_doc.firstChild.firstChild 100 doc.firstChild.appendChild(child) 102 # Only append if properly formed new_doc 103 if new_doc is not None and hasattr(new_doc, "firstChild"): 104 child = new_doc.firstChild.firstChild 105 doc.firstChild.appendChild(child) 106 # First fit defines the main document 101 107 else: 102 108 doc = new_doc … … 395 401 temp_data = page.get_data() 396 402 if temp_data is not None and temp_data.id in data: 397 self.SetSelection(pos) 398 self.on_close_page(event=None) 399 temp = self.GetSelection() 400 self.DeletePage(temp) 403 self.close_page_with_data(temp_data) 401 404 if self.sim_page is not None: 402 405 if len(self.sim_page.model_list) == 0: … … 404 407 self.SetSelection(pos) 405 408 self.on_close_page(event=None) 406 temp = self.GetSelection() 407 self.DeletePage(temp) 409 self.DeletePage(pos) 408 410 self.sim_page = None 409 411 self.batch_on = False -
src/sas/sasgui/perspectives/fitting/models.py
rb1c2011 rb682c6a 20 20 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 21 21 from sasmodels.sasview_model import load_custom_model, load_standard_models 22 from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 22 23 23 24 logger = logging.getLogger(__name__) … … 265 266 temp = {} 266 267 if self.is_changed(): 267 return _find_models() 268 temp = _find_models() 269 self.last_time_dir_modified = time.time() 270 return temp 268 271 logger.info("plugin model : %s" % str(temp)) 269 272 return temp … … 312 315 if os.path.isdir(plugin_dir): 313 316 temp = os.path.getmtime(plugin_dir) 314 if self.last_time_dir_modified !=temp:317 if self.last_time_dir_modified < temp: 315 318 is_modified = True 316 319 self.last_time_dir_modified = temp … … 323 326 new models were added else return empty dictionary 324 327 """ 328 self.plugins = [] 325 329 new_plugins = self.findModels() 326 if len(new_plugins) > 0: 327 for name, plug in new_plugins.iteritems(): 328 if name not in self.stored_plugins.keys(): 329 self.stored_plugins[name] = plug 330 self.plugins.append(plug) 331 self.model_dictionary[name] = plug 332 self.model_combobox.set_list("Plugin Models", self.plugins) 330 if new_plugins: 331 for name, plug in new_plugins.items(): 332 self.stored_plugins[name] = plug 333 self.plugins.append(plug) 334 self.model_dictionary[name] = plug 335 self.model_combobox.set_list(CUSTOM_MODEL, self.plugins) 333 336 return self.model_combobox.get_list() 334 337 else:
Note: See TracChangeset
for help on using the changeset viewer.