Ignore:
Timestamp:
Sep 18, 2018 3:51:44 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:
fc5d2d7f
Parents:
1738173
git-author:
Piotr Rozyczko <rozyczko@…> (09/18/18 03:42:03)
git-committer:
Piotr Rozyczko <rozyczko@…> (09/18/18 03:51:44)
Message:

Replaced 'smart' plot generation with explicit plot requests on "Show Plot". SASVIEW-1018

File:
1 edited

Legend:

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

    r305114c r9ce69ec  
    18491849        # Show the chart if ready 
    18501850        data_to_show = self.data if self.data_is_loaded else self.model_data 
    1851         if data_to_show is not None: 
    1852             self.communicate.plotRequestedSignal.emit([data_to_show], self.tab_id) 
     1851        # Any models for this page 
     1852        current_index = self.all_data[self.data_index] 
     1853        plots = GuiUtils.plotsFromFilename(self.data.filename, current_index.model()) 
     1854        fitpage_name = "" if id is None else "M"+str(self.tab_id) 
     1855        # Has the fitted data been shown? 
     1856        data_shown = False 
     1857        #for plot in plots: 
     1858        for item, plot in plots.items(): 
     1859            if fitpage_name in plot.name: 
     1860                data_shown = True 
     1861                self.communicate.plotRequestedSignal.emit([item, plot], self.tab_id) 
     1862        if not data_shown: 
     1863            # fit+data has not been shown - show just data 
     1864            self.communicate.plotRequestedSignal.emit([item, data_to_show], self.tab_id) 
    18531865 
    18541866    def onOptionsUpdate(self): 
     
    20802092        self.kernel_module = self.models[model_name]() 
    20812093 
     2094        # Change the model name to a monicker 
     2095        self.kernel_module.name = self.modelName() 
     2096 
    20822097        # Explicitly add scale and background with default values 
    20832098        temp_undo_state = self.undo_supported 
     
    21122127            # Structure factor is the only selected model; build it and show all its params 
    21132128            self.kernel_module = self.models[structure_factor]() 
     2129            self.kernel_module.name = self.modelName() 
    21142130            s_params = self.kernel_module._model_info.parameters 
    21152131            s_params_orig = s_params 
     
    21222138 
    21232139            self.kernel_module = MultiplicationModel(p_kernel, s_kernel) 
     2140            # Modify the name to correspond to shown items 
     2141            self.kernel_module.name = self.modelName() 
    21242142            all_params = self.kernel_module._model_info.parameters.kernel_parameters 
    21252143            all_param_names = [param.name for param in all_params] 
     
    24272445        # Bring the GUI to normal state 
    24282446        self.enableInteractiveElements() 
    2429  
     2447        if return_data is None: 
     2448            self.calculateDataFailed("Results not available.") 
     2449            return 
    24302450        fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 
    24312451        residuals = self.calculateResiduals(fitted_data) 
Note: See TracChangeset for help on using the changeset viewer.