|
|
|
@ -80,16 +80,16 @@ class Setup(Widget): |
|
|
|
|
self.checkmark = gui_app.texture("icons/circled_check.png", 100, 100) |
|
|
|
|
|
|
|
|
|
self._low_voltage_title_label = Label("WARNING: Low Voltage", TITLE_FONT_SIZE, FontWeight.MEDIUM, rl.GuiTextAlignment.TEXT_ALIGN_LEFT, |
|
|
|
|
text_color=rl.Color(255, 89, 79, 255)) |
|
|
|
|
text_color=rl.Color(255, 89, 79, 255), text_padding=20) |
|
|
|
|
self._low_voltage_body_label = Label("Power your device in a car with a harness or proceed at your own risk.", BODY_FONT_SIZE, |
|
|
|
|
text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
self._low_voltage_continue_button = Button("Continue", self._low_voltage_continue_button_callback) |
|
|
|
|
self._low_voltage_poweroff_button = Button("Power Off", HARDWARE.shutdown) |
|
|
|
|
|
|
|
|
|
self._getting_started_button = Button("", self._getting_started_button_callback, button_style=ButtonStyle.PRIMARY, border_radius=0) |
|
|
|
|
self._getting_started_title_label = Label("Getting Started", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
self._getting_started_title_label = Label("Getting Started", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
self._getting_started_body_label = Label("Before we get on the road, let's finish installation and cover some details.", |
|
|
|
|
BODY_FONT_SIZE, text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
BODY_FONT_SIZE, text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
|
|
|
|
|
self._software_selection_openpilot_button = ButtonRadio("openpilot", self.checkmark, font_size=BODY_FONT_SIZE, text_padding=80) |
|
|
|
|
self._software_selection_custom_software_button = ButtonRadio("Custom Software", self.checkmark, font_size=BODY_FONT_SIZE, text_padding=80) |
|
|
|
@ -97,19 +97,20 @@ class Setup(Widget): |
|
|
|
|
button_style=ButtonStyle.PRIMARY) |
|
|
|
|
self._software_selection_continue_button.set_enabled(False) |
|
|
|
|
self._software_selection_back_button = Button("Back", self._software_selection_back_button_callback) |
|
|
|
|
self._software_selection_title_label = Label("Choose Software to Use", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
self._software_selection_title_label = Label("Choose Software to Use", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT, |
|
|
|
|
text_padding=20) |
|
|
|
|
|
|
|
|
|
self._download_failed_reboot_button = Button("Reboot device", HARDWARE.reboot) |
|
|
|
|
self._download_failed_startover_button = Button("Start over", self._download_failed_startover_button_callback, button_style=ButtonStyle.PRIMARY) |
|
|
|
|
self._download_failed_title_label = Label("Download Failed", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
self._download_failed_url_label = Label("", 52, FontWeight.NORMAL, rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
self._download_failed_body_label = Label("", BODY_FONT_SIZE, text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
self._download_failed_title_label = Label("Download Failed", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
self._download_failed_url_label = Label("", 52, FontWeight.NORMAL, rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
self._download_failed_body_label = Label("", BODY_FONT_SIZE, text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
|
|
|
|
|
self._network_setup_back_button = Button("Back", self._network_setup_back_button_callback) |
|
|
|
|
self._network_setup_continue_button = Button("Waiting for internet", self._network_setup_continue_button_callback, |
|
|
|
|
button_style=ButtonStyle.PRIMARY) |
|
|
|
|
self._network_setup_continue_button.set_enabled(False) |
|
|
|
|
self._network_setup_title_label = Label("Connect to Wi-Fi", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT) |
|
|
|
|
self._network_setup_title_label = Label("Connect to Wi-Fi", TITLE_FONT_SIZE, FontWeight.BOLD, rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=20) |
|
|
|
|
|
|
|
|
|
self._custom_software_warning_continue_button = Button("Scroll to continue", self._custom_software_warning_continue_button_callback, |
|
|
|
|
button_style=ButtonStyle.PRIMARY) |
|
|
|
@ -127,7 +128,7 @@ class Setup(Widget): |
|
|
|
|
68, text_alignment=rl.GuiTextAlignment.TEXT_ALIGN_LEFT, text_padding=60) |
|
|
|
|
self._custom_software_warning_body_scroll_panel = GuiScrollPanel() |
|
|
|
|
|
|
|
|
|
self._downloading_body_label = Label("Downloading...", TITLE_FONT_SIZE, FontWeight.MEDIUM) |
|
|
|
|
self._downloading_body_label = Label("Downloading...", TITLE_FONT_SIZE, FontWeight.MEDIUM, text_padding=20) |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
with open("/sys/class/hwmon/hwmon1/in1_input") as f: |
|
|
|
@ -335,7 +336,7 @@ class Setup(Widget): |
|
|
|
|
elif result == 0: |
|
|
|
|
self.state = SetupState.SOFTWARE_SELECTION |
|
|
|
|
|
|
|
|
|
self.keyboard.reset() |
|
|
|
|
self.keyboard.reset(min_text_size=1) |
|
|
|
|
self.keyboard.set_title("Enter URL", "for Custom Software") |
|
|
|
|
gui_app.set_modal_overlay(self.keyboard, callback=handle_keyboard_result) |
|
|
|
|
|
|
|
|
|