Exemplo n.º 1
0
 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}"
         )
Exemplo n.º 2
0
    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")
Exemplo n.º 3
0
 def on_sched_event(self):
     log_fw.debug("View::on_sched_event()")
Exemplo n.º 4
0
 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()
Exemplo n.º 5
0
 def on_sched_event(self):
     log_fw.debug("MovingBall::on_sched_event()")
     self.paint()
Exemplo n.º 6
0
 def on_sched_event(self):
     log_fw.debug("DiagnosticLine::on_sched_event()")
     self.paint()
Exemplo n.º 7
0
 def on_sched_event(self):
     log_fw.debug("RicoBall::on_sched_event()")
     self._move_ball()
     self.paint()
Exemplo n.º 8
0
 def on_sched_event(self):
     log_fw.debug("TextView::on_sched_event()")
     self.paint()