Ignore:
Timestamp:
Sep 25, 2018 6:35:13 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:
4e85147
Parents:
6923863
Message:

Updates to the scattering calculator SASVIEW-1147

File:
1 edited

Legend:

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

    raed0532 r30e0be0  
    3232 
    3333    trigger_plot_3d = QtCore.pyqtSignal() 
     34    calculationFinishedSignal = QtCore.pyqtSignal() 
    3435 
    3536    def __init__(self, parent=None): 
     
    100101        # plots - 3D in real space 
    101102        self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 
     103 
     104        # plots - 3D in real space 
     105        self.calculationFinishedSignal.connect(self.plot_1_2d) 
    102106 
    103107        # TODO the option Ellipsoid has not been implemented 
     
    545549            d = threads.deferToThread(self.complete, inputs, self._update) 
    546550            # Add deferred callback for call return 
    547             d.addCallback(self.plot_1_2d) 
     551            #d.addCallback(self.plot_1_2d) 
     552            d.addCallback(self.calculateComplete) 
    548553            d.addErrback(self.calculateFailed) 
    549554        except: 
     
    563568        print("Calculate Failed with:\n", reason) 
    564569        pass 
     570 
     571    def calculateComplete(self, d): 
     572        """ 
     573        Notify the main thread 
     574        """ 
     575        self.calculationFinishedSignal.emit() 
    565576 
    566577    def complete(self, input, update=None): 
     
    629640        self.graph_num += 1 
    630641 
    631     def plot_1_2d(self, d): 
     642    def plot_1_2d(self): 
    632643        """ Generate 1D or 2D plot, called in Compute""" 
    633644        if self.is_avg or self.is_avg is None: 
     
    637648            data.xaxis('\\rm{Q_{x}}', '\AA^{-1}') 
    638649            data.yaxis('\\rm{Intensity}', 'cm^{-1}') 
    639             plot1D = Plotter(self) 
     650            plot1D = Plotter(self, quickplot=True) 
    640651            plot1D.plot(data) 
    641652            plot1D.show() 
     
    655666            data.title = "GenSAS {}  #{} 2D".format(self.file_name, 
    656667                                                    int(self.graph_num)) 
    657             plot2D = Plotter2D(self) 
     668            plot2D = Plotter2D(self, quickplot=True) 
    658669            plot2D.plot(data) 
    659670            plot2D.show() 
     
    825836        self.figure.canvas.draw() 
    826837 
     838    def createContextMenu(self): 
     839        """ 
     840        Define common context menu and associated actions for the MPL widget 
     841        """ 
     842        return 
     843 
     844    def createContextMenuQuick(self): 
     845        """ 
     846        Define context menu and associated actions for the quickplot MPL widget 
     847        """ 
     848        return 
     849 
    827850 
    828851class Plotter3D(QtWidgets.QDialog, Plotter3DWidget): 
Note: See TracChangeset for help on using the changeset viewer.