Changeset 9ce69ec in sasview for src/sas/qtgui/MainWindow


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/MainWindow/DataExplorer.py

    r9f4eaeb r9ce69ec  
    598598        Forces display of charts for the given data set 
    599599        """ 
    600         plot_to_show = data_list[0] 
    601         # passed plot is used ONLY to figure out its title, 
    602         # so all the charts related by it can be pulled from  
    603         # the data explorer indices. 
    604         filename = plot_to_show.filename 
    605         self.displayFile(filename=filename, is_data=plot_to_show.is_data, id=id) 
     600        # data_list = [QStandardItem, Data1D/Data2D] 
     601        plot_to_show = data_list[1] 
     602        plot_item = data_list[0] 
     603 
     604        # plots to show 
     605        new_plots = [] 
     606 
     607        # Check if this is merely a plot update 
     608        if self.updatePlot(plot_to_show): 
     609            return 
     610 
     611        # Residuals get their own plot 
     612        if plot_to_show.plot_role == Data1D.ROLE_RESIDUAL: 
     613            plot_to_show.yscale='linear' 
     614            self.plotData([(plot_item, plot_to_show)]) 
     615        elif plot_to_show.plot_role == Data1D.ROLE_DELETABLE: 
     616            # No plot 
     617            return 
     618        else: 
     619            # Plots with main data points on the same chart 
     620            # Get the main data plot 
     621            main_data = GuiUtils.dataFromItem(plot_item.parent()) 
     622            if main_data is None: 
     623                # Try the current item 
     624                main_data = GuiUtils.dataFromItem(plot_item) 
     625            if main_data is not None: 
     626                new_plots.append((plot_item, main_data)) 
     627            new_plots.append((plot_item, plot_to_show)) 
     628 
     629        if new_plots: 
     630            self.plotData(new_plots) 
    606631 
    607632    def addDataPlot2D(self, plot_set, item): 
Note: See TracChangeset for help on using the changeset viewer.