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


Python app.Timer方法代码示例

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


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

示例1: __init__

# 需要导入模块: from vispy import app [as 别名]
# 或者: from vispy.app import Timer [as 别名]
def __init__(self, setup_method, draw_method,
                 handlers=dict(), frame_rate=60):
        app.Canvas.__init__(
            self,
            title=builtins.title,
            size=(builtins.width, builtins.height),
            keys='interactive',
            resizable=True,
        )

        self.setup_method = setup_method
        self.draw_method = draw_method

        self.looping = None
        self.redraw = None
        self.setup_done = False
        self.timer = app.Timer(1.0 / frame_rate, connect=self.on_timer)

        self.handlers = dict()
        for handler_name in handler_names:
            self.handlers[handler_name] = handlers.get(handler_name, _dummy)

        self.handler_queue = []

        self._save_fname = 'screen'
        self._save_fname_num = 0
        self._save_flag = False

        p5.renderer.initialize_renderer()
        p5.renderer.clear() 
开发者ID:p5py,项目名称:p5,代码行数:32,代码来源:base.py

示例2: ensure_timer

# 需要导入模块: from vispy import app [as 别名]
# 或者: from vispy.app import Timer [as 别名]
def ensure_timer(self):
        if not self._timer:
            self._timer = app.Timer('auto' if self._ffmpeg_pipe else self._interval,
                                    connect=self.on_timer,
                                    start=True) 
开发者ID:alexjc,项目名称:shadertoy-render,代码行数:7,代码来源:shadertoy-render.py

示例3: __init__

# 需要导入模块: from vispy import app [as 别名]
# 或者: from vispy.app import Timer [as 别名]
def __init__(self, viewer):
        super(RecordTool, self).__init__(viewer=viewer)
        self.record_timer = app.Timer(connect=self.record)
        self.writer = None
        self.next_action = 'start' 
开发者ID:glue-viz,项目名称:glue-vispy-viewers,代码行数:7,代码来源:tools.py

示例4: activate

# 需要导入模块: from vispy import app [as 别名]
# 或者: from vispy.app import Timer [as 别名]
def activate(self):
        if self.timer is None:
            self.timer = app.Timer(connect=self.rotate)
        self.timer.start(0.1) 
开发者ID:glue-viz,项目名称:glue-vispy-viewers,代码行数:6,代码来源:tools.py

示例5: __init__

# 需要导入模块: from vispy import app [as 别名]
# 或者: from vispy.app import Timer [as 别名]
def __init__(
            self, *,
            image_acquirer=None,
            width=640, height=480,
            display_rate=30.,
            background_color='gray',
            vsync=True
    ):
        """
        As far as we know, Vispy refreshes the canvas every 1/30 sec at the
        fastest no matter which faster number is specified. If we set any
        value which is greater than 30, then Vispy's callback is randomly
        called.
        """

        #
        app.Canvas.__init__(
            self, size=(width, height), vsync=vsync, autoswap=True
        )

        #
        self._ia = image_acquirer

        #
        self._background_color = background_color
        self._has_filled_texture = False
        self._width, self._height = width, height

        #
        self._is_dragging = False

        # If it's True, the canvas keeps image acquisition but do not
        # draw images on the canvas:
        self._pause_drawing = False

        #
        self._origin = [0, 0]

        #
        self._display_rate = display_rate
        self._timer = app.Timer(
            1. / self._display_rate, connect=self.update, start=True
        )

        #
        self._buffers = [] 
开发者ID:genicam,项目名称:harvesters_gui,代码行数:48,代码来源:canvas.py


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