Ignore:
Timestamp:
03/30/12 19:58:59 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-3749)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: unit tests of sdplot

Put in Release Notes: No

Module(s): sdplot, sdfit, sdstat, sdflag, sdcal, sdreduce

Description:

Made asapplotter not to generate plotter window at start-up, but the window is
only generated at the first invokation of plotting operation.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotgui_qt4.py

    r2416 r2451  
    2929
    3030        asaplotbase.__init__(self, **v)
     31        matplotlib.rcParams["interactive"] = True
    3132
     33        _pylab_helpers.Gcf.destroy(0)
    3234        self.canvas = FigureCanvasQTAgg(self.figure)
    3335        # Simply instantiating this is enough to get a working toolbar.
     
    5052        qt.QtCore.QObject.connect(self.window, qt.QtCore.SIGNAL('destroyed()'),dest_callback)
    5153
    52         self.events = {'button_press':None,
    53                        'button_release':None,
    54                        'motion_notify':None}
    55 
    56         matplotlib.rcParams["interactive"] = True
    57         self.buffering = buffering
    58 
    5954        self.unmap()
    6055        #self.canvas.show()
     
    6560        window stack.
    6661        """
     62        if self.is_dead:
     63            raise RuntimeError( "No plotter to show. Not yet plotted or plotter is closed." )
    6764        self.window.activateWindow()
    6865        #To raise this window to the top of the stacking order
     
    7572        """
    7673        self.is_dead = True
    77         try: self.window.close()
     74        if not self.figmgr:
     75            return
     76        try:
     77            #self.window.close()
     78            # TODO destroy casabar
     79            _pylab_helpers.Gcf.destroy(self.figmgr.num)
     80            del self.window, self.canvas, self.figmgr
     81            self.window = None
     82            self.canvas = None
     83            self.figmgr = None
    7884        except RuntimeError: pass # the window may already be closed by user
    7985
     
    8288        Show graphics dependent on the current buffering state.
    8389        """
     90        if self.is_dead:
     91            raise RuntimeError( "No plotter to show (not yet plotted or closed)." )
    8492        if not self.buffering:
    8593            if hardrefresh:
     
    94102        Clear the figure.
    95103        """
     104        if not self.window:
     105            asaplog.push( "No plotter window to terminate." )
     106            asaplog.post( "WARN" )
     107            return
    96108        self.window.close()
    97109
     
    100112        Hide the ASAPlot graphics window.
    101113        """
     114        if not self.window:
     115            asaplog.push( "No plotter window to unmap." )
     116            asaplog.post( "WARN" )
     117            return
    102118        self.window.hide()
    103119
Note: See TracChangeset for help on using the changeset viewer.