refactor: make menus more visually appealing

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-06-22 12:30:29 +02:00
parent e63eb47ee9
commit 205c84b3c3
17 changed files with 374 additions and 364 deletions

View File

@@ -39,32 +39,33 @@ class KlipperFlashMethodHelpMenu(BaseMenu):
subheader2 = f"{COLOR_CYAN}Updating via SD-Card Update:{RESET_FORMAT}"
menu = textwrap.dedent(
f"""
/=======================================================\\
| {color}{header:~^{count}}{RESET_FORMAT} |
|-------------------------------------------------------|
| {subheader1:<62} |
| The default method to flash controller boards which |
| are connected and updated over USB and not by placing |
| a compiled firmware file onto an internal SD-Card. |
| |
| Common controllers that get flashed that way are: |
| - Arduino Mega 2560 |
| - Fysetc F6 / S6 (used without a Display + SD-Slot) |
| |
| {subheader2:<62} |
| Many popular controller boards ship with a bootloader |
| capable of updating the firmware via SD-Card. |
| Choose this method if your controller board supports |
| this way of updating. This method ONLY works for up- |
| grading firmware. The initial flashing procedure must |
| be done manually per the instructions that apply to |
| your controller board. |
| |
| Common controllers that can be flashed that way are: |
| - BigTreeTech SKR 1.3 / 1.4 (Turbo) / E3 / Mini E3 |
| - Fysetc F6 / S6 (used with a Display + SD-Slot) |
| - Fysetc Spider |
| |
╔═══════════════════════════════════════════════════════╗
{color}{header:~^{count}}{RESET_FORMAT}
╟───────────────────────────────────────────────────────╢
{subheader1:<62}
The default method to flash controller boards which
are connected and updated over USB and not by placing
a compiled firmware file onto an internal SD-Card.
Common controllers that get flashed that way are:
- Arduino Mega 2560
- Fysetc F6 / S6 (used without a Display + SD-Slot)
{subheader2:<62}
Many popular controller boards ship with a bootloader
capable of updating the firmware via SD-Card.
Choose this method if your controller board supports
this way of updating. This method ONLY works for up-
grading firmware. The initial flashing procedure must
be done manually per the instructions that apply to
your controller board.
Common controllers that can be flashed that way are:
- BigTreeTech SKR 1.3 / 1.4 (Turbo) / E3 / Mini E3
- Fysetc F6 / S6 (used with a Display + SD-Slot)
- Fysetc Spider
╟───────────────────────────────────────────────────────╢
"""
)[1:]
print(menu, end="")
@@ -96,19 +97,19 @@ class KlipperFlashCommandHelpMenu(BaseMenu):
subheader2 = f"{COLOR_CYAN}make serialflash:{RESET_FORMAT}"
menu = textwrap.dedent(
f"""
/=======================================================\\
| {color}{header:~^{count}}{RESET_FORMAT} |
|-------------------------------------------------------|
| {subheader1:<62} |
| The default command to flash controller board, it |
| will detect selected microcontroller and use suitable |
| tool for flashing it. |
| |
| {subheader2:<62} |
| Special command to flash STM32 microcontrollers in |
| DFU mode but connected via serial. stm32flash command |
| will be used internally. |
| |
╔═══════════════════════════════════════════════════════╗
{color}{header:~^{count}}{RESET_FORMAT}
╟───────────────────────────────────────────────────────╢
{subheader1:<62}
The default command to flash controller board, it
will detect selected microcontroller and use suitable
tool for flashing it.
{subheader2:<62}
Special command to flash STM32 microcontrollers in
DFU mode but connected via serial. stm32flash command
will be used internally.
"""
)[1:]
print(menu, end="")
@@ -142,25 +143,26 @@ class KlipperMcuConnectionHelpMenu(BaseMenu):
subheader2 = f"{COLOR_CYAN}UART:{RESET_FORMAT}"
menu = textwrap.dedent(
f"""
/=======================================================\\
| {color}{header:~^{count}}{RESET_FORMAT} |
|-------------------------------------------------------|
| {subheader1:<62} |
| Selecting USB as the connection method will scan the |
| USB ports for connected controller boards. This will |
| be similar to the 'ls /dev/serial/by-id/*' command |
| suggested by the official Klipper documentation for |
| determining successfull USB connections! |
| |
| {subheader2:<62} |
| Selecting UART as the connection method will list all |
| possible UART serial ports. Note: This method ALWAYS |
| returns something as it seems impossible to determine |
| if a valid Klipper controller board is connected or |
| not. Because of that, you MUST know which UART serial |
| port your controller board is connected to when using |
| this connection method. |
| |
╔═══════════════════════════════════════════════════════╗
{color}{header:~^{count}}{RESET_FORMAT}
╟───────────────────────────────────────────────────────╢
{subheader1:<62}
Selecting USB as the connection method will scan the
USB ports for connected controller boards. This will
be similar to the 'ls /dev/serial/by-id/*' command
suggested by the official Klipper documentation for
determining successfull USB connections!
{subheader2:<62}
Selecting UART as the connection method will list all
possible UART serial ports. Note: This method ALWAYS
returns something as it seems impossible to determine
if a valid Klipper controller board is connected or
not. Because of that, you MUST know which UART serial
port your controller board is connected to when using
this connection method.
╟───────────────────────────────────────────────────────╢
"""
)[1:]
print(menu, end="")