Changeset aa4b8379 in sasview for prview/perspectives/pr/inversion_panel.py
- Timestamp:
- Jun 18, 2008 4:10:06 PM (16 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:
- 3fd1ebc
- Parents:
- 4972de2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/inversion_panel.py
rb659551 raa4b8379 115 115 pos_err = 1.0 116 116 117 def __init__(self, parent, id = -1, plots = None, **kwargs):117 def __init__(self, parent, id = -1, plots = None, standalone=False, **kwargs): 118 118 wx.Panel.__init__(self, parent, id = id, **kwargs) 119 119 … … 147 147 ## Data manager 148 148 self.manager = None 149 150 ## Standalone flage 151 self.standalone = standalone 149 152 150 153 self._do_layout() … … 181 184 #self.label_sugg.Show() 182 185 elif name=='plotname': 183 self.plot_data.SetValue(str(value)) 184 self.plot_radio.SetValue(True) 186 if self.standalone==False: 187 self.plot_data.SetValue(str(value)) 188 self.plot_radio.SetValue(True) 189 self._on_pars_changed(None) 190 elif name=='datafile': 191 self.data_file.SetValue(str(value)) 192 self.file_radio.SetValue(True) 185 193 self._on_pars_changed(None) 186 194 else: … … 214 222 self.alpha_estimate_ctl.GetValue() 215 223 elif name=='plotname': 216 self.plot_data.GetValue() 224 if self.standalone==False: 225 self.plot_data.GetValue() 226 elif name=='datafile': 227 self.data_file.GetValue() 217 228 else: 218 229 wx.Panel.__getattr__(self, name) … … 230 241 231 242 # ----- I(q) data ----- 232 databox = wx.StaticBox(self, -1, "I(q) data ")243 databox = wx.StaticBox(self, -1, "I(q) data source") 233 244 234 245 boxsizer1 = wx.StaticBoxSizer(databox, wx.VERTICAL) … … 248 259 pars_sizer.Add(choose_button, (iy,3), (1,1), wx.RIGHT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 249 260 250 iy += 1 251 self.plot_radio = wx.RadioButton(self, -1, "Plot data:") 252 self.plot_data = wx.TextCtrl(self, -1, size=(100,20)) 253 self.plot_data.SetEditable(False) 254 pars_sizer.Add(self.plot_radio, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 255 pars_sizer.Add(self.plot_data, (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 15) 261 if self.standalone==False: 262 iy += 1 263 self.plot_radio = wx.RadioButton(self, -1, "Plot data:") 264 self.plot_data = wx.TextCtrl(self, -1, size=(100,20)) 265 self.plot_data.SetEditable(False) 266 pars_sizer.Add(self.plot_radio, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 267 pars_sizer.Add(self.plot_data, (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 15) 256 268 257 269 boxsizer1.Add(pars_sizer, 0, wx.EXPAND) … … 476 488 # If the pars are valid, estimate alpha 477 489 if flag: 478 if self. plot_radio.GetValue():490 if self.standalone==False and self.plot_radio.GetValue(): 479 491 dataset = self.plot_data.GetValue() 480 492 self.manager.estimate_plot_inversion(alpha=alpha, nfunc=nfunc, … … 571 583 572 584 if flag: 573 if self. plot_radio.GetValue():585 if self.standalone==False and self.plot_radio.GetValue(): 574 586 dataset = self.plot_data.GetValue() 575 self.manager.setup_plot_inversion(alpha=alpha, nfunc=nfunc, 576 d_max=dmax, 577 q_min=qmin, q_max=qmax) 587 if len(dataset.strip())==0: 588 message = "No data to invert. Select a data set before proceeding with P(r) inversion." 589 wx.PostEvent(self.manager.parent, StatusEvent(status=message)) 590 else: 591 self.manager.setup_plot_inversion(alpha=alpha, nfunc=nfunc, 592 d_max=dmax, 593 q_min=qmin, q_max=qmax) 578 594 else: 579 595 path = self.data_file.GetValue() 580 self.manager.setup_file_inversion(alpha=alpha, nfunc=nfunc, 581 d_max=dmax, path=path, 582 q_min=qmin, q_max=qmax 583 ) 596 if len(path.strip())==0: 597 message = "No data to invert. Select a data set before proceeding with P(r) inversion." 598 wx.PostEvent(self.manager.parent, StatusEvent(status=message)) 599 else: 600 self.manager.setup_file_inversion(alpha=alpha, nfunc=nfunc, 601 d_max=dmax, path=path, 602 q_min=qmin, q_max=qmax 603 ) 584 604 585 605 else:
Note: See TracChangeset
for help on using the changeset viewer.