• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python application.TaurusApplication类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TaurusPanelMain

def TaurusPanelMain():
    '''A launcher for TaurusPanel.'''
    # NOTE: DON'T PUT TEST CODE HERE.
    # THIS IS CALLED FROM THE LAUNCHER SCRIPT (<taurus>/scripts/tauruspanel)
    from taurus.qt.qtgui.application import TaurusApplication
    from taurus.core.util import argparse
    import sys

    parser = argparse.get_taurus_parser()
    parser.set_usage("%prog [options] [devname]")
    parser.set_description("Taurus Application inspired in Jive and Atk Panel")

    app = TaurusApplication(cmd_line_parser=parser, app_name="tauruspanel",
                            app_version=taurus.Release.version)
    args = app.get_command_line_args()
    options = app.get_command_line_options()

    w = TaurusDevPanel()

    if options.tango_host is None:
        options.tango_host = taurus.Authority().getNormalName()
    w.setTangoHost(options.tango_host)

    if len(args) == 1:
        w.setDevice(args[0])

    w.show()

    sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:29,代码来源:taurusdevicepanel.py


示例2: launcherButtonMain

def launcherButtonMain():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()

    # Creating button giving the widget
    # from taurus.qt.qtgui.plot import TaurusPlot
    # w = TaurusPlot()
    # form = TaurusLauncherButton(parent=None, designMode=False, widget=w,
    #                             icon='logos:taurus.png'), text='show')

    # Creating button giving the widget class name
    # form = TaurusLauncherButton(parent=None, designMode=False,
    #                             widget='TaurusPlot', icon='logos:taurus.png',
    #                             text='show')

    # Creating button using a derived class with the name widget class
    # hardcoded
    class MyButton(TaurusLauncherButton):
        _widgetClassName = 'TaurusPlot'
        _icon = 'logos:taurus.png'
        _text = 'show'
    form = MyButton()

    form.setModel('sys/tg_test/1/wave')
    form.show()
    sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:28,代码来源:taurusbutton.py


示例3: demo3

def demo3():
    '''simple demo including more than one widget'''

    import sys
    from taurus.qt.qtgui.application import TaurusApplication
    from taurus.qt.qtgui.display import TaurusLabel, TaurusLed
    from taurus.qt.qtgui.input import TaurusValueLineEdit, TaurusValueCheckBox

    app = TaurusApplication()

    w1 = TaurusReadWriteSwitcher(readWClass=TaurusLabel,
                                 writeWClass=TaurusValueLineEdit)
    w1.model = "sys/tg_test/1/long_scalar"

    w2 = TaurusReadWriteSwitcher(readWClass=TaurusLed,
                                 writeWClass=TaurusValueCheckBox)
    w2.model = "sys/tg_test/1/boolean_scalar"

    f = Qt.QWidget()
    f.setLayout(Qt.QVBoxLayout())
    f.layout().addWidget(w1)
    f.layout().addWidget(w2)
    f.layout().addWidget(TaurusReadWriteSwitcher())  # add non-initialized switcher
    f.show()

    sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:26,代码来源:abstractswitcher.py


示例4: taurusTrendMain

def taurusTrendMain():
    from taurus.qt.qtgui.extra_guiqwt.builder import make
    from taurus.qt.qtgui.application import TaurusApplication
    from guiqwt.plot import CurveDialog
    from guiqwt.tools import HRangeTool
    import taurus.core.util.argparse
    import sys

    parser = taurus.core.util.argparse.get_taurus_parser()
    parser.set_usage("%prog [options] [<model1> [<model2>] ...]")
    parser.set_description("a taurus application for plotting 1D data sets")
    parser.add_option("-x", "--x-axis-mode", dest="x_axis_mode", default='d', metavar="t|d|e",
                      help="interpret X values as timestamps (t), time deltas (d) or event numbers (e). Accepted values: t|d|e")
    parser.add_option("-b", "--buffer", dest="max_buffer_size", default='16384',
                      help="maximum number of values to be plotted (when reached, the oldest values will be discarded)")
    parser.add_option("-a", "--use-archiving",
                      action="store_true", dest="use_archiving", default=False)
    parser.add_option("--demo", action="store_true", dest="demo",
                      default=False, help="show a demo of the widget")
    app = TaurusApplication(
        cmd_line_parser=parser, app_name="taurusplot2", app_version=taurus.Release.version)
    args = app.get_command_line_args()
    options = app.get_command_line_options()

    # check & process options
    stackModeMap = dict(t='datetime', d='deltatime', e='event')
    if options.x_axis_mode.lower() not in stackModeMap:
        parser.print_help(sys.stderr)
        sys.exit(1)

    stackMode = stackModeMap[options.x_axis_mode.lower()]

    if options.demo:
        args.append('eval:rand()')

    w = CurveDialog(edit=False, toolbar=True, wintitle="Taurus Trend")

    # set archiving
    if options.use_archiving:
        raise NotImplementedError('Archiving support is not yet implemented')
        w.setUseArchiving(True)

    w.add_tool(HRangeTool)
    # w.add_tool(TaurusCurveChooserTool)
    # w.add_tool(TimeAxisTool)

    if len(args) == 0:
        parser.print_help(sys.stderr)
        sys.exit(1)

    plot = w.get_plot()
    for a in args:
        item = TaurusTrendItem(stackMode=stackMode,
                               buffersize=int(options.max_buffer_size))
        plot.add_item(item)
        item.setModel(a)

    w.show()
    sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:59,代码来源:curve.py


