From 8df6691819581dd6e35c42e6810569040d6b3487 Mon Sep 17 00:00:00 2001 From: vintagepc Date: Thu, 29 Aug 2019 18:07:24 -0400 Subject: [PATCH] Relocate sheet menu, show sheet on info screen -Sheet is shown instead of percentage done either if idle, or during print preheat. -Relocated sheet menu to below SD menu for additional visibility to current sheet. --- Firmware/ultralcd.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e601fd755..5591586b2 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -598,11 +598,21 @@ 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)); - sprintf_P(per, num?_N("%3hhd"):_N("---"), calc_percent_done()); - lcd_printf_P(_N("%3S%3s%%"), src, per); + if (!num || heating_status) // either not printing or heating + { + eeprom_read_block(sheet, EEPROM_Sheets_base->s[selected_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); + } } // Print extruder status (5 chars total) @@ -6714,6 +6724,14 @@ static void lcd_main_menu() } #endif + if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) + { + if (!farm_mode) + { + MENU_ITEM_SUBMENU_SELECT_SHEET_E(EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))], change_sheet_from_menu); + } + } + if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) { @@ -6759,14 +6777,6 @@ static void lcd_main_menu() } - if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { - if (!farm_mode) - { - MENU_ITEM_SUBMENU_SELECT_SHEET_E(EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))], change_sheet_from_menu); - } - } - if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS