Changeset 3b9e023 in sasview for sansview/perspectives/fitting/basepage.py
- Timestamp:
- Jun 22, 2009 4:52:42 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:
- 8a48713
- Parents:
- 75925e0
- File:
-
- 1 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):
Note: See TracChangeset
for help on using the changeset viewer.