示例5: main

def main():
    """launcher of QIconCatalog"""
    import sys
    from taurus import Release
    app = TaurusApplication(app_version=Release.version)
    w = QIconCatalog()
    w.setWindowTitle('Taurus Icon Catalog')
    w.show()
    sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:9,代码来源:catalog.py


示例6: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    # model = ''
    panel = BaseLLRFWidget()
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:10,代码来源:basellrfwidget.py


示例7: main

def main():
    app = TaurusApplication()
    motors_list = ['motor/motctrl01/1',
                   'motor/motctrl01/2',
                   'motor/motctrl01/3',
                   'motor/motctrl01/4']
    main_window = UiMainWindow(motors_list)
    main_window.setWindowTitle('OperatorGUI')
    main_window.show()
    sys.exit(app.exec_())
开发者ID:LJBD,项目名称:studies-scada-tango-sardana-showcase,代码行数:10,代码来源:operator_gui.py


示例8: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = "ws/rf/pynutaq_1"
    panel = PolarDiag()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:polardiag.py


示例9: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = ['ws/rf/llrf-1', 'ws/rf/llrfdiags_1']
    panel = LlrfSimple()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:llrfsimple.py


示例10: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = 'ws/rf/pynutaq_1'
    panel = AutoTuningSimple()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:autotuningsimple.py


示例11: create_application

def create_application(name, parser):
    """
    Create the application and return an (application, taurusgui) tuple.

    :return: Tuple compose by a TaurusApplication and a TaurusGUI
    :rtype: tuple
    """
    app = TaurusApplication(app_name=name, cmd_line_parser=parser)
    app.setOrganizationName(ORGANIZATION)
    gui = TaurusGui()
    return app, gui
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:main.py


示例12: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = 'ws/rf/pynutaq_1'
    panel = IqLoopsSettings()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:iqloopssettings.py


示例13: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = 'ws/rf/pynutaqdiags_1'
    panel = Landau()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:landau.py


示例14: main

def main():
    from taurus.qt.qtgui.application import TaurusApplication
    app = TaurusApplication()

    w = build_gui()
    tree = TreeQObjectWidget(qobject_root=w)
    tree.show()
    #import pprint
    # pprint.pprint(get_qobject_tree_str())
    w.dumpObjectTree()
    app.exec_()
开发者ID:cmft,项目名称:taurus,代码行数:11,代码来源:tauruswidgettree.py


示例15: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = ['ws/rf/pynutaq_1', 'ws/rf/pynutaqdiags_1']
    panel = FpgaVersion()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:fpgaversion.py


示例16: main

def main():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication

    app = TaurusApplication()
    model = 'ws/rf/llrfdiags_1'
    panel = ItckOutDiagSimple()
    panel.setModel(model)
    panel.show()

    sys.exit(app.exec_())
开发者ID:amilan,项目名称:app-maxiv-llrfexpert,代码行数:11,代码来源:itckoutdiagsimple.py


示例17: _test2

def _test2():
    import sys
    from taurus.qt.qtgui.application import TaurusApplication
    from taurus.qt.qtgui.display import TaurusLabel
    app = TaurusApplication()

    tl = TaurusLabel()
    tl.setModel(ATTR_IPAP_POS)
    tl.show()

    sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:11,代码来源:ipap_example.py


示例18: _taurusAttrListTest

def _taurusAttrListTest():
    """tests taurusAttrList. Model: an attribute containing a list of strings"""
    from taurus.qt.qtgui.application import TaurusApplication
    a = TaurusApplication()
    # model = sys.argv[1]
    # model = "eval:['foo','bar']"
    model = "sys/tg_test/1/string_spectrum"
    w = TaurusAttrListComboBox()
    w.setModel(model)
    w.show()
    return a.exec_()
开发者ID:cmft,项目名称:taurus,代码行数:11,代码来源:tauruscombobox.py


示例19: main

