Changeset d48cc19 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
May 2, 2017 9:04:48 AM (8 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:
02ddfb4
Parents:
0a6e097
Message:

Compute/Show? Plot button logic: SASVIEW-271
Unit tests for plotting in fitting: SASVIEW-501

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

Legend:

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

    r83eb5208 rd48cc19  
    433433        self.chkBatch.setEnabled(self.parent.perspective().allowBatch()) 
    434434 
     435    def displayData(self, data_list): 
     436        """ 
     437        Forces display of charts for the given filename 
     438        """ 
     439        # Assure no multiple plots for the same ID 
     440        plot_to_show = data_list[0] 
     441        for plot in PlotHelper.currentPlots(): 
     442            if plot == plot_to_show.id: 
     443                return 
     444 
     445        new_plot = Plotter(self) 
     446        # Now query the model item for available plots 
     447        filename = plot_to_show.filename 
     448        model = self.model if plot_to_show.is_data else self.theory_model 
     449        plots = GuiUtils.plotsFromFilename(filename, model) 
     450        for plot in plots: 
     451            new_plot.plot(plot) 
     452        self.plotAdd(new_plot) 
     453 
    435454    def newPlot(self): 
    436455        """ 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r28a09b0 rd48cc19  
    335335        self.communicate.perspectiveChangedSignal.connect(self.perspectiveChanged) 
    336336        self.communicate.updateTheoryFromPerspectiveSignal.connect(self.updateTheoryFromPerspective) 
     337        self.communicate.plotRequestedSignal.connect(self.showPlot) 
    337338 
    338339    def addTriggers(self): 
     
    727728        self.filesWidget.updateTheoryFromPerspective(index) 
    728729 
    729  
    730  
     730    def showPlot(self, plot): 
     731        """ 
     732        Pass the show plot request to the data explorer 
     733        """ 
     734        if hasattr(self, "filesWidget"): 
     735            self.filesWidget.displayData(plot) 
     736 
Note: See TracChangeset for help on using the changeset viewer.