Changeset 1582


Ignore:
Timestamp:
06/29/09 15:45:19 (15 years ago)
Author:
Malte Marquarding
Message:

Increased maxstack to 16; added simple selection to plotter (refer to #169)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1572 r1582  
    697697        if isinstance(nstack0, int): nstack = nstack0
    698698        else: nstack = len(nstack0)
    699         maxpanel, maxstack = 16,8
     699        maxpanel, maxstack = 16,16
    700700        if n > maxpanel or nstack > maxstack:
    701701            from asap import asaplog
     
    816816
    817817
    818     def set_selection(self, selection=None, refresh=True):
    819         self._selection = isinstance(selection,selector) and selection or selector()
     818    def set_selection(self, selection=None, refresh=True, **kw):
     819        if selection is None:
     820            # reset
     821            if len(kw) == 0:
     822                self._selection = selector()
     823            else:
     824                # try keywords
     825                for k in kw:
     826                    if k not in selector.fields:
     827                        raise KeyError("Invalid selection key '%s', valid keys are %s" % (k, selector.fields))
     828                self._selection = selector(**kw)
     829        elif isinstance(selection, selector):
     830            self._selection = selection
     831        else:
     832            raise TypeError("'selection' is not of type selector")
     833
    820834        d0 = {'s': 'SCANNO', 'b': 'BEAMNO', 'i':'IFNO',
    821835              'p': 'POLNO', 'c': 'CYCLENO', 't' : 'TIME' }
Note: See TracChangeset for help on using the changeset viewer.