示例#1
0
def getViewManagers(viewId=None):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = mcv.getVMManager().getViewManagers()
        if not viewId:
            return viewManagers

        if viewId.startswith('name:'):
            viewId = viewId.replace('name:', '')

        goodOnes = []
        for (index, vm) in enumerate(viewManagers):
            if viewId.startswith('#'):
                if index == int(viewId[1:]):
                    goodOnes.append(vm)
                continue
            if viewId.startswith('class:'):
                if StringUtil.stringMatch(vm.getClass().getName(), viewId[6:],
                                          True, True):
                    goodOnes.append(vm)
                continue

            name = vm.getName()
            if not name:
                name = ''
            if StringUtil.stringMatch(name, viewId, True, True):
                goodOnes.append(vm)

        return goodOnes
示例#2
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def getViewManagers(viewId=None):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = mcv.getVMManager().getViewManagers()
        if not viewId:
            return viewManagers
            
        if viewId.startswith('name:'):
            viewId = viewId.replace('name:', '')
            
        goodOnes = []
        for (index, vm) in enumerate(viewManagers):
            if viewId.startswith('#'):
                if index == int(viewId[1:]):
                    goodOnes.append(vm)
                continue
            if viewId.startswith('class:'):
                if StringUtil.stringMatch(vm.getClass().getName(), viewId[6:], True, True):
                    goodOnes.append(vm)
                continue
                
            name = vm.getName()
            if not name:
                name = ''
            if StringUtil.stringMatch(name, viewId, True, True):
                goodOnes.append(vm)
                
        return goodOnes
示例#3
0
def removeAllDisplays():
    """
    <removedisplays> Remove all displays
    <removedisplays 
        display="display id to remove" >
    This removes all current displays. If there is the display attribute set then it removes that display. (See below).
    <removedisplays/>
    """
    mcv = McIDASV.getStaticMcv()
    if mcv:
        mcv.removeAllLayers(False)
示例#4
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def findDisplayControl(displayId):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        for control in mcv.getDisplayControls():
            if displayId.startswith('class:'):
                if StringUtil.stringMatch(control.getClass().getName(), displayId[6:], True, True):
                    return control
            if control.getId():
                if StringUtil.stringMatch(control.getId(), displayId, True, True):
                    return control
    return None
示例#5
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def removeAllDisplays():
    """
    <removedisplays> Remove all displays
    <removedisplays 
        display="display id to remove" >
    This removes all current displays. If there is the display attribute set then it removes that display. (See below).
    <removedisplays/>
    """
    mcv = McIDASV.getStaticMcv()
    if mcv:
        mcv.removeAllLayers(False)
示例#6
0
def findDisplayControl(displayId):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        for control in mcv.getDisplayControls():
            if displayId.startswith('class:'):
                if StringUtil.stringMatch(control.getClass().getName(),
                                          displayId[6:], True, True):
                    return control
            if control.getId():
                if StringUtil.stringMatch(control.getId(), displayId, True,
                                          True):
                    return control
    return None
示例#7
0
def centerDisplay(viewId, useProjection=False):
    control = findDisplayControl(id)
    if not control:
        raise IllegalArgumentException('Could not find display: %s' % (id))

    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = getViewManagers(viewId)
        if useProjection and control.getDataProjection():
            mapProjection = control.getDataProjection()
            mcv.getVMManager().center(mapProjection, viewManagers)
        elif control.getDisplayCenter():
            centerPoint = Util.makeEarthLocation(control.getDisplayCenter())
            mcv.getVMManager().center(centerPoint, viewManagers)
示例#8
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def centerDisplay(viewId, useProjection=False):
    control = findDisplayControl(id)
    if not control:
        raise IllegalArgumentException('Could not find display: %s' % (id))
        
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = getViewManagers(viewId)
        if useProjection and control.getDataProjection():
            mapProjection = control.getDataProjection()
            mcv.getVMManager().center(mapProjection, viewManagers)
        elif control.getDisplayCenter():
            centerPoint = Util.makeEarthLocation(control.getDisplayCenter())
            mcv.getVMManager().center(centerPoint, viewManagers)
示例#9
0
def reload():
    mcv = McIDASV.getStaticMcv()
    if mcv:
        for source in mcv.getDataSources():
            source.reloadData()
示例#10
0
def removeAllData():
    mcv = McIDASV.getStaticMcv()
    if mcv:
        mcv.removeAllData(False)
