mirror of
https://github.com/dekuNukem/USB4VC.git
synced 2025-10-31 11:26:46 -07:00
working on menus
This commit is contained in:
@@ -3,7 +3,14 @@ class usb4vc_level(object):
|
||||
super(usb4vc_level, self).__init__()
|
||||
self.max_pages = 3
|
||||
self.current_page = 0
|
||||
|
||||
def print_welcome_screen(version_tuple):
|
||||
with canvas(device) as draw:
|
||||
oled_print_centered("USB4VC", font_large, 0, draw)
|
||||
oled_print_centered(f"V{version_tuple[0]}.{version_tuple[1]}.{version_tuple[2]} dekuNukem", font_regular, 20, draw)
|
||||
|
||||
def oled_clear():
|
||||
device.clear()
|
||||
|
||||
|
||||
# while 1:
|
||||
# with oled_canvas as ocan:
|
||||
@@ -11,7 +18,9 @@ class usb4vc_level(object):
|
||||
# oled_print_centered(f"{int(time.time())}", font_large, 0, ocan)
|
||||
# time.sleep(1)
|
||||
print(self.current_level, self.current_page)
|
||||
|
||||
# device.contrast(1)
|
||||
# persistent canvas, will need to clear areas before drawing new stuff
|
||||
# oled_canvas = canvas(device)
|
||||
# while 1:
|
||||
# with canvas(device) as draw:
|
||||
# # draw.rectangle(device.bounding_box, outline="white", fill="black")
|
||||
|
||||
@@ -25,15 +25,10 @@ GPIO.setup(PBOARD_RESET_PIN, GPIO.IN)
|
||||
GPIO.setup(PBOARD_DFU_PIN, GPIO.OUT)
|
||||
GPIO.output(PBOARD_DFU_PIN, GPIO.LOW)
|
||||
|
||||
# usb4vc_ui.print_welcome_screen(RPI_APP_VERSION_TUPLE)
|
||||
|
||||
reset_pboard()
|
||||
# usb4vc_usb_scan.set_protocol()
|
||||
usb4vc_usb_scan.get_pboard_info()
|
||||
|
||||
# time.sleep(5)
|
||||
# usb4vc_ui.oled_clear()
|
||||
|
||||
usb4vc_ui.ui_worker.start()
|
||||
usb4vc_usb_scan.usb_device_scan_thread.start()
|
||||
usb4vc_usb_scan.raw_input_event_parser_thread.start()
|
||||
|
||||
@@ -87,25 +87,6 @@ def oled_print_centered(text, font, y, this_canvas):
|
||||
start_x = 0
|
||||
this_canvas.text((start_x, y), text, font=font, fill="white")
|
||||
|
||||
# persistent canvas, will need to clear areas before drawing new stuff
|
||||
# oled_canvas = canvas(device)
|
||||
|
||||
# def print_welcome_screen(version_tuple):
|
||||
# with oled_canvas as ocan:
|
||||
# oled_print_centered("USB4VC", font_large, 0, ocan)
|
||||
# oled_print_centered(f"V{version_tuple[0]}.{version_tuple[1]}.{version_tuple[2]} dekuNukem", font_regular, 20, ocan)
|
||||
# device.contrast(1)
|
||||
|
||||
def oled_clear():
|
||||
device.clear()
|
||||
|
||||
"""
|
||||
(level, page)
|
||||
|
||||
(0, 0)
|
||||
(0, 1)
|
||||
(0, 2)
|
||||
"""
|
||||
|
||||
class usb4vc_menu(object):
|
||||
def __init__(self):
|
||||
@@ -195,7 +176,7 @@ def ui_worker():
|
||||
while 1:
|
||||
time.sleep(0.1)
|
||||
my_menu.update_usb_status();
|
||||
|
||||
|
||||
if GPIO.event_detected(PLUS_BUTTON_PIN):
|
||||
print(time.time(), "PLUS_BUTTON pressed!")
|
||||
my_menu.switch_page(1)
|
||||
|
||||
Reference in New Issue
Block a user