Changeset ff3b293 in sasview for src/sas/qtgui/Perspectives


Ignore:
Timestamp:
Aug 24, 2018 1:46:36 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
4fd19be
Parents:
54492dc
Message:

Improve error handling in Chi2 calculations.
Improve bad input communication in Fit Algorithms
SASVIEW-988

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingOptions.py

    rf7d39c9 rff3b293  
    138138        Update the fitter object 
    139139        """ 
     140        options = self.config.values[self.current_fitter_id] 
     141        for option in options.keys(): 
     142            # Find the widget name of the option 
     143            # e.g. 'samples' for 'dream' is 'self.samples_dream' 
     144            widget_name = 'self.'+option+'_'+self.current_fitter_id 
     145            line_edit = eval(widget_name) 
     146            if line_edit is None or not isinstance(line_edit, QtWidgets.QLineEdit): 
     147                continue 
     148            color = line_edit.palette().color(QtGui.QPalette.Background).name() 
     149            if color == '#fff79a': 
     150                # Show a custom tooltip and return 
     151                tooltip = "<html><b>Please enter valid values in all fields.</html>" 
     152                QtWidgets.QToolTip.showText(line_edit.mapToGlobal( 
     153                    QtCore.QPoint(line_edit.rect().right(), line_edit.rect().bottom() + 2)), tooltip) 
     154                return 
     155 
    140156        # Notify the perspective, so the window title is updated 
    141157        self.fit_option_changed.emit(self.cbAlgorithm.currentText()) 
     
    158174        # Update the BUMPS singleton 
    159175        [bumpsUpdate(o) for o in self.config.values[self.current_fitter_id].keys()] 
     176        self.close() 
    160177 
    161178    def onHelp(self): 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    rf7d39c9 rff3b293  
    265265    Calculate Chi2 value between two sets of data 
    266266    """ 
    267  
     267    if reference_data is None or current_data is None: 
     268        return None 
    268269    # WEIGHING INPUT 
    269270    #from sas.sasgui.perspectives.fitting.utils import get_weight 
  • src/sas/qtgui/Perspectives/Fitting/UI/FittingOptionsUI.ui

    r85487ebd rff3b293  
    555555  <connection> 
    556556   <sender>buttonBox</sender> 
    557    <signal>accepted()</signal> 
    558    <receiver>FittingOptions</receiver> 
    559    <slot>accept()</slot> 
    560    <hints> 
    561     <hint type="sourcelabel"> 
    562      <x>248</x> 
    563      <y>254</y> 
    564     </hint> 
    565     <hint type="destinationlabel"> 
    566      <x>157</x> 
    567      <y>274</y> 
    568     </hint> 
    569    </hints> 
    570   </connection> 
    571   <connection> 
    572    <sender>buttonBox</sender> 
    573557   <signal>rejected()</signal> 
    574558   <receiver>FittingOptions</receiver> 
Note: See TracChangeset for help on using the changeset viewer.