From d89f4e99529bd6718b69a2e9dcc9774647057b52 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 14 Feb 2022 17:47:47 +0100 Subject: [PATCH 1/3] Fix indentation in the MK3 sensor information screen --- Firmware/ultralcd.cpp | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e90eaa8a6..b934af6bc 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3843,26 +3843,18 @@ static void lcd_show_sensors_state() // Shutter register is an index of LASER shutter time. It is automatically controlled by the chip's internal // auto-exposure algorithm. When the chip is tracking on a good reflection surface, the Shutter is small. // When the chip is tracking on a poor reflection surface, the Shutter is large. Value ranges from 0 to 46. - if (mmu_enabled == false) - { - //if (!fsensor_enabled) - // lcd_puts_P(_N("Filament sensor\n" "is disabled.")); - //else - //{ - if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - pat9125_update(); - lcd_set_cursor(0, 2); - lcd_printf_P(_N( - "Xd: %3d " - "Yd: %3d\n" ////c=4 - "Int: %3d " ////c=4 - "Shut: %3d" ////c=4 - ), - pat9125_x, pat9125_y, - pat9125_b, pat9125_s - ); - //} - } + if (mmu_enabled == false) + { + // pat9125_update is already called while printing: only update manually when idling + if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) + pat9125_update(); + + lcd_set_cursor(0, 2); + lcd_printf_P(_N("Xd: %3d Yd: %3d\n" + "Int: %3d Shut: %3d"), + pat9125_x, pat9125_y, + pat9125_b, pat9125_s); + } #endif //PAT9125 } From 0c63e0e8dfb6191dad916fde120f0cc486232c6f Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 14 Feb 2022 17:57:10 +0100 Subject: [PATCH 2/3] Prettify MK3 sensor-info screen --- Firmware/ultralcd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index b934af6bc..5cf006555 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3797,9 +3797,9 @@ static void lcd_print_state(uint8_t state) //! @code{.unparsed} //! |01234567890123456789| //! |PINDA N/A FINDA N/A| MSG_PINDA c=5 MSG_FINDA c=5 -//! |Fil. sensor N/A| MSG_FSENSOR -//! |Xd 000 Yd 000| MSG_XD -//! |Int 000 Shut 000| +//! |Fil. sensor N/A| MSG_FSENSOR +//! | Xd 000 Yd 000| +//! |Int 000 Shut 000| //! ---------------------- //! @endcode static void lcd_show_sensors_state() @@ -3850,8 +3850,8 @@ static void lcd_show_sensors_state() pat9125_update(); lcd_set_cursor(0, 2); - lcd_printf_P(_N("Xd: %3d Yd: %3d\n" - "Int: %3d Shut: %3d"), + lcd_printf_P(_N(" Xd: %4d Yd: %3d\n" + "Int: %4d Shut: %3d"), pat9125_x, pat9125_y, pat9125_b, pat9125_s); } From 40881f52adfc096e24a419f123d2f44ead470e7b Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 14 Feb 2022 23:30:08 +0100 Subject: [PATCH 3/3] Prettify lcd_show_sensors_state() v2 Allow to show the full precision of Xd/Yd by rearranging the layout --- Firmware/ultralcd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5cf006555..b815ce60b 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3798,8 +3798,8 @@ static void lcd_print_state(uint8_t state) //! |01234567890123456789| //! |PINDA N/A FINDA N/A| MSG_PINDA c=5 MSG_FINDA c=5 //! |Fil. sensor N/A| MSG_FSENSOR -//! | Xd 000 Yd 000| -//! |Int 000 Shut 000| +//! | Int: 000 Xd:+00000| +//! |Shut: 000 Yd:+00000| //! ---------------------- //! @endcode static void lcd_show_sensors_state() @@ -3850,10 +3850,10 @@ static void lcd_show_sensors_state() pat9125_update(); lcd_set_cursor(0, 2); - lcd_printf_P(_N(" Xd: %4d Yd: %3d\n" - "Int: %4d Shut: %3d"), - pat9125_x, pat9125_y, - pat9125_b, pat9125_s); + lcd_printf_P(_N(" Int: %3d Xd:%6d\n" + "Shut: %3d Yd:%6d"), + pat9125_b, pat9125_x, + pat9125_s, pat9125_y); } #endif //PAT9125 }