Changeset 904168e1 in sasview
- Timestamp:
- Sep 17, 2009 12:51:37 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:
- 6ced1cc
- Parents:
- c202d03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r920a6e5 r904168e1 5 5 import time 6 6 import copy 7 import math 7 8 from sans.guiframe.utils import format_number,check_float 8 9 from sans.guicomm.events import StatusEvent … … 72 73 ## check that the fit range is correct to plot the model again 73 74 self.fitrange= True 75 ## Q range defaults 76 self.qmin_def = 0.001 77 self.qmax_def = 0.13 78 self.num_points_def = 50 74 79 ## Q range 75 self.qmin_x= 0.00176 self.qmax_x= 0.1377 self.num_points= 5080 self.qmin_x= self.qmin_def 81 self.qmax_x= self.qmax_def 82 self.num_points= self.num_points_def 78 83 79 84 ## Create memento to save the current state … … 1665 1670 #self.qmax.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 1666 1671 #self.qmax.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter) 1672 1673 id = wx.NewId() 1674 self.reset_qrange =wx.Button(self,id,'Reset') 1675 self.reset_qrange.Bind(wx.EVT_BUTTON, self.on_reset_clicked,id=id) 1676 self.reset_qrange.SetToolTipString("Reset Q range to the default values") 1667 1677 1668 1678 sizer_horizontal=wx.BoxSizer(wx.HORIZONTAL) 1669 sizer= wx.GridSizer(3, 3,5, 5) 1670 1671 sizer.Add((5,5)) 1672 sizer.Add(wx.StaticText(self, -1, 'Min')) 1673 sizer.Add(wx.StaticText(self, -1, 'Max')) 1674 sizer.Add(wx.StaticText(self, -1, 'Q range')) 1679 sizer= wx.GridSizer(3, 3,2, 5) 1680 1681 sizer.Add(wx.StaticText(self, -1, ' Q range')) 1682 sizer.Add(wx.StaticText(self, -1, ' Min')) 1683 sizer.Add(wx.StaticText(self, -1, ' Max')) 1684 sizer.Add(self.reset_qrange) 1685 1686 1675 1687 1676 1688 sizer.Add(self.qmin) … … 1719 1731 self.sizer6.Layout() 1720 1732 self.SetScrollbars(20,20,25,65) 1721 1733 1734 def on_reset_clicked(self,event): 1735 """ 1736 #On 'Reset' button for Q range clicked 1737 """ 1738 ##For 3 different cases: Data2D, Data1D, and theory 1739 if self.data.__class__.__name__ == "Data2D": 1740 data_min= 0 1741 x= max(math.fabs(self.data.xmin), math.fabs(self.data.xmax)) 1742 y= max(math.fabs(self.data.ymin), math.fabs(self.data.ymax)) 1743 self.qmin_x = data_min 1744 self.qmax_x = math.sqrt(x*x + y*y) 1745 elif self.data.__class__.__name__ == "Data1D": 1746 self.qmin_x = min(self.data.x) 1747 self.qmax_x = max(self.data.x) 1748 else: 1749 self.qmin_x = self.qmin_def 1750 self.qmax_x = self.qmax_def 1751 self.num_points = self.num_points_def 1752 self.state.npts = self.num_points 1753 1754 self.state.qmin = self.qmin_x 1755 self.state.qmax = self.qmax_x 1756 1757 #reset the q range values 1758 self._reset_plotting_range(self.state) 1759 #Re draw plot 1760 self._draw_model() 1761 1722 1762 def on_model_help_clicked(self,event): 1723 1763 """
Note: See TracChangeset
for help on using the changeset viewer.