Changeset 02c11b04 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Oct 26, 2017 3:34:19 AM (7 years ago)
Author:
krzywon
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:
9e54199
Parents:
9ea43c82 (diff), f629e62f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI_OpenCL_Dialog' into ESS_GUI

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

Legend:

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

    rf0bb711 r9863343  
    384384        self._workspace.actionCombine_Batch_Fit.triggered.connect(self.actionCombine_Batch_Fit) 
    385385        self._workspace.actionFit_Options.triggered.connect(self.actionFit_Options) 
     386        self._workspace.actionGPU_Options.triggered.connect(self.actionGPU_Options) 
    386387        self._workspace.actionFit_Results.triggered.connect(self.actionFit_Results) 
    387388        self._workspace.actionChain_Fitting.triggered.connect(self.actionChain_Fitting) 
     
    620621        pass 
    621622 
     623    def actionGPU_Options(self): 
     624        """ 
     625        Load the OpenCL selection dialog if the fitting perspective is active 
     626        """ 
     627        if hasattr(self._current_perspective, "gpu_options_widget"): 
     628            self._current_perspective.gpu_options_widget.show() 
     629        pass 
     630 
    622631    def actionFit_Results(self): 
    623632        """ 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    rb00414d r06ce180  
    2525     <y>0</y> 
    2626     <width>915</width> 
    27      <height>21</height> 
     27     <height>26</height> 
    2828    </rect> 
    2929   </property> 
     
    103103    <addaction name="separator"/> 
    104104    <addaction name="actionFit_Options"/> 
     105    <addaction name="actionGPU_Options"/> 
    105106    <addaction name="actionFit_Results"/> 
    106107    <addaction name="separator"/> 
     
    499500   </property> 
    500501  </action> 
     502  <action name="actionGPU_Options"> 
     503   <property name="text"> 
     504    <string>GPU Options</string> 
     505   </property> 
     506   <property name="softKeyRole"> 
     507    <enum>QAction::NoSoftKey</enum> 
     508   </property> 
     509  </action> 
    501510 </widget> 
    502511 <resources/> 
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r1420066 r88e1f57  
    463463        Forces display of charts for the given filename 
    464464        """ 
    465         # Assure no multiple plots for the same ID 
    466465        plot_to_show = data_list[0] 
    467         if plot_to_show.id in PlotHelper.currentPlots(): 
    468             return 
    469  
    470         # Now query the model item for available plots 
     466 
     467        # passed plot is used ONLY to figure out its title, 
     468        # so all the charts related by it can be pulled from  
     469        # the data explorer indices. 
    471470        filename = plot_to_show.filename 
    472471        model = self.model if plot_to_show.is_data else self.theory_model 
     472 
     473        # Now query the model item for available plots 
    473474        plots = GuiUtils.plotsFromFilename(filename, model) 
     475        item = GuiUtils.itemFromFilename(filename, model) 
     476 
     477        new_plots = [] 
    474478        for plot in plots: 
    475479            plot_id = plot.id 
     
    477481                self.active_plots[plot_id].replacePlot(plot_id, plot) 
    478482            else: 
    479                 self.plotData([(None, plot)]) 
     483                # 'sophisticated' test to generate standalone plot for residuals 
     484                if 'esiduals' in plot.title: 
     485                    self.plotData([(item, plot)]) 
     486                else: 
     487                    new_plots.append((item, plot)) 
     488 
     489        if new_plots: 
     490            self.plotData(new_plots) 
    480491 
    481492    def addDataPlot2D(self, plot_set, item): 
     
    487498        plot2D.plot(plot_set) 
    488499        self.addPlot(plot2D) 
     500        self.active_plots[plot2D.data.id] = plot2D 
    489501        #============================================ 
    490502        # Experimental hook for silx charts 
     
    507519        # Call show on requested plots 
    508520        # All same-type charts in one plot 
    509         #if isinstance(plot_set, Data1D): 
    510         #    new_plot = Plotter(self) 
    511  
    512521        for item, plot_set in plots: 
    513522            if isinstance(plot_set, Data1D): 
     
    515524                    new_plot = Plotter(self) 
    516525                new_plot.plot(plot_set) 
     526                # active_plots may contain multiple charts 
     527                self.active_plots[plot_set.id] = new_plot 
    517528            elif isinstance(plot_set, Data2D): 
    518529                self.addDataPlot2D(plot_set, item) 
     
    556567 
    557568        # Update the active chart list 
    558         self.active_plots[new_plot.data.id] = new_plot 
     569        #self.active_plots[new_plot.data.id] = new_plot 
    559570 
    560571    def appendPlot(self): 
  • src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py

    rf4a1433 rf7d14a1  
    2525import sas.qtgui.Plotting.PlotHelper as PlotHelper 
    2626 
    27 #if not QApplication.instance(): 
    28 app = QApplication(sys.argv) 
     27if not QApplication.instance(): 
     28    app = QApplication(sys.argv) 
    2929 
    3030class DataExplorerTest(unittest.TestCase): 
     
    3737            def allowBatch(self): 
    3838                return False 
    39             def setData(self, data_item=None): 
     39            def setData(self, data_item=None, is_batch=False): 
    4040                return None 
    4141            def title(self): 
     
    170170 
    171171        # Populate the model 
    172         #filename = ["cyl_400_20.txt", "P123_D2O_10_percent.dat", "cyl_400_20.txt"] 
    173         filename = ["cyl_400_20.txt", "cyl_400_20.txt", "P123_D2O_10_percent.dat"] 
     172        filename = ["cyl_400_20.txt", "cyl_400_20.txt", "cyl_400_20.txt"] 
    174173        self.form.readData(filename) 
    175  
    176         self.form.show() 
    177         app.exec_() 
    178174 
    179175        # Assure the model contains three items 
Note: See TracChangeset for help on using the changeset viewer.