Changeset ce0a245 in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Sep 20, 2017 12:13:53 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:
- d76c43a, fca1f50
- Parents:
- 2a399ca (diff), 13374be (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. - git-author:
- Paul Kienzle <pkienzle@…> (09/20/17 12:13:53)
- git-committer:
- GitHub <noreply@…> (09/20/17 12:13:53)
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
r66acafe r13374be 1243 1243 wx.PostEvent(self.parent, new_event) 1244 1244 # update list of plugins if new plugin is available 1245 custom_model = CUSTOM_MODEL1246 1245 mod_cat = self.categorybox.GetStringSelection() 1247 if mod_cat == custom_model: 1246 if mod_cat == CUSTOM_MODEL: 1247 temp_id = self.model.id 1248 1248 temp = self.parent.update_model_list() 1249 for v in self.parent.model_dictionary.values(): 1250 if v.id == temp_id: 1251 self.model = v() 1252 break 1249 1253 if temp: 1250 1254 self.model_list_box = temp -
src/sas/sasgui/perspectives/fitting/fitpanel.py
r6f9abd3 r13374be 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
r632fda9 r13374be 21 21 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 22 22 from sasmodels.sasview_model import load_custom_model, load_standard_models 23 from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 23 24 24 25 logger = logging.getLogger(__name__) … … 266 267 temp = {} 267 268 if self.is_changed(): 268 return _find_models() 269 temp = _find_models() 270 self.last_time_dir_modified = time.time() 271 return temp 269 272 logger.info("plugin model : %s" % str(temp)) 270 273 return temp … … 323 326 if os.path.isdir(plugin_dir): 324 327 temp = os.path.getmtime(plugin_dir) 325 if self.last_time_dir_modified !=temp:328 if self.last_time_dir_modified < temp: 326 329 is_modified = True 327 330 self.last_time_dir_modified = temp … … 334 337 new models were added else return empty dictionary 335 338 """ 339 self.plugins = [] 336 340 new_plugins = self.findModels() 337 if len(new_plugins) > 0: 338 for name, plug in new_plugins.iteritems(): 339 if name not in self.stored_plugins.keys(): 340 self.stored_plugins[name] = plug 341 self.plugins.append(plug) 342 self.model_dictionary[name] = plug 343 self.model_combobox.set_list("Plugin Models", self.plugins) 341 if new_plugins: 342 for name, plug in new_plugins.items(): 343 self.stored_plugins[name] = plug 344 self.plugins.append(plug) 345 self.model_dictionary[name] = plug 346 self.model_combobox.set_list(CUSTOM_MODEL, self.plugins) 344 347 return self.model_combobox.get_list() 345 348 else: -
src/sas/sasgui/perspectives/fitting/pagestate.py
r959eb01 rda9b239 617 617 value = "" 618 618 content = line.split(":") 619 if line == '' or len(content) == 1: 620 continue 619 621 name = content[0] 620 622 try:
Note: See TracChangeset
for help on using the changeset viewer.