Skip to content

Commit

Permalink
Added init image #19
Browse files Browse the repository at this point in the history
  • Loading branch information
pskowronek committed Oct 7, 2023
1 parent 8f6ae54 commit 54181a6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ def draw_eta(self, idx, black_buf, red_buf, gmaps, warn_above_percent, black_on_
self.draw_text_eta(start_pos[0], start_pos[1], caption, 70, draw, 255)


def draw_starting(self, is_mono):
black_buf = Image.new('1', (self.CANVAS_WIDTH, self.CANVAS_HEIGHT), 1)
red_buf = black_buf if (is_mono) else Image.new('1', (self.CANVAS_WIDTH, self.CANVAS_HEIGHT), 1)
shutdown_icon = Image.open("./resources/images/starting.bmp")
red_buf.paste(shutdown_icon, (0, 0))
return black_buf, red_buf


def draw_shutdown(self, is_mono):
black_buf = Image.new('1', (self.CANVAS_WIDTH, self.CANVAS_HEIGHT), 1)
red_buf = black_buf if (is_mono) else Image.new('1', (self.CANVAS_WIDTH, self.CANVAS_HEIGHT), 1)
Expand Down
5 changes: 5 additions & 0 deletions epaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ def display_buffer(self, black_buf, red_buf, dt):
self.display(black_buf, red_buf, dt)


def display_starting(self):
black_frame, red_frame = self.drawing.draw_starting(self.MONO_DISPLAY)
self.display_buffer(black_frame, red_frame, 'starting')


def display_shutdown(self):
black_frame, red_frame = self.drawing.draw_shutdown(self.MONO_DISPLAY)
self.display_buffer(black_frame, red_frame, 'shutdown')
Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def main():
notifier = sdnotify.SystemdNotifier()
notifier.notify("READY=1")

epaper.display_starting()

while True:
if shutting_down:
logging.info("App is shutting down.....")
Expand Down
10 changes: 7 additions & 3 deletions resources/images/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
back_eta_0.bmp - car icon in-there taken from: https://icons8.com/icon/245/car
back_eta_0.bmp - car icon taken from: https://icons8.com/icon/245/car

back_eta_1.bmp - car icon taken from: https://icons8.com/icon/245/car

shutdown.bmp - shutdown icon taken from: https://iconsplace.com/black-icons/shutdown-icon

starting.bmp - starting icon taken from: https://www.onlinewebfonts.com/icon/513577, licensed by CC BY 4.0

back_eta_1.bmp - car icon in-there taken from: https://icons8.com/icon/245/car

shutdown.bmp - shutdown icon in-there taken taken from: https://iconsplace.com/black-icons/shutdown-icon
Binary file added resources/images/starting.bmp
Binary file not shown.

0 comments on commit 54181a6

Please sign in to comment.