SHOW_REMAINING_TIME for HD44780 character LCD (#19416)
This commit is contained in:
parent
073b7f1e3a
commit
24d8daa01b
@ -1105,23 +1105,26 @@
|
|||||||
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
|
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_GRAPHICAL_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
|
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && (HAS_GRAPHICAL_LCD || HAS_CHARACTER_LCD)
|
||||||
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
|
//#define SHOW_REMAINING_TIME // Display estimated time to completion
|
||||||
//#define SHOW_REMAINING_TIME // Display estimated time to completion
|
|
||||||
#if ENABLED(SHOW_REMAINING_TIME)
|
#if ENABLED(SHOW_REMAINING_TIME)
|
||||||
//#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
|
//#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
|
||||||
//#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time
|
//#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_CHARACTER_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
|
#if HAS_GRAPHICAL_LCD
|
||||||
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
|
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
|
||||||
#if ENABLED(LCD_PROGRESS_BAR)
|
#endif
|
||||||
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
|
|
||||||
#define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message
|
#if HAS_CHARACTER_LCD
|
||||||
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
|
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
|
||||||
//#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it
|
#if ENABLED(LCD_PROGRESS_BAR)
|
||||||
//#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar
|
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
|
||||||
|
#define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message
|
||||||
|
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
|
||||||
|
//#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it
|
||||||
|
//#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -692,8 +692,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
|||||||
#elif PROGRESS_MSG_EXPIRE < 0
|
#elif PROGRESS_MSG_EXPIRE < 0
|
||||||
#error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
|
#error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
|
||||||
#endif
|
#endif
|
||||||
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_GRAPHICAL_LCD, HAS_GRAPHICAL_TFT, EXTENSIBLE_UI)
|
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_GRAPHICAL_LCD, HAS_GRAPHICAL_TFT, HAS_CHARACTER_LCD, EXTENSIBLE_UI)
|
||||||
#error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, TFT, or EXTENSIBLE_UI."
|
#error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, or EXTENSIBLE_UI."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
#if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||||
@ -3055,8 +3055,6 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
|||||||
#if !HAS_GRAPHICAL_LCD
|
#if !HAS_GRAPHICAL_LCD
|
||||||
#if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
|
#if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
|
||||||
#error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
|
#error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
|
||||||
#elif ENABLED(SHOW_REMAINING_TIME)
|
|
||||||
#error "SHOW_REMAINING_TIME currently requires a Graphical LCD."
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -845,10 +845,31 @@ void MarlinUI::draw_status_screen() {
|
|||||||
lcd_put_wchar('%');
|
lcd_put_wchar('%');
|
||||||
|
|
||||||
char buffer[14];
|
char buffer[14];
|
||||||
duration_t elapsed = print_job_timer.duration();
|
uint8_t timepos = 0;
|
||||||
const uint8_t len = elapsed.toDigital(buffer),
|
#if ENABLED(SHOW_REMAINING_TIME)
|
||||||
timepos = LCD_WIDTH - len - 1;
|
const bool show_remain = TERN1(ROTATE_PROGRESS_DISPLAY, blink) && (printingIsActive() || marlin_state == MF_SD_COMPLETE);
|
||||||
lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]);
|
if (show_remain) {
|
||||||
|
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||||
|
duration_t remaining = get_remaining_time();
|
||||||
|
#else
|
||||||
|
uint8_t progress = get_progress_percent();
|
||||||
|
uint32_t elapsed = print_job_timer.duration();
|
||||||
|
duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0;
|
||||||
|
#endif
|
||||||
|
const uint8_t len = remaining.toDigital(buffer);
|
||||||
|
timepos = LCD_WIDTH - 1 - len;
|
||||||
|
lcd_put_wchar(timepos, 2, 'R');
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
constexpr bool show_remain = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!show_remain) {
|
||||||
|
duration_t elapsed = print_job_timer.duration();
|
||||||
|
const uint8_t len = elapsed.toDigital(buffer);
|
||||||
|
timepos = LCD_WIDTH - 1 - len;
|
||||||
|
lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]);
|
||||||
|
}
|
||||||
lcd_put_u8str(buffer);
|
lcd_put_u8str(buffer);
|
||||||
|
|
||||||
#if LCD_WIDTH >= 20
|
#if LCD_WIDTH >= 20
|
||||||
|
Loading…
Reference in New Issue
Block a user