|
|
@ -456,13 +456,13 @@ void MarlinUI::draw_status_screen() { |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_PRINT_PROGRESS |
|
|
|
#if DISABLED(DOGM_SD_PERCENT) |
|
|
|
#if DISABLED(SHOW_SD_PERCENT) |
|
|
|
#define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2) |
|
|
|
#else |
|
|
|
#define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH)) |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(DOGM_SD_PERCENT) |
|
|
|
#if ENABLED(SHOW_SD_PERCENT) |
|
|
|
static char progress_string[5]; |
|
|
|
#endif |
|
|
|
static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF; |
|
|
@ -471,7 +471,7 @@ void MarlinUI::draw_status_screen() { |
|
|
|
#if ENABLED(SHOW_REMAINING_TIME) |
|
|
|
static u8g_uint_t estimation_x_pos = 0; |
|
|
|
static char estimation_string[10]; |
|
|
|
#if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) |
|
|
|
#if BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) |
|
|
|
static u8g_uint_t progress_x_pos = 0; |
|
|
|
static uint8_t progress_state = 0; |
|
|
|
static bool prev_blink = 0; |
|
|
@ -526,7 +526,7 @@ void MarlinUI::draw_status_screen() { |
|
|
|
|
|
|
|
progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * (progress / (PROGRESS_SCALE)) * 0.01f); |
|
|
|
|
|
|
|
#if ENABLED(DOGM_SD_PERCENT) |
|
|
|
#if ENABLED(SHOW_SD_PERCENT) |
|
|
|
if (progress == 0) { |
|
|
|
progress_string[0] = '\0'; |
|
|
|
#if ENABLED(SHOW_REMAINING_TIME) |
|
|
@ -543,7 +543,7 @@ void MarlinUI::draw_status_screen() { |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
constexpr bool can_show_days = DISABLED(DOGM_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY); |
|
|
|
constexpr bool can_show_days = DISABLED(SHOW_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY); |
|
|
|
if (ev != lastElapsed) { |
|
|
|
lastElapsed = ev; |
|
|
|
const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L); |
|
|
@ -564,11 +564,7 @@ void MarlinUI::draw_status_screen() { |
|
|
|
else { |
|
|
|
duration_t estimation = timeval; |
|
|
|
const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L); |
|
|
|
estimation_x_pos = _SD_INFO_X(len |
|
|
|
#if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) |
|
|
|
+ 1 |
|
|
|
#endif |
|
|
|
); |
|
|
|
estimation_x_pos = _SD_INFO_X(len + !BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
@ -767,7 +763,7 @@ void MarlinUI::draw_status_screen() { |
|
|
|
|
|
|
|
if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) { |
|
|
|
|
|
|
|
#if ALL(DOGM_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) |
|
|
|
#if ALL(SHOW_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) |
|
|
|
|
|
|
|
if (prev_blink != blink) { |
|
|
|
prev_blink = blink; |
|
|
@ -789,13 +785,13 @@ void MarlinUI::draw_status_screen() { |
|
|
|
lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); |
|
|
|
} |
|
|
|
|
|
|
|
#else // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
|
|
|
|
#else // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
|
|
|
|
|
|
|
|
//
|
|
|
|
// SD Percent Complete
|
|
|
|
//
|
|
|
|
|
|
|
|
#if ENABLED(DOGM_SD_PERCENT) |
|
|
|
#if ENABLED(SHOW_SD_PERCENT) |
|
|
|
if (progress_string[0]) { |
|
|
|
lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete
|
|
|
|
lcd_put_wchar('%'); |
|
|
@ -815,7 +811,7 @@ void MarlinUI::draw_status_screen() { |
|
|
|
#endif |
|
|
|
lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); |
|
|
|
|
|
|
|
#endif // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
|
|
|
|
#endif // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
|
|
|
|
} |
|
|
|
|
|
|
|
#endif // HAS_PRINT_PROGRESS
|
|
|
|