Changeset 07a93a1 in sasview for sansview/perspectives/fitting/modelpage.py
- Timestamp:
- Mar 5, 2009 10:10:36 PM (15 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:
- 1fbb343
- Parents:
- 12aa9b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/modelpage.py
r047ed70 r07a93a1 37 37 # Data member to store the dispersion object created 38 38 self._disp_obj_dict = {} 39 self.back_up_model= model.clone()40 39 #list of dispersion paramaters 41 40 self.disp_list=[] … … 279 278 280 279 def Set_DipersParam(self, event): 280 """ 281 This method is called when the user changes the state 282 of the "dispersity" radio buttons. 283 284 #TODO: correct the spelling mistake in the name of this method, start name with lowercase. 285 """ 281 286 if self.enable_disp.GetValue(): 287 # The user selected to use dispersion/averaging 282 288 if len(self.disp_list)==0: 289 # This model contains no parameter to which we can apply dispersion/averaging 283 290 ix=0 284 291 iy=1 … … 294 301 return 295 302 else: 296 if self.data !=None and self.model !=None: # allow to recognize data panel from model panel 297 298 299 self.cb1.SetValue(False) 300 self.select_all_param_helper() 301 303 # Show the default dispersion/averaging sub-panel 302 304 self.populate_disp_box() 303 305 self.set_panel_dispers(self.disp_list) 304 306 305 307 else: 306 if self.data !=None and self.model!=None: 307 if self.cb1.GetValue(): 308 self.select_all_param_helper() 309 310 if self.back_up_model!=None: 311 keys = self.back_up_model.getDispParamList() 312 keys.sort() 313 #disperse param into the initial state 314 for item in keys: 315 value= self.back_up_model.getParam(item) 316 self.model.setParam(item, value) 317 self._draw_model() 318 308 # The user selected not to use dispersion/averaging 309 # Make sure all parameters have the default Gaussian 310 # dispersion object with only a single point (no dispersion). 311 for p in self.model.dispersion.keys(): 312 disp_model = GaussianDispersion() 313 314 # Store the object to make it persist outside the scope of this method 315 #TODO: refactor model to clean this up? 316 self._disp_obj_dict[p] = disp_model 317 318 # Set the new model as the dispersion object for the selected parameter 319 self.model.set_dispersion(p, disp_model) 320 321 # Redraw the model 322 self._draw_model() 319 323 320 324 self.fittable_param=[]
Note: See TracChangeset
for help on using the changeset viewer.