Changeset 5b144c6 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Sep 8, 2018 4:23:48 PM (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:
5d28d6b
Parents:
685602a
git-author:
Piotr Rozyczko <rozyczko@…> (09/08/18 16:21:23)
git-committer:
Piotr Rozyczko <rozyczko@…> (09/08/18 16:23:48)
Message:

Clumsy fix to the single-data, multi-fitpage plotting issue SASVIEW-1018.
Fixed tests after replacing plot_dict indexing from .id to .name

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

Legend:

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

    r0cd98a1 r5b144c6  
    553553        return item 
    554554 
    555     def displayFile(self, filename=None, is_data=True): 
     555    def displayFile(self, filename=None, is_data=True, id=None): 
    556556        """ 
    557557        Forces display of charts for the given filename 
     
    560560        # Now query the model item for available plots 
    561561        plots = GuiUtils.plotsFromFilename(filename, model) 
    562  
     562        # Each fitpage contains the name based on fit widget number 
     563        fitpage_name = "" if id is None else "M"+str(id) 
    563564        new_plots = [] 
    564565        for item, plot in plots.items(): 
    565             if not self.updatePlot(plot): 
    566                 # Don't plot intermediate results, e.g. P(Q), S(Q) 
    567                 match = GuiUtils.theory_plot_ID_pattern.match(plot.id) 
    568                 # 2nd match group contains the identifier for the intermediate result, if present (e.g. "[P(Q)]") 
    569                 if match and match.groups()[1] != None: 
    570                     continue 
     566            if self.updatePlot(plot) and filename != plot.name: 
     567                continue 
     568            # Don't plot intermediate results, e.g. P(Q), S(Q) 
     569            match = GuiUtils.theory_plot_ID_pattern.match(plot.id) 
     570            # 2nd match group contains the identifier for the intermediate result, if present (e.g. "[P(Q)]") 
     571            if match and match.groups()[1] != None: 
     572                continue 
     573            # Don't include plots from different fitpages, but always include the original data 
     574            if fitpage_name in plot.name or filename == plot.name: 
    571575                # 'sophisticated' test to generate standalone plot for residuals 
    572576                if 'esiduals' in plot.title: 
     
    579583            self.plotData(new_plots) 
    580584 
    581     def displayData(self, data_list): 
     585    def displayData(self, data_list, id): 
    582586        """ 
    583587        Forces display of charts for the given data set 
     
    588592        # the data explorer indices. 
    589593        filename = plot_to_show.filename 
    590         self.displayFile(filename=filename, is_data=plot_to_show.is_data) 
     594        self.displayFile(filename=filename, is_data=plot_to_show.is_data, id=id) 
    591595 
    592596    def addDataPlot2D(self, plot_set, item): 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r339e22b r5b144c6  
    921921            self.filesWidget.displayFile(filename=filename, is_data=True) 
    922922 
    923     def showPlot(self, plot): 
     923    def showPlot(self, plot, id): 
    924924        """ 
    925925        Pass the show plot request to the data explorer 
    926926        """ 
    927927        if hasattr(self, "filesWidget"): 
    928             self.filesWidget.displayData(plot) 
     928            self.filesWidget.displayData(plot, id) 
    929929 
    930930    def uncheckAllMenuItems(self, menuObject): 
Note: See TracChangeset for help on using the changeset viewer.