当前位置: 首页>>代码示例>>Python>>正文


Python proxies.new_proxy函数代码示例

本文整理汇总了Python中pymantidplot.proxies.new_proxy函数的典型用法代码示例。如果您正苦于以下问题:Python new_proxy函数的具体用法?Python new_proxy怎么用?Python new_proxy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了new_proxy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: newTiledWindow

def newTiledWindow(name=None, sources = None, ncols = None):
    """Create an empty tiled window.

    Args:
        name: The name to give to the window (if None, a unique name will be generated).

    Returns:
        A handle to the created window.
    """
    if name is None:
        proxy = new_proxy(proxies.TiledWindowProxy, _qti.app.newTiledWindow)
    else:
        proxy = new_proxy(proxies.TiledWindowProxy, _qti.app.newTiledWindow, name)

    if ncols is None:
        ncols = proxy.columnCount()

    if not sources is None:
        row = 0
        col = 0
        for source in sources:
            if isinstance(source, tuple):
                ws = source[0]
                indices = source[1]
                source = plotSpectrum(ws, indices)
            proxy.addWidget(source, row, col)
            col += 1
            if col == ncols:
                col = 0
                row += 1

    return proxy
开发者ID:mducle,项目名称:mantid,代码行数:32,代码来源:__init__.py

示例2: newTiledWindow

def newTiledWindow(name=None):
    """Create an empty tiled window.

    Args:
        name: The name to give to the window (if None, a unique name will be generated).

    Returns:
        A handle to the created window.
    """
    if name is None:
        return new_proxy(proxies.TiledWindowProxy, _qti.app.newTiledWindow)
    else:
        return new_proxy(proxies.TiledWindowProxy, _qti.app.newTiledWindow, name)
开发者ID:stothe2,项目名称:mantid,代码行数:13,代码来源:__init__.py

示例3: newNote

def newNote(name=None):
    """Create a note.

    Args:
        name: The name to give to the note (if None, a unique name will be generated).

    Returns:
        A handle to the created note.
    """
    if name is None:
        return new_proxy(proxies.MDIWindow, _qti.app.newNote)
    else:
        return new_proxy(proxies.MDIWindow, _qti.app.newNote, name)
开发者ID:mducle,项目名称:mantid,代码行数:13,代码来源:__init__.py

示例4: newMatrix

def newMatrix(name=None, rows=32, columns=32):
    """Create a matrix (N.B. This is not the same as a 'MantidMatrix').

    Args:
        name: The name to give to the matrix (if None, a unique name will be generated).
        row: The number of rows in the matrix (default: 32).
        columns: The number of columns in the matrix (default: 32).

    Returns:
        A handle to the created matrix.
    """
    if name is None:
        return new_proxy(proxies.MDIWindow, _qti.app.newMatrix)
    else:
        return new_proxy(proxies.MDIWindow, _qti.app.newMatrix, name, rows, columns)
开发者ID:mducle,项目名称:mantid,代码行数:15,代码来源:__init__.py

示例5: newTable

def newTable(name=None, rows=30, columns=2):
    """Create a table.

    Args:
        name: The name to give to the table (if None, a unique name will be generated).
        row: The number of rows in the table (default: 30).
        columns: The number of columns in the table (default: 2).

    Returns:
        A handle to the created table.
    """
    if name is None:
        return new_proxy(proxies.MDIWindow, _qti.app.newTable)
    else:
        return new_proxy(proxies.MDIWindow, _qti.app.newTable, name, rows, columns)
开发者ID:mducle,项目名称:mantid,代码行数:15,代码来源:__init__.py

示例6: newGraph

def newGraph(name=None, layers=1, rows=1, columns=1):
    """Create a graph window.

    Args:
        name: The name to give to the graph (if None, a unique name will be generated).
        layers: The number of plots (a.k.a. layers) to put in the graph window (default: 1).
        rows: The number of rows of to put in the graph window (default: 1).
        columns: The number of columns of to put in the graph window (default: 1).

    Returns:
        A handle to the created graph widget.
    """
    if name is None:
        return new_proxy(proxies.Graph, _qti.app.newGraph)
    else:
        return new_proxy(proxies.Graph, _qti.app.newGraph, name, layers, rows, columns)
开发者ID:mducle,项目名称:mantid,代码行数:16,代码来源:__init__.py

示例7: table

def table(name):
    """Get a handle on a table.

    Args:
        name: The name of the table.

    Returns:
        A handle to the table.
    """
    return new_proxy(proxies.MDIWindow, _qti.app.table, name)
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:__init__.py

示例8: importImage

def importImage(filename):
    """Load an image file into a matrix.

    Args:
        filename: The name of the file to load.

    Returns:
        A handle to the matrix containing the image data.
    """
    return new_proxy(proxies.MDIWindow, _qti.app.importImage, filename)
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:__init__.py

示例9: note

def note(name):
    """Get a handle on a note.

    Args:
        name: The name of the note.

    Returns:
        A handle to the note.
    """
    return new_proxy(proxies.MDIWindow, _qti.app.note, name)
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:__init__.py

示例10: graph

def graph(name):
    """Get a handle on a graph widget.

    Args:
        name: The name of the graph window.

    Returns:
        A handle to the graph.
    """
    return new_proxy(proxies.Graph, _qti.app.graph, name)
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:__init__.py

示例11: matrix

def matrix(name):
    """Get a handle on a matrix.

    Args:
        name: The name of the matrix.

    Returns:
        A handle to the matrix.
    """
    return new_proxy(proxies.MDIWindow, _qti.app.matrix, name)
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:__init__.py

示例12: importTableWorkspace

def importTableWorkspace(name, visible=False):
    """Create a MantidPlot table from a table workspace.

    Args:
        name: The name of the workspace.
        visible: Whether to initially show the created matrix (default: no).

    Returns:
        A handle to the newly created table.
    """
    return new_proxy(proxies.MDIWindow, _qti.app.mantidUI.importTableWorkspace, name, False, visible)
开发者ID:mducle,项目名称:mantid,代码行数:11,代码来源:__init__.py

示例13: waterfallPlot

def waterfallPlot(table, columns):
    """Create a waterfall plot from data in a table.

    Args:
        table: A reference to the table containing the data to plot
        columns: A tuple of the column numbers whose data to plot

    Returns:
        A handle to the created plot (Layer).
    """
    return new_proxy(proxies.Graph, _qti.app.waterfallPlot, table._getHeldObject(), columns)
开发者ID:mducle,项目名称:mantid,代码行数:11,代码来源:__init__.py

示例14: createDetectorTable

def createDetectorTable(source):
    try:
        import mantidqtpython
    except:
        print("Could not find module mantidqtpython. Cannot open the detector table.")
        return

    workspace_names = getWorkspaceNames(source)

    if len(workspace_names) != 1:
        raise Exception("Please specify only one workspace.")
    else:
        return new_proxy(proxies.MDIWindow, _qti.app.mantidUI.createDetectorTable, workspace_names[0])
开发者ID:mducle,项目名称:mantid,代码行数:13,代码来源:__init__.py

示例15: addFolder

def addFolder(name, parentFolder=None):
    """Create a new folder.

    Args:
        name: The name of the folder to create.
        parentFolder: If given, make the new folder a subfolder of this one.

    Returns:
        A handle to the newly created folder.
    """
    if parentFolder is not None:
        parentFolder = parentFolder._getHeldObject()
    return new_proxy(proxies.Folder, _qti.app.addFolder, name, parentFolder)
开发者ID:mducle,项目名称:mantid,代码行数:13,代码来源:__init__.py


注:本文中的pymantidplot.proxies.new_proxy函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。