def main():

    parser = OptionParser("usage: %prog [options] SVGFILE")
    parser.add_option("-s", "--size", dest="size",
                      help="Window size on form WIDTH,HEIGHT", metavar="WINSIZE")
    parser.add_option("-t", "--title", dest="title",
                      help="Window title", metavar="WINTITLE")
    parser.add_option("-z", "--zoomsteps", dest="zoomsteps", metavar="ZOOMSTEPS",
                      help="Zoom levels, on form ZOOM1,ZOOM2,...", default="1")

    app = TaurusApplication(cmd_line_parser=parser)

    args = app.get_command_line_args()
    if len(args) != 1:
        sys.exit("You need to specify the SVG file to load!")
    svg = args[0]
    options = app.get_command_line_options()

    widget = TaurusSynopticWidget()

    # We'd like the synoptic to "select" the relevant item when
    # the user focuses on a panel. Let's connect a handler to
    # the focusChanged signal that does this.
    def onfocus(old, new):
        if new and hasattr(new, "window"):
            for device, panel in widget._panels.items():
                if panel == new.window():
                    widget.select("model", [device])
    app.focusChanged.connect(onfocus)

    # need absolute path to the SVG file
    svgfile = os.path.abspath(svg)

    # since the svg currently needs to be hardcoded in the HTML, we
    # create a temporary HTML file from a static template.
    path = os.path.dirname(__file__)
    template = os.path.join(path, "web", "template.html")
    with open(template) as f:
        tmpl = Template(f.read())
    zoomsteps = [int(z) for z in options.zoomsteps.split(",")]
    config = {"view": {"zoomSteps": zoomsteps}}
    html = tmpl.substitute(path="/web", svgfile=svgfile, config=json.dumps(config))
    with NamedTemporaryFile(suffix=".html") as tf:
        tf.write(html)
        tf.flush()
        widget.setModel(tf.name)
        if options.size:
            w, h = options.size.split(",")
            widget.resize(int(w), int(h))

        widget.setWindowTitle(options.title or os.path.basename(svg))
        widget.show()
        app.exec_()
开发者ID:MaxIV-KitsControls,项目名称:lib-maxiv-svgsynoptic,代码行数:53,代码来源:__main__.py


示例20: taurusImageMain

def taurusImageMain():
    from guiqwt.tools import (RectangleTool, EllipseTool, HRangeTool, PlaceAxesTool,
                              MultiLineTool, FreeFormTool, SegmentTool, CircleTool,
                              AnnotatedRectangleTool, AnnotatedEllipseTool,
                              AnnotatedSegmentTool, AnnotatedCircleTool, LabelTool,
                              AnnotatedPointTool, ObliqueRectangleTool,
                              AnnotatedObliqueRectangleTool)
    try:  # In newer guiqwt versions, Annotated*CursorTool have been replaced by *CursorTool
        from guiqwt.tools import AnnotatedVCursorTool, AnnotatedHCursorTool
        VCursorTool, HCursorTool = AnnotatedVCursorTool, AnnotatedHCursorTool
    except ImportError:
        from guiqwt.tools import VCursorTool, HCursorTool

    from taurus.qt.qtgui.extra_guiqwt.tools import TaurusImageChooserTool
    from guiqwt.plot import ImageDialog
    from taurus.qt.qtgui.extra_guiqwt.builder import make
    from taurus.qt.qtgui.application import TaurusApplication
    import taurus.core.util.argparse
    import sys

    parser = taurus.core.util.argparse.get_taurus_parser()
    parser.set_usage("%prog [options] [<model1> [<model2>] ...]")
    parser.set_description("a taurus application for plotting 2D data sets")
    app = TaurusApplication(
        cmd_line_parser=parser, app_name="taurusimage", app_version=taurus.Release.version)
    args = app.get_command_line_args()

    # create a dialog with a plot and add the images
    win = ImageDialog(edit=False, toolbar=True, wintitle="Taurus Image",
                      options=dict(show_xsection=False, show_ysection=False))

    # add tools
    for toolklass in (TaurusImageChooserTool,
                      LabelTool, HRangeTool,
                      MultiLineTool, FreeFormTool, PlaceAxesTool,
                      AnnotatedObliqueRectangleTool,
                      AnnotatedEllipseTool, AnnotatedSegmentTool,
                      AnnotatedPointTool, VCursorTool,
                      HCursorTool):
        win.add_tool(toolklass)

    # add images from given models
    plot = win.get_plot()
    for m in args:
        img = make.image(taurusmodel=m)
        plot.add_item(img)
        # IMPORTANT: connect the cross section plots to the taurusimage so that
        # they are updated when the taurus data changes
        img.dataChanged.connect(win.update_cross_sections)

    win.exec_()
开发者ID:cmft,项目名称:taurus,代码行数:51,代码来源:image.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python container.TaurusWidget类代码示例发布时间:2022-05-27
下一篇:
Python collectorsdb.engineFactory函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap