Merge pull request #2146 from vintagepc/MK3-2093-sheet-display

PFW-1061: #2093 - Relocate sheet menu, show sheet on info screen
This commit is contained in:
DRracer 2019-11-15 16:07:51 +01:00 committed by GitHub
commit 3a41405f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -612,11 +612,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[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);
}
}
// Print extruder status (5 chars total)