Changeset 8c85ac1 in sasview for src


Ignore:
Timestamp:
Nov 20, 2018 3:10:03 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
c4c4957
Parents:
87ca467
Message:

Fixed plot generation and handling in the generic scattering calc.
SASVIEW-1216

Location:
src/sas/qtgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/GenericScatteringCalculator.py

    rebf86f1 r8c85ac1  
    661661            data.xaxis('\\rm{Q_{x}}', '\AA^{-1}') 
    662662            data.yaxis('\\rm{Intensity}', 'cm^{-1}') 
    663             plot1D = Plotter(self, quickplot=True) 
    664             plot1D.plot(data) 
    665             plot1D.show() 
     663 
    666664            self.graph_num += 1 
    667             # TODO 
    668             print('TRANSFER OF DATA TO MAIN PANEL TO BE IMPLEMENTED') 
    669             return plot1D 
    670665        else: 
    671666            numpy.nan_to_num(self.data_to_plot) 
     
    679674            data.title = "GenSAS {}  #{} 2D".format(self.file_name, 
    680675                                                    int(self.graph_num)) 
    681             plot2D = Plotter2D(self, quickplot=True) 
    682             plot2D.plot(data) 
    683             plot2D.show() 
     676            zeros = numpy.ones(data.data.size, dtype=bool) 
     677            data.mask = zeros 
     678 
    684679            self.graph_num += 1 
    685680            # TODO 
    686             print('TRANSFER OF DATA TO MAIN PANEL TO BE IMPLEMENTED') 
    687             return plot2D 
    688  
     681        new_item = GuiUtils.createModelItemWithPlot(data, name=data.title) 
     682        self.communicator.updateModelFromPerspectiveSignal.emit(new_item) 
     683        self.communicator.forcePlotDisplaySignal.emit([new_item, data]) 
    689684 
    690685class Plotter3DWidget(PlotterBase): 
  • src/sas/qtgui/Plotting/Plotter2D.py

    r87ca467 r8c85ac1  
    299299 
    300300        self.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    301  
    302301        self.manager.communicator.forcePlotDisplaySignal.emit([item, new_plot]) 
    303302 
     
    306305        Update circular averaging plot on Data2D change 
    307306        """ 
     307        if not hasattr(self,'_item'): return 
    308308        item = self._item 
    309309        if self._item.parent() is not None: 
     
    312312        # Get all plots for current item 
    313313        plots = GuiUtils.plotsFromModel("", item) 
     314        if plots is None: return 
    314315        ca_caption = '2daverage'+self.data.name 
    315316        # See if current item plots contain 2D average plot 
    316         test = [ca_caption in plot.group_id for plot in plots] 
     317        has_plot = False 
     318        for plot in plots: 
     319            if plot.group_id is None: continue 
     320            if ca_caption in plot.group_id: has_plot=True 
    317321        # return prematurely if no circular average plot found 
    318         if not any(test): return 
     322        if not has_plot: return 
    319323 
    320324        # Create a new plot 
Note: See TracChangeset for help on using the changeset viewer.