Changeset 07a93a1 in sasview
- Timestamp:
- Mar 5, 2009 8:10:36 PM (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:
- 1fbb343
- Parents:
- 12aa9b5
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage1D.py
rc77f72c r07a93a1 13 13 14 14 15 15 #TODO: FitPage1D inherits from ModelPage but doesn't call its __init__ method! 16 #TODO: refactor this class to have an __init__ that deals with data only, then calls a UI builder method. 16 17 class FitPage1D(ModelPage): 17 18 """ … … 40 41 #fit page manager 41 42 self.manager = None 43 44 45 # Should not have to write the following line if the inheritance 46 # was coded properly... 47 #TODO: get rid of this line once the class is refactored 48 self._disp_obj_dict = {} 49 50 42 51 #Store the parent of this panel parent 43 52 # For this application fitpanel is the parent -
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.