Changeset 2147 for trunk


Ignore:
Timestamp:
04/18/11 20:20:40 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No (a minor imporvement)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: added a method asapplotter.casabar_exist()

Test Programs:

Put in Release Notes: No

Module(s): asapplotter, sdplot

Description:

added a method asapplotter.casabar_exist() which tells whether or not casa toolbar exists.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r2123 r2147  
    8888        return None
    8989
     90    def casabar_exists(self):
     91        if not hasattr(self._plotter.figmgr,'casabar'):
     92            return False
     93        elif self._plotter.figmgr.casabar:
     94            return True
     95        return False
     96
    9097    @asaplog_post_dec
    9198    def plot(self, scan=None):
     
    104111        self._reset_header()
    105112        if self._plotter.is_dead:
    106             if hasattr(self._plotter.figmgr,'casabar'):
     113            if self.casabar_exists():
    107114                del self._plotter.figmgr.casabar
    108115            self._plotter = self._newplotter()
    109116            self._plotter.figmgr.casabar=self._newcasabar()
    110         if self._plotter.figmgr.casabar:
     117        if self.casabar_exists():
    111118            self._plotter.figmgr.casabar.set_pagecounter(1)
    112119        self._panelrows = []
     
    121128        if self._minmaxy is not None:
    122129            self._plotter.set_limits(ylim=self._minmaxy)
    123         if self._plotter.figmgr.casabar: self._plotter.figmgr.casabar.enable_button()
     130        if self.casabar_exists(): self._plotter.figmgr.casabar.enable_button()
    124131        self._plotter.release()
    125132        self._plotter.tidy()
     
    10341041        self._startrow = r+1
    10351042        self._ipanel += panelcount
    1036         if self._plotter.figmgr.casabar:
     1043        if self.casabar_exists():
    10371044            if self._ipanel >= nptot-1:
    10381045                self._plotter.figmgr.casabar.disable_next()
     
    12851292    def plottp(self, scan=None, outfile=None):
    12861293        if self._plotter.is_dead:
    1287             if hasattr(self._plotter.figmgr,'casabar'):
     1294            if self.casabar_exists():
    12881295                del self._plotter.figmgr.casabar
    12891296            self._plotter = self._newplotter()
     
    13161323        self._plotter.figure.subplots_adjust(
    13171324            left=lef,bottom=bot,right=rig,top=top,wspace=wsp,hspace=hsp)
    1318         if self._plotter.figmgr.casabar: self._plotter.figmgr.casabar.disable_button()
     1325        if self.casabar_exists(): self._plotter.figmgr.casabar.disable_button()
    13191326        self._plottp(self._data)
    13201327        if self._minmaxy is not None:
Note: See TracChangeset for help on using the changeset viewer.