From f071aec74775c9f8b568f053a5dc6d4b9078e757 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 18 Dec 2019 08:52:25 +0300 Subject: [PATCH 1/2] Fix sheet minimum width on the status screen --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5d0abeac..a4019f49 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -630,7 +630,7 @@ void lcdui_print_percent_done(void) { eeprom_read_block(sheet, EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].name, 7); sheet[7] = '\0'; - lcd_printf_P(PSTR("%s"),sheet); + lcd_printf_P(PSTR("%-7s"),sheet); } else { From c5324291ada0bf14906f688f04760bfe8352000f Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 8 Jan 2020 12:48:41 +0200 Subject: [PATCH 2/2] Do not show sheet on status screen if less than 2 are initialized --- Firmware/ultralcd.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5d0abeac..ed9c403b 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -622,21 +622,24 @@ void lcdui_print_feedrate(void) // Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total) void lcdui_print_percent_done(void) { - char sheet[8]; const char* src = is_usb_printing?_N("USB"):(IS_SD_PRINTING?_N(" SD"):_N(" ")); char per[4]; bool num = IS_SD_PRINTING || (PRINTER_ACTIVE && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); if (!num || heating_status) // either not printing or heating { - eeprom_read_block(sheet, EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].name, 7); - sheet[7] = '\0'; - lcd_printf_P(PSTR("%s"),sheet); - } - else - { - sprintf_P(per, num?_N("%3hhd"):_N("---"), calc_percent_done()); - lcd_printf_P(_N("%3S%3s%%"), src, per); + const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); + const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); + if ((nextSheet >= 0) && (sheetNR != nextSheet)) + { + char sheet[8]; + eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); + sheet[7] = '\0'; + lcd_printf_P(PSTR("%s"),sheet); + return; //do not also print the percentage + } } + sprintf_P(per, num?_N("%3hhd"):_N("---"), calc_percent_done()); + lcd_printf_P(_N("%3S%3s%%"), src, per); } // Print extruder status (5 chars total)