Changeset d4216ac in sasview for src/sas


Ignore:
Timestamp:
Sep 27, 2018 5:50:03 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
b38871e
Parents:
4f8c17f
Message:

Remember status of fitted parameters and respond to checkbox changes
accordingly. SASVIEW-1163

File:
1 edited

Legend:

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

    r4f8c17f rd4216ac  
    469469        """ Enable/disable the polydispersity tab """ 
    470470        self.tabFitting.setTabEnabled(TAB_POLY, isChecked) 
     471        # Check if any parameters are ready for fitting 
     472        self.cmdFit.setEnabled(self.haveParamsToFit()) 
    471473 
    472474    def toggleMagnetism(self, isChecked): 
    473475        """ Enable/disable the magnetism tab """ 
    474476        self.tabFitting.setTabEnabled(TAB_MAGNETISM, isChecked) 
     477        # Check if any parameters are ready for fitting 
     478        self.cmdFit.setEnabled(self.haveParamsToFit()) 
    475479 
    476480    def toggleChainFit(self, isChecked): 
     
    15751579        self.updateKernelModelWithExtraParams(model) 
    15761580 
    1577         params_to_fit = self.main_params_to_fit 
     1581        params_to_fit = copy.deepcopy(self.main_params_to_fit) 
    15781582        if self.chkPolydispersity.isChecked(): 
    15791583            params_to_fit += self.poly_params_to_fit 
     
    22442248        Finds out if there are any parameters ready to be fitted 
    22452249        """ 
    2246         return (self.main_params_to_fit!=[] 
    2247                 or self.poly_params_to_fit!=[] 
    2248                 or self.magnet_params_to_fit != []) and \ 
    2249                 self.logic.data_is_loaded 
     2250        if not self.logic.data_is_loaded: 
     2251            return False 
     2252        if self.main_params_to_fit: 
     2253            return True 
     2254        if self.chkPolydispersity.isChecked() and self.poly_params_to_fit: 
     2255            return True 
     2256        if self.chkMagnetism.isChecked() and self.magnet_params_to_fit: 
     2257            return True 
     2258        return False 
    22502259 
    22512260    def onMainParamsChange(self, item): 
Note: See TracChangeset for help on using the changeset viewer.