def update(self, obj, value, delay=UPDATE_DELAY):
"""
To prevent overuse of update_map, each change of position triggers an update of the map after UPDATE_DELAY sec.
For instance, the position of the reticule has to be updated.
"""
if self.map is None:
return
# Pause the Loader, to prevent ui blocking
Loader.pause()
# Reposition widgets that need to be repositioned
self.reposition_executor.execute()
# Trigger the map update
if self.idle:
self.idle = False
else:
Clock.unschedule(self.update_map)
Clock.schedule_once(self.update_map, delay)
# Resume the Loader after a short time
Clock.schedule_once(MapViewer.resume_loading, 0.1)
评论列表
文章目录