Changeset a3ed157 in sasview for src/sas/sasgui/perspectives/corfunc


Ignore:
Timestamp:
Aug 22, 2016 8:30:04 AM (8 years ago)
Author:
lewis
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
6ffa0dd
Parents:
20ced5c
Message:

More useful error messages when calculating bg fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    r20ced5c ra3ed157  
    172172            self.set_qmin(lower) 
    173173            self.set_qmax((upper1, upper2)) 
    174             self.set_background(self._calculator.compute_background(self.qmax)) 
     174            self._compute_background() 
    175175 
    176176    def get_data(self): 
     
    210210        try: 
    211211            params, self._extrapolated_data = self._calculator.compute_extrapolation() 
    212         except: 
    213             msg = "Error extrapolating data." 
     212        except Exception as e: 
     213            msg = "Error extrapolating data:\n" 
     214            msg += str(e) 
    214215            wx.PostEvent(self._manager.parent, 
    215                 StatusEvent(status=msg, info="Error")) 
     216                StatusEvent(status=msg, info="error")) 
    216217            self._transform_btn.Disable() 
    217218            return 
     
    374375 
    375376    def _compute_background(self, event=None): 
    376         self.set_background(self._calculator.compute_background(self.qmax)) 
     377        if event is not None: 
     378            event.Skip() 
     379        self._on_enter_input() 
     380        try: 
     381            bg = self._calculator.compute_background(self.qmax) 
     382            self.set_background(bg) 
     383        except Exception as e: 
     384            msg = "Error computing background level:\n" 
     385            msg += str(e) 
     386            wx.PostEvent(self._manager.parent, 
     387                StatusEvent(status=msg, info="error")) 
    377388 
    378389    def _on_enter_input(self, event=None): 
Note: See TracChangeset for help on using the changeset viewer.