Changeset 33477fd in sasview for fittingview/src/sans
- Timestamp:
- Jan 19, 2012 8:08:03 AM (13 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:
- 2b4c8ca
- Parents:
- 3c07598
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r6f140f2 r33477fd 202 202 else: 203 203 self._create_default_1d_data() 204 if self.model != None: 205 if not self.data.is_data: 206 self._manager.page_finder[self.uid].set_fit_data(data=[self.data]) 207 self.on_smear_helper(update=True) 208 self.state.enable_smearer= self.enable_smearer.GetValue() 209 self.state.disable_smearer=self.disable_smearer.GetValue() 210 self.state.pinhole_smearer = self.pinhole_smearer.GetValue() 211 self.state.slit_smearer = self.slit_smearer.GetValue() 204 212 205 213 def _create_default_1d_data(self): … … 1456 1464 else: 1457 1465 #self.btFit.Enable(True) 1458 if is_2Ddata and not self.batch_on:1466 if is_2Ddata and self.data.is_data and not self.batch_on: 1459 1467 self.btEditMask.Enable(True) 1460 1468 if is_modified and self.fitrange: … … 1482 1490 ##So make sure that update param values on_Fit. 1483 1491 #self._undo.Enable(True) 1484 if self.model !=None: 1492 if self.model !=None: 1493 if self.Npts_total.GetValue() != self.Npts_fit.GetValue(): 1494 if not self.data.is_data: 1495 self._manager.page_finder[self.uid].set_fit_data(data=\ 1496 [self.data]) 1485 1497 ##Check the values 1486 1498 self._check_value_enter( self.fittable_param ,is_modified) … … 1554 1566 else: 1555 1567 #self.btFit.Enable(True) 1556 if self._is_2D() and self.data != Noneand not self.batch_on:1568 if self._is_2D() and self.data.is_data and not self.batch_on: 1557 1569 self.btEditMask.Enable(True) 1558 1570 … … 1562 1574 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 1563 1575 1564 self.save_current_state() 1576 try: 1577 self.save_current_state() 1578 except: 1579 pass 1565 1580 1566 1581 return flag -
fittingview/src/sans/perspectives/fitting/fitpage.py
r7fd4afd r33477fd 1443 1443 msg= "" 1444 1444 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 1445 # For theory mode 1446 if not self.data.is_data: 1447 self.create_default_data() 1445 1448 # Flag to register when a parameter has changed. 1446 1449 is_modified = False … … 2580 2583 "Smear: %s"%msg)) 2581 2584 return 2582 2583 2585 # Need update param values 2584 2586 self._update_paramv_on_fit() 2585 2587 temp_smearer = self.on_smear_helper() 2588 2589 self.sizer_set_smearer.Layout() 2590 self.Layout() 2591 self._set_weight() 2592 2593 ## set smearing value whether or not the data contain the smearing info 2594 wx.CallAfter(self._manager.set_smearer, uid=self.uid, smearer=temp_smearer, 2595 fid=self.data.id, 2596 qmin=float(self.qmin_x), 2597 qmax=float(self.qmax_x), 2598 enable_smearer=not self.disable_smearer.GetValue(), 2599 draw=True) 2600 2601 self.state.enable_smearer= self.enable_smearer.GetValue() 2602 self.state.disable_smearer=self.disable_smearer.GetValue() 2603 self.state.pinhole_smearer = self.pinhole_smearer.GetValue() 2604 self.state.slit_smearer = self.slit_smearer.GetValue() 2605 2606 def on_smear_helper(self, update=False): 2607 """ 2608 Help for onSmear 2609 2610 :param update: force or not to update 2611 """ 2612 self._get_smear_info() 2586 2613 temp_smearer = None 2587 self._get_smear_info()2588 2589 2614 #renew smear sizer 2590 2615 if self.smear_type != None: … … 2594 2619 2595 2620 self._hide_all_smear_info() 2596 2597 2621 data = copy.deepcopy(self.data) 2622 2598 2623 # make sure once more if it is smearer 2599 2624 temp_smearer = smear_selection(data, self.model) 2600 if self.current_smearer != temp_smearer :2625 if self.current_smearer != temp_smearer or update: 2601 2626 self.current_smearer = temp_smearer 2602 2627 if self.enable_smearer.GetValue(): 2603 2628 if hasattr(self.data,"dxl"): 2604 2605 2629 msg= ": Resolution smearing parameters" 2606 2630 if hasattr(self.data,"dxw"): … … 2623 2647 elif self.slit_smearer.GetValue(): 2624 2648 self.onSlitSmear(None) 2625 2626 2649 self._show_smear_sizer() 2627 2650 2628 self.sizer_set_smearer.Layout() 2629 self.Layout() 2630 self._set_weight() 2631 2632 ## set smearing value whether or not the data contain the smearing info 2633 wx.CallAfter(self._manager.set_smearer, uid=self.uid, smearer=temp_smearer, 2634 fid=self.data.id, 2635 qmin=float(self.qmin_x), 2636 qmax=float(self.qmax_x), 2637 enable_smearer=not self.disable_smearer.GetValue(), 2638 draw=True) 2639 2640 self.state.enable_smearer= self.enable_smearer.GetValue() 2641 self.state.disable_smearer=self.disable_smearer.GetValue() 2642 self.state.pinhole_smearer = self.pinhole_smearer.GetValue() 2643 self.state.slit_smearer = self.slit_smearer.GetValue() 2644 2651 return temp_smearer 2652 2645 2653 def on_complete_chisqr(self, event): 2646 2654 """
Note: See TracChangeset
for help on using the changeset viewer.