Changeset 0cf97c5 in sasview for sansview/perspectives/fitting
- Timestamp:
- Apr 14, 2011 1:19:16 PM (14 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:
- 0f8f831
- Parents:
- f932c02
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
raad74b3 r0cf97c5 1242 1242 uid=self.uid, 1243 1243 qmax= float(self.qmax_x)) 1244 index_data = ((self.qmin_x <= self.data.x)&\ 1245 (self.data.x <= self.qmax_x)) 1246 val = str(len(self.data.x[index_data==True])) 1247 self.Npts_fit.SetValue(val) 1244 if self.data != None: 1245 index_data = ((self.qmin_x <= self.data.x)&\ 1246 (self.data.x <= self.qmax_x)) 1247 val = str(len(self.data.x[index_data==True])) 1248 self.Npts_fit.SetValue(val) 1249 else: 1250 # No data in the panel 1251 try: 1252 self.npts_x = float(self.Npts_total.GetValue()) 1253 except: 1254 flag = False 1255 return flag 1248 1256 flag = True 1249 1257 if self._is_2D(): … … 1746 1754 return 1747 1755 #Check if # of points for theory model are valid(>0). 1748 if self. theory_npts != None:1749 if check_float(self. theory_npts):1750 temp_npts = float(self. theory_npts.GetValue())1756 if self.Npts_total.IsEnabled() : 1757 if check_float(self.Npts_total): 1758 temp_npts = float(self.Npts_total.GetValue()) 1751 1759 if temp_npts != self.num_points: 1752 1760 self.num_points = temp_npts -
sansview/perspectives/fitting/fitpage.py
rf932c02 r0cf97c5 130 130 sizer_smearer_box = wx.StaticBoxSizer(smear_set_box, wx.HORIZONTAL) 131 131 sizer_smearer_box.SetMinSize((_DATA_BOX_WIDTH,85)) 132 sizer_fit = wx.GridSizer(2, 4, 2,6)132 sizer_fit = wx.GridSizer(2, 4, 2, 6) 133 133 134 134 # combobox for smear2d accuracy selection … … 197 197 self.tcChi.SetToolTipString("Chi2/Npts") 198 198 self.Npts_fit = BGTextCtrl(self, -1, "-", size=(75,20), style=0) 199 self.Npts_fit.SetToolTipString(" Npts : number of points selected for fitting") 200 self.Npts_total = BGTextCtrl(self, -1, "-", size=(75,20), style=0) 201 self.Npts_total.SetToolTipString(" Total Npts : total number of data points") 199 self.Npts_fit.SetToolTipString(\ 200 " Npts : number of points selected for fitting") 201 self.Npts_total = self.ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 202 style=wx.TE_PROCESS_ENTER, 203 text_enter_callback=self._onQrangeEnter) 204 self.Npts_total.SetValue(format_number(self.npts_x)) 205 self.Npts_total.SetToolTipString(\ 206 " Total Npts : total number of data points") 207 202 208 # Update and Draw button 203 209 self.draw_button = wx.Button(self,wx.NewId(),'Compute', size=(88,24)) 204 self.draw_button.Bind(wx.EVT_BUTTON, self._onDraw,id= self.draw_button.GetId()) 210 self.draw_button.Bind(wx.EVT_BUTTON, \ 211 self._onDraw,id= self.draw_button.GetId()) 205 212 self.draw_button.SetToolTipString("Compute and Draw.") 206 213 207 214 box_description_1= wx.StaticText(self, -1,' Chi2/Npts') 208 box_description_2= wx.StaticText(self, -1,'Fitted Npts') 209 box_description_3= wx.StaticText(self, -1,'Data Npts') 215 box_description_2= wx.StaticText(self, -1,'Npts(Fit)') 216 box_description_3= wx.StaticText(self, -1,'Total Npts') 217 box_description_3.SetToolTipString( \ 218 " Total Npts : total number of data points") 210 219 #box_description_4= wx.StaticText(self, -1,' ') 211 220 … … 318 327 self.qmax.SetValue(str(self.qmax_x)) 319 328 self.qmax.SetToolTipString("Maximum value of Q in linear scale.") 320 329 """ 321 330 self.theory_npts_tcrtl = self.ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 322 331 style=wx.TE_PROCESS_ENTER, … … 324 333 self.theory_npts_tcrtl.SetValue(format_number(self.npts_x)) 325 334 self.theory_npts_tcrtl.SetToolTipString("Number of point to plot.") 335 """ 326 336 id = wx.NewId() 327 337 self.reset_qrange =wx.Button(self,id,'Reset',size=(77,20)) … … 331 341 332 342 sizer_horizontal=wx.BoxSizer(wx.HORIZONTAL) 333 sizer= wx.GridSizer(2, 5,0, 0)343 sizer= wx.GridSizer(2, 4, 2, 6) 334 344 335 345 self.btEditMask = wx.Button(self,wx.NewId(),'Editor', size=(88,23)) … … 341 351 sizer.Add(wx.StaticText(self, -1, ' Min[1/A]')) 342 352 sizer.Add(wx.StaticText(self, -1, ' Max[1/A]')) 343 sizer.Add(wx.StaticText(self, -1, ' Theory Npts'))344 353 sizer.Add(self.EditMask_title) 354 #sizer.Add(wx.StaticText(self, -1, '')) 345 355 sizer.Add(self.reset_qrange) 346 356 sizer.Add(self.qmin) 347 357 sizer.Add(self.qmax) 348 sizer.Add(self.theory_npts_tcrtl)358 #sizer.Add(self.theory_npts_tcrtl) 349 359 sizer.Add(self.btEditMask) 350 360 boxsizer_range.Add(sizer_chi2) … … 1224 1234 (self.data.x <= self.qmax_x)) 1225 1235 self.Npts_fit.SetValue(str(len(self.data.x[index_data]))) 1226 1236 else: 1237 self.npts_x = self.Npts_total.GetValue() 1238 self._save_plotting_range() 1239 1227 1240 else: 1228 1241 tcrtl.SetBackgroundColour("pink") … … 1591 1604 self.btEditMask.Enable() 1592 1605 self.EditMask_title.Enable() 1606 self.Npts_total.Disable() 1593 1607 self.dataSource.SetValue(data_name) 1594 1608 self.qmin_x = data_min
Note: See TracChangeset
for help on using the changeset viewer.