Changeset fde249c in sasview for prview/perspectives/pr
- Timestamp:
- Jun 6, 2009 11:41:57 AM (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:
- 675e0ab
- Parents:
- 410aad8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/inversion_panel.py
r91128648 rfde249c 209 209 self._on_pars_changed(None) 210 210 elif name=='datafile': 211 self.data_file.SetValue(str(value)) 212 self._on_pars_changed(None) 211 if self.standalone==True: 212 self.data_file.SetValue(str(value)) 213 self._on_pars_changed(None) 213 214 else: 214 215 wx.Panel.__setattr__(self, name, value) … … 306 307 if self.standalone==False: 307 308 return self.plot_data.GetValue() 309 else: 310 return None 308 311 elif name=='datafile': 309 return self.data_file.GetValue() 312 if self.standalone==True: 313 return self.data_file.GetValue() 314 else: 315 return None 310 316 else: 311 317 wx.Panel.__getattr__(self, name) … … 343 349 if self.manager.standalone==True: 344 350 state.file = self.data_file.GetValue() 345 else:346 #TODO: save the data347 pass348 351 349 352 # Background evaluation checkbox … … 364 367 state.bck = self.bck 365 368 366 state.toXML(path) 369 if self.manager.standalone==True: 370 state.toXML(path) 371 else: 372 self.manager.save_data(filepath=path, prstate=state) 373 367 374 return state 368 375 … … 376 383 @param state: InversionState object 377 384 """ 378 self.nfunc = state.nfunc 379 self.d_max = state.d_max 380 self.alpha = state.alpha 381 self.q_min = state.qmin 382 self.q_max = state.qmax 383 self.slit_width = state.width 384 self.slit_height = state.height 385 if state.nfunc is not None: 386 self.nfunc = state.nfunc 387 if state.d_max is not None: 388 self.d_max = state.d_max 389 if state.alpha is not None: 390 self.alpha = state.alpha 391 if state.qmin is not None: 392 self.q_min = state.qmin 393 if state.qmax is not None: 394 self.q_max = state.qmax 395 if state.width is not None: 396 self.slit_width = state.width 397 if state.height is not None: 398 self.slit_height = state.height 385 399 386 400 # Data file 387 self.data_file.SetValue(str(state.file)) 401 if self.standalone==True: 402 self.data_file.SetValue(str(state.file)) 403 else: 404 self.plot_data.SetValue(str(state.file)) 388 405 389 406 # Background evaluation checkbox … … 391 408 392 409 # Estimates 393 self.nterms_estimate = state.nterms_estimate 394 self.alpha_estimate = state.alpha_estimate 410 if state.nterms_estimate is not None: 411 self.nterms_estimate = state.nterms_estimate 412 if state.alpha_estimate is not None: 413 self.alpha_estimate = state.alpha_estimate 395 414 396 415 397 416 # Read the output values 398 self.chi2 = state.chi2 399 self.elapsed = state.elapsed 400 self.oscillation = state.osc 401 self.positive = state.pos 402 self.pos_err = state.pos_err 403 self.rg = state.rg 404 self.iq0 = state.iq0 405 self.bck = state.bck 417 if state.chi2 is not None: 418 self.chi2 = state.chi2 419 if state.elapsed is not None: 420 self.elapsed = state.elapsed 421 if state.osc is not None: 422 self.oscillation = state.osc 423 if state.pos is not None: 424 self.positive = state.pos 425 if state.pos_err is not None: 426 self.pos_err = state.pos_err 427 if state.rg is not None: 428 self.rg = state.rg 429 if state.iq0 is not None: 430 self.iq0 = state.iq0 431 if state.bck is not None: 432 self.bck = state.bck 406 433 407 434 # Check whether the file is accessible, if so, 408 435 # load it a recompute P(r) using the new parameters 409 if os.path.isfile(state.file): 410 self._change_file(filepath=state.file) 436 if self.standalone==True: 437 if os.path.isfile(state.file): 438 self._change_file(filepath=state.file) 439 self._on_invert(None) 440 else: 441 message = "Could not find [%s] on the file system." % state.file 442 wx.PostEvent(self.manager.parent, StatusEvent(status=message)) 443 else: 411 444 self._on_invert(None) 412 else:413 message = "Could not find [%s] on the file system." % state.file414 wx.PostEvent(self.manager.parent, StatusEvent(status=message))415 416 417 445 418 446 def set_manager(self, manager):
Note: See TracChangeset
for help on using the changeset viewer.