Ignore:
Timestamp:
Aug 24, 2018 3: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

File:
1 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): 
Note: See TracChangeset for help on using the changeset viewer.