Changeset 3b9e023 in sasview for sansview/perspectives/fitting
- Timestamp:
- Jun 22, 2009 2:52:42 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:
- 8a48713
- Parents:
- 75925e0
- Location:
- sansview/perspectives/fitting
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r3595309d r3b9e023 302 302 # Go through the list of dispersion check boxes to identify which one has changed 303 303 for p in self.disp_cb_dict: 304 self.state.disp_cb_dict[p]= self.disp_cb_dict[p].GetValue() 304 305 # Catch which one of the box was just checked or unchecked. 305 306 if event.GetEventObject() == self.disp_cb_dict[p]: … … 349 350 self.state.values=[] 350 351 self.state.weights=[] 351 self.state.values = self.values352 self.state.weights = self.weights352 self.state.values = copy.deepcopy(self.values) 353 self.state.weights = copy.deepcopy(self.weights) 353 354 # Set the new model as the dispersion object for the selected parameter 354 355 self.model.set_dispersion(p, disp_model) … … 366 367 367 368 ## Redraw the model 368 369 369 self._draw_model() 370 ## post state to fit panel 371 372 self.state.disp_cb_dict[p]= self.disp_cb_dict[p].GetValue() 373 #event = PageInfoEvent(page = self) 374 #wx.PostEvent(self.parent, event) 375 return 376 370 371 ## post state to fit panel 372 event = PageInfoEvent(page = self) 373 wx.PostEvent(self.parent, event) 374 377 375 378 376 def onResetModel(self, event): … … 621 619 622 620 if hasattr(self, "disp_box"): 623 self.disp_box.SetSelection(state.disp_box) 624 625 self.disp_cb_dict = {} 626 for k,v in self.state.disp_cb_dict.iteritems(): 627 self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 628 self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 621 self.disp_box.SetSelection(state.disp_box) 622 n= self.disp_box.GetCurrentSelection() 623 dispersity= self.disp_box.GetClientData(n) 624 name= dispersity.__name__ 625 self._set_dipers_Param(event=None) 626 627 #self.disp_cb_dict = {} 628 #for k,v in self.state.disp_cb_dict.iteritems(): 629 #self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 630 #self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 629 631 630 self._disp_obj_dict={} 631 for k , v in self.state._disp_obj_dict.iteritems(): 632 self._disp_obj_dict[k]=v 633 634 self._set_dipers_Param(event=None) 632 if name=="ArrayDispersion": 633 for item in self.disp_cb_dict.keys(): 634 print "array dispersion",state.values, state.weights 635 self.disp_cb_dict[item].SetValue(state.disp_cb_dict[item]) 636 # Create the dispersion objects 637 from sans.models.dispersion_models import ArrayDispersion 638 disp_model = ArrayDispersion() 639 disp_model.set_weights(state.values, state.weights) 640 641 self._disp_obj_dict[item] = disp_model 642 # Set the new model as the dispersion object for the selected parameter 643 self.model.set_dispersion(item, disp_model) 644 645 #self.model._persistency_dict = {} 646 #self.model._persistency_dict[item] = [state.values, state.weights] 647 648 else: 649 self._disp_obj_dict={} 650 for k , v in self.state._disp_obj_dict.iteritems(): 651 self._disp_obj_dict[k]=v 652 635 653 ##plotting range restore 636 654 self._reset_plotting_range(state) … … 649 667 self._reset_parameters_state(self.fittable_param,state.fittable_param) 650 668 self._reset_parameters_state(self.fixed_param,state.fixed_param) 651 652 669 653 670 ## draw the model with previous parameters value 654 671 self._onparamEnter_helper() … … 1187 1204 self.state.model =self.model 1188 1205 self.disp_list =self.model.getDispParamList() 1189 self.state.disp_list = self.disp_list 1190 self.state.structurecombobox =self.structurebox.GetCurrentSelection() 1191 self.state.formfactorcombobox = self.formfactorbox.GetCurrentSelection() 1206 self.state.disp_list = self.disp_list, 1192 1207 self.sizer4_4.Layout() 1193 1208 self.sizer4.Layout() … … 1409 1424 self._set_sizer_arraydispersion() 1410 1425 1426 1411 1427 self.state.disp_box= n 1428 1429 self._undo.Enable(True) 1430 event = PageInfoEvent(page = self) 1431 wx.PostEvent(self.parent, event) 1412 1432 1413 1433 self.sizer4_4.Layout() … … 1447 1467 ix+=1 1448 1468 self.disp_cb_dict[p] = wx.CheckBox(self, -1, p, (10, 10)) 1449 1469 self.state.disp_cb_dict[p]= self.disp_cb_dict[p].GetValue() 1470 print "went here======>",self.disp_cb_dict 1450 1471 wx.EVT_CHECKBOX(self, self.disp_cb_dict[p].GetId(), self.select_disp_angle) 1451 1472 self.sizer4_4.Add(self.disp_cb_dict[p], (iy, ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 1462 1483 self._copy_parameters_state(self.fittable_param, self.state.fittable_param) 1463 1484 self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 1464 1485 1486 ## post state to fit panel 1487 event = PageInfoEvent(page = self) 1488 wx.PostEvent(self.parent, event) 1489 1465 1490 1466 1491 def _set_range_sizer(self, title, object1=None,object=None): -
sansview/perspectives/fitting/fitpage.py
r3595309d r3b9e023 549 549 self.state.enable_disp = self.enable_disp.GetValue() 550 550 self.state.disable_disp = self.disable_disp.GetValue() 551 552 self.state.structurecombobox = self.structurebox.GetCurrentSelection() 553 self.state.formfactorcombobox = self.formfactorbox.GetCurrentSelection() 554 #print "_on_select_model",self.state.structurecombobox,self.state.formfactorcombobox 555 551 556 if event !=None: 552 557 self._undo.Enable(True) -
sansview/perspectives/fitting/fitpanel.py
r3595309d r3b9e023 424 424 state = None 425 425 page._redo.Enable(False) 426 page._redo.Enable(True) 426 427 else: 427 428 state = self.fit_page_name[page.window_name].getNextItem() -
sansview/perspectives/fitting/modelpage.py
r3595309d r3b9e023 348 348 if self.model !=None: 349 349 self._draw_model() 350 self.state.structurecombobox = self.structurebox.GetCurrentSelection() 351 self.state.formfactorcombobox = self.formfactorbox.GetCurrentSelection() 352 #print "_on_select_model",self.state.structurecombobox,self.state.formfactorcombobox 353 350 354 ## post state to fit panel 351 355 self._undo.Enable(True) -
sansview/perspectives/fitting/models.py
r376916c r3b9e023 126 126 self.shape_list.append(CylinderModel) 127 127 self.multiplication_factor.append(CylinderModel) 128 129 #from sans.models.ParallelepipedModel import ParallelepipedModel 130 #self.shape_list.append(ParallelepipedModel) 131 #self.multiplication_factor.append(ParallelepipedModel) 128 132 129 133 from sans.models.CoreShellModel import CoreShellModel -
sansview/perspectives/fitting/pagestate.py
r240b9966 r3b9e023 65 65 self.saved_states={} 66 66 ## save selection of combobox 67 self.formfactorcombobox = ""68 self.structurecombobox = ""67 self.formfactorcombobox = None 68 self.structurecombobox = None 69 69 ## radio box to select type of model 70 70 self.shape_rbutton = False
Note: See TracChangeset
for help on using the changeset viewer.