Merge upstream changes from Marlin 2.1.2

This commit is contained in:
Stefan Kalscheuer
2022-12-19 15:23:45 +01:00
parent fe9ea826a5
commit 67c7ce7b79
427 changed files with 10732 additions and 7834 deletions

View File

@@ -213,7 +213,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(status_message);
// Fill the rest with spaces
while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; }
while (slen < max_status_chars) { lcd_put_u8str(F(" ")); ++slen; }
}
}
else {
@@ -227,10 +227,10 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the string doesn't completely fill the line...
if (rlen < max_status_chars) {
lcd_put_lchar('.'); // Always at 1+ spaces left, draw a dot
lcd_put_u8str(F(".")); // Always at 1+ spaces left, draw a dot
uint8_t chars = max_status_chars - rlen; // Amount of space left in characters
if (--chars) { // Draw a second dot if there's space
lcd_put_lchar('.');
lcd_put_u8str(F("."));
if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
}
@@ -254,7 +254,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, max_status_chars);
// Fill the rest with spaces if there are missing spaces
while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; }
while (slen < max_status_chars) { lcd_put_u8str(F(" ")); ++slen; }
}
#endif

View File

@@ -366,6 +366,8 @@ void MarlinUI::draw_status_screen() {
);
}
// TODO!
//
// Elapsed time
//
@@ -374,11 +376,11 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
// Portrait mode only shows one value at a time, and will rotate if ROTATE_PROGRESS_DISPLAY
// Portrait mode only shows one value at a time, and will rotate if many are enabled
dwin_string.set();
char prefix = ' ';
#if ENABLED(SHOW_REMAINING_TIME)
if (TERN1(ROTATE_PROGRESS_DISPLAY, blink) && print_job_timer.isRunning()) {
if (blink && print_job_timer.isRunning()) {
time = get_remaining_time();
prefix = 'R';
}
@@ -447,13 +449,13 @@ void MarlinUI::draw_status_screen() {
//if (pb_solid < old_solid)
DWIN_Draw_Rectangle(1, Color_Bg_Black, pb_left + 1 + pb_solid, pb_top + 1, pb_right - 1, pb_bottom - 1); // Erase the rest
#if ENABLED(SHOW_SD_PERCENT)
#if ENABLED(SHOW_PROGRESS_PERCENT)
dwin_string.set(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE))));
dwin_string.add('%');
DWIN_Draw_String(
false, font16x32, Percent_Color, Color_Bg_Black,
pb_left + (pb_width - dwin_string.length * 16) / 2,
pb_top + (pb_height - 32) / 2,
pb_top + (pb_height - 32) / 2 - 1,
S(dwin_string.string())
);
#endif