Changeset 2d0e0c1 in sasview for src


Ignore:
Timestamp:
Jun 14, 2017 3:58:59 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
1643d8ed
Parents:
125c4be
Message:

Initial version of the Fitting Options dialog SASVIEW-276

Location:
src/sas/qtgui
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/GuiManager.py

    rdc5ef15 r2d0e0c1  
    612612        """ 
    613613        """ 
    614         print("actionFit_Options TRIGGERED") 
     614        if getattr(self._current_perspective, "fit_options_widget"): 
     615            self._current_perspective.fit_options_widget.show() 
    615616        pass 
    616617 
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r125c4be r2d0e0c1  
    44from PyQt4 import QtGui 
    55 
     6from bumps import options 
     7from bumps import fitters 
     8 
    69import sas.qtgui.Utilities.ObjectLibrary as ObjectLibrary 
    710 
    811from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget 
     12from sas.qtgui.Perspectives.Fitting.FittingOptions import FittingOptions 
    913from sas.qtgui.Perspectives.Fitting import ModelUtilities 
    1014 
     
    4549        self._allow_close = False 
    4650 
     51        # Fit options - uniform for all tabs 
     52        self.fit_options = options.FIT_CONFIG 
     53        self.fit_options_widget = FittingOptions(self, config=self.fit_options) 
     54        self.fit_options.selected_id = fitters.LevenbergMarquardtFit.id 
     55 
     56        # Listen to GUI Manager signal updating fit options 
     57        self.fit_options_widget.fit_option_changed.connect(self.onFittingOptionsChange) 
     58 
    4759        self.menu_manager = ModelUtilities.ModelManager() 
    4860        # TODO: reuse these in FittingWidget properly 
     
    5062        self.model_dictionary = self.menu_manager.get_model_dictionary() 
    5163 
     64        #self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) 
     65        self.updateWindowTitle() 
     66 
     67    def updateWindowTitle(self): 
     68        """ 
     69        Update the window title with the current optimizer name 
     70        """ 
     71        self.optimizer = self.fit_options.selected_name 
    5272        self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) 
     73 
    5374 
    5475    def setClosable(self, value=True): 
     
    137158            else: 
    138159                self.addFit(data) 
     160 
     161    def onFittingOptionsChange(self, fit_engine, fit_options): 
     162        """ 
     163        """ 
     164        fitter = [f.id for f in options.FITTERS if f.name == str(fit_engine)][0] 
     165 
     166        # set the optimizer 
     167        self.fit_options.selected_id = str(fitter) 
     168        # set the options 
     169        # 
     170        # Update the title 
     171        self.updateWindowTitle() 
     172 
     173        pass 
Note: See TracChangeset for help on using the changeset viewer.