Changeset 05228b0 in sasview for src/sas/sasgui/perspectives


Ignore:
Timestamp:
Apr 22, 2016 1:55:08 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
243fbc0
Parents:
4188da8
Message:

use the new bumps fitter changed event to update the active fitter indicator

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitpanel.py

    rf60251f r05228b0  
    1717import models 
    1818_BOX_WIDTH = 80 
    19  
    2019 
    2120class FitPanel(nb, PanelBase): 
     
    154153        """ 
    155154        """ 
    156         from bumps.options import FIT_CONFIG 
    157         current = FIT_CONFIG.selected_name 
    158         self.parent.SetTitle(self.window_name + " - Active Fitting Optimizer: " + current) 
    159155        pos = self.GetSelection() 
    160156        if pos != -1: 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r86b049b r05228b0  
    5656    ON_MAC = True 
    5757 
    58  
     58import bumps.options 
     59from bumps.gui.fit_dialog import show_fit_config 
     60try: 
     61    from bumps.gui.fit_dialog import EVT_FITTER_CHANGED 
     62except ImportError: 
     63    EVT_FITTER_CHANGED = None  # type: wx.PyCommandEvent 
    5964 
    6065class Plugin(PluginBase): 
     
    501506        self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event) 
    502507        self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL) 
     508 
     509        if EVT_FITTER_CHANGED is not None: 
     510            self.parent.Bind(EVT_FITTER_CHANGED, self.on_fitter_changed) 
     511        self._set_fitter_label(bumps.options.FIT_CONFIG) 
     512 
    503513        #self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer) 
    504514        #Create reader when fitting panel are created 
     
    763773        Open the bumps options panel. 
    764774        """ 
    765         try: 
    766             from bumps.gui.fit_dialog import show_fit_config 
    767             show_fit_config(self.parent, help=self.on_help) 
    768         except ImportError: 
    769             # CRUFT: Bumps 0.7.5.6 and earlier do not have the help button 
    770             from bumps.gui.fit_dialog import OpenFitOptions 
    771             OpenFitOptions() 
     775        show_fit_config(self.parent, help=self.on_help) 
     776 
     777    def on_fitter_changed(self, event): 
     778        self._set_fitter_label(event.config) 
     779 
     780    def _set_fitter_label(self, config): 
     781        self.fit_panel.parent.SetTitle(self.fit_panel.window_name 
     782                                       + " - Active Fitting Optimizer: " 
     783                                       + config.selected_name) 
    772784 
    773785    def on_help(self, algorithm_id): 
Note: See TracChangeset for help on using the changeset viewer.