Changeset bdb27e6 in sasview
- Timestamp:
- Mar 7, 2009 6:56:50 AM (16 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:
- aae8d23
- Parents:
- fbc3e04
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/modelpage.py
rfbc3e04 rbdb27e6 231 231 self.Layout() 232 232 self.parent.GetSizer().Layout() 233 234 def _set_dispersion(self, par, disp_model): 235 """ 236 Utility method to set a dispersion model while making 237 sure that the dispersion model object doesn't go out 238 of scope. The models should be cleaned up so we don't 239 have to do this. 240 """ 241 # Store the object to make it persist outside the scope of this method 242 #TODO: refactor model to clean this up? 243 self._disp_obj_dict[par] = disp_model 244 245 # Set the new model as the dispersion object for the selected parameter 246 self.model.set_dispersion(par, disp_model) 247 233 248 def set_model_description(self, model): 234 249 … … 314 329 for p in self.model.dispersion.keys(): 315 330 disp_model = GaussianDispersion() 316 317 # Store the object to make it persist outside the scope of this method 318 #TODO: refactor model to clean this up? 319 self._disp_obj_dict[p] = disp_model 320 321 # Set the new model as the dispersion object for the selected parameter 322 self.model.set_dispersion(p, disp_model) 331 self._set_dispersion(p, disp_model) 323 332 324 333 # Redraw the model … … 693 702 disp_model = ArrayDispersion() 694 703 disp_model.set_weights(values, weights) 695 # Store the object to make it persist outside the scope of this method 696 #TODO: refactor model to clean this up? 697 self._disp_obj_dict[p] = disp_model 698 699 # Set the new model as the dispersion object for the selected parameter 700 self.model.set_dispersion(p, disp_model) 701 704 self._set_dispersion(p, disp_model) 702 705 703 706 # Redraw the model … … 707 710 # The parameter was un-selected. Go back to Gaussian model (with 0 pts) 708 711 disp_model = GaussianDispersion() 709 # Store the object to make it persist outside the scope of this method 710 #TODO: refactor model to clean this up? 711 self._disp_obj_dict[p] = disp_model 712 713 # Set the new model as the dispersion object for the selected parameter 714 self.model.set_dispersion(p, disp_model) 712 self._set_dispersion(p, disp_model) 715 713 716 714 # Redraw the model … … 731 729 iy=1 732 730 ### this will become a separate method 731 #TODO: don't hard code text values to be shown on the interface 733 732 if type== "Select customized Model": 734 733 ix=0 … … 784 783 name3=item+".nsigmas" 785 784 iy += 1 785 786 # Make sure the dispersion model is Gaussian 787 if not self.model.dispersion[item]['type'] == 'gaussian': 788 disp_model = GaussianDispersion() 789 self._set_dispersion(item, disp_model) 790 791 # Create the interface 786 792 for p in self.model.dispersion[item].keys(): 787 793 #print "name 1 2 3", name1, name2, name3
Note: See TracChangeset
for help on using the changeset viewer.