Changeset 14cd6b92 in sasview
- Timestamp:
- Apr 13, 2012 9:13:39 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:
- 61184df
- Parents:
- 4b73c3e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fitpage.py
r7415cbe r14cd6b92 1 2 1 """ 2 FitPanel class contains fields allowing to display results when 3 fitting a model and one data 4 """ 3 5 import sys 4 6 import wx … … 8 10 import math 9 11 import time 10 from sans.models.dispersion_models import ArrayDispersion, GaussianDispersion11 #from sans.dataloader.data_info import Data1D12 12 from sans.guiframe.events import StatusEvent 13 13 from sans.guiframe.events import NewPlotEvent … … 22 22 SMEAR_SIZE_H = 0.00 23 23 24 import basepage25 24 from basepage import BasicPage 26 25 from basepage import PageInfoEvent … … 36 35 """ 37 36 38 def __init__(self, parent, color='rand'):37 def __init__(self, parent, color='rand'): 39 38 """ 40 39 Initialization of the Panel … … 93 92 sizer_data.Add(wx.StaticText(self, -1, 'Name : ')) 94 93 sizer_data.Add(self.dataSource) 95 sizer_data.Add( (0, 5) )96 boxsizer1.Add(sizer_data, 0, wx.ALL, 10)97 self.sizer0.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10)94 sizer_data.Add( (0, 5) ) 95 boxsizer1.Add(sizer_data, 0, wx.ALL, 10) 96 self.sizer0.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10) 98 97 self.sizer0.Layout() 99 98 … … 218 217 219 218 #Sizers 220 box_description_range = wx.StaticBox(self, -1, str(title))219 box_description_range = wx.StaticBox(self, -1, str(title)) 221 220 box_description_range.SetForegroundColour(wx.BLUE) 222 221 boxsizer_range = wx.StaticBoxSizer(box_description_range, wx.VERTICAL) … … 251 250 self.dI_didata.SetValue(True) 252 251 # add 4 types of weighting to the sizer 253 sizer_weighting.Add( self.dI_noweight, 0, wx.LEFT, 10)254 sizer_weighting.Add((14, 10))252 sizer_weighting.Add( self.dI_noweight, 0, wx.LEFT, 10) 253 sizer_weighting.Add((14, 10)) 255 254 sizer_weighting.Add( self.dI_didata) 256 sizer_weighting.Add((14, 10))255 sizer_weighting.Add((14, 10)) 257 256 sizer_weighting.Add( self.dI_sqrdata) 258 sizer_weighting.Add((14, 10))257 sizer_weighting.Add((14, 10)) 259 258 sizer_weighting.Add( self.dI_idata) 260 sizer_weighting.Add((10, 10))259 sizer_weighting.Add((10, 10)) 261 260 self.dI_noweight.Enable(False) 262 261 self.dI_didata.Enable(False) … … 268 267 269 268 # combobox for smear2d accuracy selection 270 self.smear_accuracy = wx.ComboBox(self, -1, size=(50,-1),269 self.smear_accuracy = wx.ComboBox(self, -1, size=(50, -1), 271 270 style=wx.CB_READONLY) 272 271 self._set_accuracy_list() … … 279 278 280 279 #Fit button 281 self.btFit = wx.Button(self, wx.NewId(),'Fit', size=(88,25))280 self.btFit = wx.Button(self, wx.NewId(),'Fit', size=(88, 25)) 282 281 self.default_bt_colour = self.btFit.GetDefaultAttributes() 283 self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id= self.btFit.GetId())282 self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id= self.btFit.GetId()) 284 283 self.btFit.SetToolTipString("Start fitting.") 285 284 … … 300 299 ## smear 301 300 self.smear_data_left= BGTextCtrl(self, -1, 302 size=(_BOX_WIDTH-25, 20), style=0)301 size=(_BOX_WIDTH-25, 20), style=0) 303 302 self.smear_data_left.SetValue(str(self.dq_l)) 304 303 self.smear_data_right = BGTextCtrl(self, -1, 305 size=(_BOX_WIDTH-25, 20), style=0)304 size=(_BOX_WIDTH-25, 20), style=0) 306 305 self.smear_data_right.SetValue(str(self.dq_r)) 307 306 … … 337 336 338 337 # add 4 types of smearing to the sizer 339 sizer_smearer.Add( self.disable_smearer, 0, wx.LEFT, 10)340 sizer_smearer.Add((10, 10))338 sizer_smearer.Add( self.disable_smearer, 0, wx.LEFT, 10) 339 sizer_smearer.Add((10, 10)) 341 340 sizer_smearer.Add( self.enable_smearer) 342 sizer_smearer.Add((10, 10))341 sizer_smearer.Add((10, 10)) 343 342 sizer_smearer.Add( self.pinhole_smearer ) 344 sizer_smearer.Add((10, 10))343 sizer_smearer.Add((10, 10)) 345 344 sizer_smearer.Add( self.slit_smearer ) 346 sizer_smearer.Add((10, 10))345 sizer_smearer.Add((10, 10)) 347 346 348 347 # StaticText for chi2, N(for fitting), Npts 349 self.tcChi = BGTextCtrl(self, -1, "-", size=(75, 20), style=0)348 self.tcChi = BGTextCtrl(self, -1, "-", size=(75, 20), style=0) 350 349 self.tcChi.SetToolTipString("Chi2/Npts(Fit)") 351 self.Npts_fit = BGTextCtrl(self, -1, "-", size=(75, 20), style=0)350 self.Npts_fit = BGTextCtrl(self, -1, "-", size=(75, 20), style=0) 352 351 self.Npts_fit.SetToolTipString(\ 353 352 " Npts : number of points selected for fitting") … … 361 360 362 361 # Update and Draw button 363 self.draw_button = wx.Button(self,wx.NewId(), 'Compute', size=(88,24))362 self.draw_button = wx.Button(self,wx.NewId(), 'Compute', size=(88,24)) 364 363 self.draw_button.Bind(wx.EVT_BUTTON, \ 365 self._onDraw,id = self.draw_button.GetId())364 self._onDraw,id = self.draw_button.GetId()) 366 365 self.draw_button.SetToolTipString("Compute and Draw.") 367 366 368 box_description_1= wx.StaticText(self, -1, ' Chi2/Npts')369 box_description_2= wx.StaticText(self, -1, 'Npts(Fit)')370 box_description_3= wx.StaticText(self, -1, 'Total Npts')367 box_description_1= wx.StaticText(self, -1, ' Chi2/Npts') 368 box_description_2= wx.StaticText(self, -1, 'Npts(Fit)') 369 box_description_3= wx.StaticText(self, -1, 'Total Npts') 371 370 box_description_3.SetToolTipString( \ 372 371 " Total Npts : total number of data points") … … 374 373 375 374 376 sizer_fit.Add(box_description_1, 0,0)377 sizer_fit.Add(box_description_2, 0,0)378 sizer_fit.Add(box_description_3, 0,0)379 sizer_fit.Add(self.draw_button, 0,0)380 sizer_fit.Add(self.tcChi, 0,0)381 sizer_fit.Add(self.Npts_fit ,0,0)382 sizer_fit.Add(self.Npts_total, 0,0)383 sizer_fit.Add(self.btFit, 0,0)375 sizer_fit.Add(box_description_1, 0, 0) 376 sizer_fit.Add(box_description_2, 0, 0) 377 sizer_fit.Add(box_description_3, 0, 0) 378 sizer_fit.Add(self.draw_button, 0, 0) 379 sizer_fit.Add(self.tcChi, 0, 0) 380 sizer_fit.Add(self.Npts_fit, 0, 0) 381 sizer_fit.Add(self.Npts_total, 0, 0) 382 sizer_fit.Add(self.btFit, 0, 0) 384 383 385 384 # StaticText for smear … … 1192 1191 else: 1193 1192 msg = "FitPage: fit button has unknown label" 1194 raise ValuerError, msg1193 raise RuntimeError, msg 1195 1194 self._manager._reset_schedule_problem(value=0) 1196 1195
Note: See TracChangeset
for help on using the changeset viewer.