示例#11
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def centerOnRectangle(north, south, west, east):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = getViewManagers()
        projRect = ProjectionRect(west, north, east, south)
        mcv.getVMManager().center(projRec, viewManagers)
示例#12
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def centerOnLatLon(latitude, longitude):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers =  getViewManagers()
        earthLoc = Util.makeEarthLocation(latitude, longitude)
        mcv.getVMManager().center(earthLoc, viewManagers)
示例#13
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def reload():
    mcv = McIDASV.getStaticMcv()
    if mcv:
        for source in mcv.getDataSources():
            source.reloadData()
示例#14
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def removeAllData():
    mcv = McIDASV.getStaticMcv()
    if mcv:
        mcv.removeAllData(False)
示例#15
0
def centerOnLatLon(latitude, longitude):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = getViewManagers()
        earthLoc = Util.makeEarthLocation(latitude, longitude)
        mcv.getVMManager().center(earthLoc, viewManagers)
示例#16
0
        jars['visad'] + '/visad/python',
        jars['idv'],
        jars['idv'] + '/ucar/unidata/idv/resources/python',
        jars['mcidasv'],
        jars['mcidasv'] + '/edu/wisc/ssec/mcidasv/resources/python',
        jars['mcidasv'] + '/edu/wisc/ssec/mcidasv/resources/python/utilities',
        jars['mcidasv'] + '/edu/wisc/ssec/mcidasv/resources/python/linearcombo',
    ]
    
for jythonpath in _mcvinit_jythonpaths():
    if not jythonpath in sys.path:
        sys.path.append(jythonpath)
        
# this is intentionally the first IDV/McV thing imported
from edu.wisc.ssec.mcidasv import McIDASV
_mcv = McIDASV.getStaticMcv()

# make sys.argv look as if the user ran "jython file.py arg1 ... argN"
from edu.wisc.ssec.mcidasv import ArgumentManager
argManager = _mcv.getArgsManager()
if argManager.hasJythonArguments():
    sys.argv = [argManager.getJythonScript()] + argManager.getJythonArguments()
    
# need to get some IDV-specifc init done
from ucar.unidata.idv.ui import ImageGenerator
islInterpreter = ImageGenerator(_mcv)

from edu.wisc.ssec.mcidasv.data.hydra import Statistics

# TODO(jon): is this really what we want!?
from visad.python.JPythonMethods import *
示例#17
0
def centerOnRectangle(north, south, west, east):
    mcv = McIDASV.getStaticMcv()
    if mcv:
        viewManagers = getViewManagers()
        projRect = ProjectionRect(west, north, east, south)
        mcv.getVMManager().center(projRec, viewManagers)
示例#18
0
def pauseUntilDone():
    mcv = McIDASV.importStaticMcv()
    if mcv:
        mcv.waitUntilDisplaysAreDone()
示例#19
0
        jars['visad'] + '/visad/python',
        jars['idv'],
        jars['idv'] + '/ucar/unidata/idv/resources/python',
        jars['mcidasv'],
        jars['mcidasv'] + '/edu/wisc/ssec/mcidasv/resources/python',
        jars['mcidasv'] + '/edu/wisc/ssec/mcidasv/resources/python/utilities',
        jars['mcidasv'] + '/edu/wisc/ssec/mcidasv/resources/python/linearcombo',
    ]
    
for jythonpath in _mcvinit_jythonpaths():
    if not jythonpath in sys.path:
        sys.path.append(jythonpath)
        
# this is intentionally the first IDV/McV thing imported
from edu.wisc.ssec.mcidasv import McIDASV
_mcv = McIDASV.getStaticMcv()

# make sys.argv look as if the user ran "jython file.py arg1 ... argN"
from edu.wisc.ssec.mcidasv import ArgumentManager
argManager = _mcv.getArgsManager()
if argManager.hasJythonArguments():
    sys.argv = [argManager.getJythonScript()] + argManager.getJythonArguments()
    
# need to get some IDV-specifc init done
from ucar.unidata.idv.ui import ImageGenerator
islInterpreter = ImageGenerator(_mcv)

from edu.wisc.ssec.mcidasv.data.hydra import Statistics

# TODO(jon): is this really what we want!?
from visad.python.JPythonMethods import *
示例#20
0
文件: isl.py 项目: TimO-CIMSS/mcidasv
def pauseUntilDone():
    mcv = McIDASV.importStaticMcv()
    if mcv:
        mcv.waitUntilDisplaysAreDone()