feature/event-customization-2024 #2

Merged
Maxelweb merged 8 commits from feature/event-customization-2024 into master 2024-05-22 23:12:17 +02:00
6 changed files with 28 additions and 21 deletions
Showing only changes of commit 45e4b1951c - Show all commits

View File

@@ -3,7 +3,7 @@ import os
import badger_os import badger_os
from widgets import draw_window, pprint, ptitle, plength, button, draw_ui from widgets import draw_window, pprint, ptitle, plength, button, draw_ui
IMAGE_WIDTH = 96 IMAGE_WIDTH = 86
IMAGE_HEIGHT = 96 IMAGE_HEIGHT = 96
DELTA = 0 DELTA = 0

View File

@@ -1,5 +1,5 @@
Kirill Timofeev Mariano Sciacco
Engineering Team IoT & Cloud Engineer
Census Vimar S.p.A.
oneearedrabbit git.marianosciacco.it
badge.bin badge.bin

BIN
src/images/loghetto.bin Normal file

Binary file not shown.

BIN
src/images/loghetto.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -4,4 +4,5 @@ Mariano Sciacco
* Vimar S.p.A. * Vimar S.p.A.
* (AWS Summit 2024) * (AWS Summit 2024)
If Youre Scanning This, Its Too Late! If You Are Scanning This,
It Is Too Late!

View File

@@ -193,17 +193,22 @@ def draw_menu(display, selected):
display.pen(0) display.pen(0)
display.thickness(1) display.thickness(1)
x = 12 loghetto = bytearray(int(16 * 18 / 8))
y = 6 open("images/{}".format("loghetto.bin"), "r").readinto(loghetto)
display.line(x + 2, y, x + 8, y) display.image(loghetto, 16, 18, 10, 2)
display.line(x + 6, y + 1, x + 9, y + 1)
display.line(x + 1, y + 2, x + 10, y + 2) # old logo
display.line(x + 5, y + 3, x + 10, y + 3) # x = 12
display.line(x, y + 4, x + 10, y + 4) # y = 6
display.line(x + 5, y + 5, x + 10, y + 5) # display.line(x + 2, y, x + 8, y)
display.line(x + 1, y + 6, x + 10, y + 6) # display.line(x + 6, y + 1, x + 9, y + 1)
display.line(x + 6, y + 7, x + 9, y + 7) # display.line(x + 1, y + 2, x + 10, y + 2)
display.line(x + 2, y + 8, x + 8, y + 8) # display.line(x + 5, y + 3, x + 10, y + 3)
# display.line(x, y + 4, x + 10, y + 4)
# display.line(x + 5, y + 5, x + 10, y + 5)
# display.line(x + 1, y + 6, x + 10, y + 6)
# display.line(x + 6, y + 7, x + 9, y + 7)
# display.line(x + 2, y + 8, x + 8, y + 8)
x = 40 x = 40
pprint(display, menu, x, 6, 0) pprint(display, menu, x, 6, 0)
@@ -226,10 +231,11 @@ def draw_border(display):
display.line(1, 1, 1, 127) display.line(1, 1, 1, 127)
display.line(1, 127, 295, 127) display.line(1, 127, 295, 127)
display.line(295, 1, 295, 127) display.line(295, 1, 295, 127)
display.image(bytearray((0xff, 0xff, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0xc0)), 2, 2, 0, 0)
display.image(bytearray((0xff, 0xff, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0xc0)), 8, 8, 0, 0)
display.image(bytearray((0xff, 0xff, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x03)), 8, 8, 288, 0) display.image(bytearray((0xff, 0xff, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x03)), 8, 8, 288, 0)
display.image(bytearray((0x03, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0xff, 0xff)), 8, 8, 288, 120) display.image(bytearray((0x03, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0xff, 0xff)), 8, 8, 288, 120)
display.image(bytearray((0xc0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xff, 0xff)), 2, 2, 0, 120) display.image(bytearray((0xc0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xff, 0xff)), 8, 8, 0, 120)
def map_value(input, in_min, in_max, out_min, out_max): def map_value(input, in_min, in_max, out_min, out_max):
return (((input - in_min) * (out_max - out_min)) / (in_max - in_min)) + out_min return (((input - in_min) * (out_max - out_min)) / (in_max - in_min)) + out_min