本文整理汇总了Python中kivy.properties.Clock.schedule_interval方法的典型用法代码示例。如果您正苦于以下问题:Python Clock.schedule_interval方法的具体用法?Python Clock.schedule_interval怎么用?Python Clock.schedule_interval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.properties.Clock
的用法示例。
在下文中一共展示了Clock.schedule_interval方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def build(self):
self.plot.points = [(point[0], point[1]) for point in
self.user.userECG.ecgListFFT]
# self.plot.points = [(x, sin(x / 100.)) for x in range(self.counter,
# self.counter + 10)]
self.graph.add_plot(self.plot)
Clock.schedule_interval(self.update, 1.0 / 60.0)
return self.graph
示例2: __init__
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def __init__(self, **kwargs):
super(NewsWidget, self).__init__(**kwargs)
self.app = App.get_running_app()
app_config = self.app.config
provider = app_config.get('news', 'provider')
news_module = imp.load_source(provider, os.path.join(PROJECT_PATH, 'libs', "news", "%s.py" % provider))
self.news_provider = news_module.News()
Clock.schedule_interval(self.update_news, 600)
Clock.schedule_interval(self.rotate_news, app_config.getint('news', 'cycle_interval'))
self.update_news()
self.key_handler = self.app.key_handler
self.key_handler.bind('down', lambda *args: self.rotate_news(direction='next', manual=True))
self.key_handler.bind('up', lambda *args: self.rotate_news(direction='prev', manual=True))
示例3: __init__
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def __init__(self, **kw):
super().__init__(**kw)
self.playlist = StaticPlaylist([
])
self.__cached_playlist = list(self.playlist)
self.load_audio()
def update_position(_):
if self.sound and self.sound.state == 'play':
self.last_sound_position = self.sound.get_pos()
Clock.schedule_interval(update_position, 1.5)
示例4: on_start
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def on_start(self):
ble_central.init()
ble_peripheral.init()
ble_central.set_callbacks(on_state=self.central_state_changed,
on_discover=self.discover)
ble_peripheral.set_callbacks(on_state=self.peripheral_state_changed,
on_service_added=self.peripheral_service_added,
on_service_error=self.peripheral_service_error,
on_advertising_started=self.peripheral_adv,
on_advertising_error=self.peripheral_adv,
on_characteristic_subscribed=self.char_sub,
on_characteristic_write=self.char_write)
self.scanning = ble_central.is_scanning
Clock.schedule_interval(self.update_list, 0.5)
示例5: __init__
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def __init__(self, **kwargs):
super(ZbarQrcodeDetector, self).__init__(**kwargs)
# my code
#
self.add_widget(self.labell)
def Course_thread(dt):
self.labell.text = "24923849"
self._examplefunc()
print "r"
#self.examplefunc("rrrr")
#self._send_request_dzyk(
# 'bal_sum/', params=None,
# success=self._get_commands_result_dzyk_balance_allsum, error=self._get_commands_error_dzyk)
Clock.schedule_interval(Course_thread, 1)
# ID of the command being executed
self._cmd_id = None
# List of the "completed" statuses.
# The first status should be "Done"
self._completed = []
# If True - sends a request to retrieve a command status
self._wait_completion = False
# requested command
self._command = (0, '')
#----------------------------------
self._camera = AndroidCamera(
size=self.camera_size,
size_hint=(None, None))
self._camera.bind(on_preview_frame=self._detect_qrcode_frame)
self.add_widget(self._camera)
# create a scanner used for detecting qrcode
self._scanner = ImageScanner()
self._scanner.setConfig(0, Config.ENABLE, 0)
self._scanner.setConfig(Symbol.QRCODE, Config.ENABLE, 1)
self._scanner.setConfig(0, Config.X_DENSITY, 3)
self._scanner.setConfig(0, Config.Y_DENSITY, 3)
示例6: start
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def start(self):
'''Start the label updating in a separated thread
'''
Clock.schedule_interval(self.update_text, 0.2)
示例7: callback
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def callback(self, dt):
self.manager.current = 'board1'
self.popup1.open()
self.current = 0
Clock.schedule_interval(self.my_callback, 1.0)
示例8: on_start
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def on_start(self):
Clock.schedule_interval(self.update, 0)
示例9: __init__
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def __init__(self, *args, **kwargs):
super(Game, self).__init__(**kwargs)
print('game init hit')
Clock.schedule_interval(self.set_fps, .2)
示例10: build
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def build(self):
gra = GraPong()
gra.serw_pilki()
Clock.schedule_interval(gra.odswiez, 1.0/60.0)
return gra
示例11: __init__
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def __init__(self, **kwargs):
super(RefTreeWidget, self).__init__(**kwargs)
# update_tree will be call each 4 seconds
# FIXME The line below has to be uncommented after fixing the reference duplication BUG!
Clock.schedule_interval(self.update_ref, 20)
示例12: on_enter
# 需要导入模块: from kivy.properties import Clock [as 别名]
# 或者: from kivy.properties.Clock import schedule_interval [as 别名]
def on_enter(self, *args):
self.animation_scheduler = Clock.schedule_interval(self.saver.update, 1.0 / 30.0)