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


Python TaurusApplication.exec_方法代码示例

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


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

示例1: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:13,代码来源:tauruswidgettree.py

示例2: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:55,代码来源:__main__.py

示例3: TaurusPanelMain

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:31,代码来源:taurusdevicepanel.py

示例4: demo3

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:28,代码来源:abstractswitcher.py

示例5: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
def main():
    from taurus.core.util import argparse
    from taurus.qt.qtgui.application import TaurusApplication

    parser = argparse.get_taurus_parser()
    parser.set_usage("%prog [options]")
    parser.set_description("Sardana macro sequencer.\n"
                           "It allows the creation of sequences of "
                           "macros, executed one after the other.\n"
                           "The sequences can be stored under xml files")
    parser.add_option("-f", "--file",
                      dest="file", default=None,
                      help="load an xml macro sequence file")

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

    app.setOrganizationName(globals.ORGANIZATION_NAME)
    app.setApplicationName(globals.SEQUENCER_APPLICATION_NAME)
    sequencer = createSequencer(args, options)
    sequencer.show()
    sys.exit(app.exec_())
开发者ID:rhomspuron,项目名称:sardana,代码行数:27,代码来源:sequenceeditor.py

示例6: launcherButtonMain

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:30,代码来源:taurusbutton.py

示例7: taurusTrendMain

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:61,代码来源:curve.py

示例8: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
def main():
    from taurus.qt.qtgui.application import TaurusApplication
    
    app = TaurusApplication([])
    
    @UILoadable(with_ui="ui")
    class A(Qt.QWidget):

        def __init__(self, parent=None):
            Qt.QWidget.__init__(self, parent)
            import taurus.qt.qtgui.panel.ui
            path = os.path.dirname(taurus.qt.qtgui.panel.ui.__file__)
            self.loadUi(filename='TaurusMessagePanel.ui', path=path)
    
    gui = A()
    gui.show()
    app.exec_()
开发者ID:christophsahle,项目名称:XRStools,代码行数:19,代码来源:ui.py

示例9: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:11,代码来源:catalog.py

示例10: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:12,代码来源:operator_gui.py

示例11: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:12,代码来源:basellrfwidget.py

示例12: _taurusAttrListTest

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:13,代码来源:tauruscombobox.py

示例13: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:13,代码来源:iqloopssettings.py

示例14: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:13,代码来源:landau.py

示例15: main

# 需要导入模块: from taurus.qt.qtgui.application import TaurusApplication [as 别名]
# 或者: from taurus.qt.qtgui.application.TaurusApplication import exec_ [as 别名]
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,代码行数:13,代码来源:fpgaversion.py


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