def _set_clock_font(self): log_fw.debug( f"Setting font {config.FONTS[self.font_index][0]} x{config.FONTS[self.font_index][1]}" ) try: self.font = ImageFont.truetype( f"./fonts/{config.FONTS[self.font_index][0]}", floor(config.CLOCK_FONT_SIZE * config.FONTS[self.font_index][1])) except OSError as err: log_fw.exception( f"Error while opening font: {err.filename}, {err.filename2}: {err.strerror} {err.errno}" )
def __init__(self): log_fw.debug("Initializing") display.OledDisplay.__init__(self) clock_view = ClockView(display=self) moving_ball = MovingBall(display=self) rico_ball = RicoBall(display=self) rico_ball.set_right(clock_view) clock_view.set_left(rico_ball) clock_view.set_right(moving_ball) moving_ball.set_left(clock_view) moving_ball.set_right(rico_ball) self.vm.set_root_view(rico_ball) # TODO: Invoke the current view's initialize self.vm.paint() log_fw.debug("Issued initial paint")
def on_sched_event(self): log_fw.debug("View::on_sched_event()")
def on_sched_event(self): log_fw.debug("ClockView::on_sched_event()") clock_text = self._clock_text() if clock_text != self.last_clock_text: self.paint()
def on_sched_event(self): log_fw.debug("MovingBall::on_sched_event()") self.paint()
def on_sched_event(self): log_fw.debug("DiagnosticLine::on_sched_event()") self.paint()
def on_sched_event(self): log_fw.debug("RicoBall::on_sched_event()") self._move_ball() self.paint()
def on_sched_event(self): log_fw.debug("TextView::on_sched_event()") self.paint()