Changeset 88e1f57 in sasview for src


Ignore:
Timestamp:
Oct 24, 2017 8:21:11 AM (7 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:
814a253
Parents:
d6b234b
Message:

Fixed chart update upon consecutive fitting.
Fixed 1D default charts - now only two (combined data/fit + residuals)
Minor text fixes

Location:
src/sas
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/_config.py

    rb963b20 r88e1f57  
    6565    try: 
    6666        module = load_module_from_path('sas.local_config', path) 
    67         logger.info("GuiManager loaded %s", path) 
     67        #logger.info("GuiManager loaded %s", path) 
    6868        return module 
    6969    except Exception as exc: 
    70         logger.critical("Error loading %s: %s", path, exc) 
     70        #logger.critical("Error loading %s: %s", path, exc) 
    7171        sys.exit() 
    7272 
  • 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 r88e1f57  
    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): 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    ra95c44b r88e1f57  
    10381038        # Regardless of previous state, this should now be `plot show` functionality only 
    10391039        self.cmdPlot.setText("Show Plot") 
    1040         if not self.data_is_loaded: 
    1041             self.recalculatePlotData() 
     1040        # Force data recalculation so existing charts are updated 
     1041        self.recalculatePlotData() 
    10421042        self.showPlot() 
    10431043 
  • src/sas/qtgui/Utilities/GuiUtils.py

    rf0bb711 r88e1f57  
    313313    # Append the new row to the main item 
    314314    item.appendRow(object_item) 
     315 
     316def itemFromFilename(filename, model_item): 
     317    """ 
     318    Returns the model item text=filename in the model 
     319    """ 
     320    assert isinstance(model_item, QtGui.QStandardItemModel) 
     321    assert isinstance(filename, basestring) 
     322 
     323    # Iterate over model looking for named items 
     324    item = list(filter(lambda i: str(i.text()) == filename, 
     325                  [model_item.item(index) for index in range(model_item.rowCount())])) 
     326    return item[0] if len(item)>0 else None 
    315327 
    316328def plotsFromFilename(filename, model_item): 
Note: See TracChangeset for help on using the changeset viewer.