diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 1dbafb38ef518..6293fea1586c7 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1437,22 +1437,22 @@ // Add an 'M73' G-code to set the current percentage //#define SET_PROGRESS_MANUALLY #if ENABLED(SET_PROGRESS_MANUALLY) - #define USE_M73_PERCENT // Add 'P' pazrameter to set percentage done, else use Marlin's estimation - #define USE_M73_REMAINING_TIME // Add 'R' parameter to set remaining time, else use Marlin's estimation - //#define USE_M73_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction - //#define M73_REPORT // Report M73 values to host + //#define USE_M73_PERCENT // Add 'P' parameter to set percentage done, otherwise use Marlin's estimate + //#define USE_M73_REMAINING_TIME // Add 'R' parameter to set remaining time, otherwise use Marlin's estimate + //#define USE_M73_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction + #if ENABLED(USE_M73_INTERACTION_TIME) + #define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change) + #endif + //#define M73_REPORT // Report M73 values to host #endif // LCD Print Progress options, multiple can be rotated depending on screen layout #if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY) - #define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar) - #define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E') - #define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') - #if ENABLED(USE_M73_INTERACTION_TIME) - #define SHOW_INTERACTION_TIME // Display time to next user interaction (prefix 'C', for filament 'C'hange) - #endif + #define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar) + #define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E') + //#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') - //#define PRINT_PROGRESS_SHOW_DECIMALS // Show/report progress with decimal digits, not all UIs support this + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show/report progress with decimal digits, not all UIs support this #if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing @@ -1802,8 +1802,8 @@ #endif // HAS_MARLINUI_U8GLIB #if HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI - #define MENU_HOLLOW_FRAME // Enable to save many cycles by drawing a hollow frame on Menu Screens - //#define OVERLAY_GFX_REVERSE // Swap the CW/CCW indicators in the graphics overlay + #define MENU_HOLLOW_FRAME // Enable to save many cycles by drawing a hollow frame on Menu Screens + //#define OVERLAY_GFX_REVERSE // Swap the CW/CCW indicators in the graphics overlay #endif // diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index b27ffa1ae7e5a..fd47ceff86dd3 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -35,18 +35,18 @@ /** * M73: Set percentage complete (for display on LCD) - * + * * Example: * M73 P25.63 ; Set progress to 25.63% * M73 R456 ; Set remaining time to 456 minutes * M73 C12 ; Set next interaction countdown to 12 minutes * M73 ; Report current values - * - * Use Prusa-like report format: + * + * Use Prusa-like report format: * M73 Percent done: ---; Print time remaining in mins: -----; Change in mins: -----; - * + * * When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100 / 23.4 / 3.45 format - * + * */ void GcodeSuite::M73() { @@ -67,7 +67,7 @@ void GcodeSuite::M73() { #if ENABLED(USE_M73_REMAINING_TIME) if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong()); #endif - + #if ENABLED(USE_M73_INTERACTION_TIME) if (parser.seenval('C')) ui.set_interaction_time(60 * parser.value_ulong()); #endif @@ -75,16 +75,20 @@ void GcodeSuite::M73() { #endif #if ENABLED(M73_REPORT) - SERIAL_ECHO_MSG(" M73 Percent done: ", TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent()) - #if ENABLED(USE_M73_REMAINING_TIME) - , "; Print time remaining in mins: ", ui.remaining_time / 60 - #endif - #if ENABLED(USE_M73_INTERACTION_TIME) - , "; Change in mins: ", ui.interaction_time/60 - #endif - , ";"); + { + SERIAL_ECHO_MSG( + " M73 Percent done: ", + TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent()) + #if ENABLED(USE_M73_REMAINING_TIME) + , "%; Time left: ", ui.remaining_time / 60 + #endif + #if ENABLED(USE_M73_INTERACTION_TIME) + , "m; Change: ", ui.interaction_time / 60 + #endif + , "m" + ); + } #endif } #endif // SET_PROGRESS_MANUALLY - diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 51692caf31f15..414455773b8be 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -727,7 +727,7 @@ void MarlinUI::draw_status_message(const bool blink) { static uint8_t timepos = TPOFFSET - 6; static char buffer[14]; static lcd_uint_t pc, pr; - + #if ENABLED(SHOW_PROGRESS_PERCENT) void MarlinUI::stringPercent(){ const uint8_t progress = ui.get_progress_percent(); @@ -769,7 +769,7 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str(buffer); } } - #endif + #endif #endif //HAS_PRINT_PROGRESS /** diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 50cceeb56765a..39500bea6ed35 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -445,7 +445,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const lcd_put_u8str(value); } -// Prepare strings for progress display +// Prepare strings for progress display #if HAS_PRINT_PROGRESS #define _PRGR_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH)) #define PCENTERED 1 // center percent value over progress bar, else align to the right @@ -563,7 +563,7 @@ void MarlinUI::draw_status_screen() { progress_x_pos = TERN(PCENTERED, 77, _PRGR_INFO_X(strlen(progress_string) + 1)); #endif } - + #if ENABLED(SHOW_INTERACTION_TIME) if (!(interaction_time)) { interaction_string[0] = '\0'; @@ -787,7 +787,7 @@ void MarlinUI::draw_status_screen() { // Progress bar solid part if (PAGE_CONTAINS(PROGRESS_BAR_Y + 1, PROGRESS_BAR_Y + 2)) u8g.drawBox(PROGRESS_BAR_X + 1, PROGRESS_BAR_Y + 1, progress_bar_solid_width, 2); - + // Progress strings if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) ui.rotate_progress(); diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index f210d67c64d03..43eb2f1bc9dcc 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -42,26 +42,26 @@ /** One hotend layout * ------------------ - * |⟱ xxx➜xxx° ✱xxx% + * |⟱ xxx➜xxx° ✱xxx% * |_ xxx➜xxx° Fxxx% * ||||||||||R•xxx:xx - * | status string + * | status string * ------------------ - * + * * hotend temp | fan speed * bed temp | feedrate * progress bar| progress time * status string - * + * * **************************** * Two hotends layout * ------------------ - * |⟱ xxx➜xxx° ✱xxx% + * |⟱ xxx➜xxx° ✱xxx% * |⟱ xxx➜xxx°||||||| * |_ xxx➜xxx°Rxxx:xx - * | status string + * | status string * ------------------ - * + * * hotend temp | fan speed * hotend temp | progress bar * bed temp | progress time @@ -697,9 +697,9 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { memcpy(&screenstr[2 - LSHIFT], \ TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)), \ TERN(PRINT_PROGRESS_SHOW_DECIMALS, 4, 3)); - screenstr[(TERN(PRINT_PROGRESS_SHOW_DECIMALS, 6, 5) - LSHIFT)] = '%'; + screenstr[(TERN(PRINT_PROGRESS_SHOW_DECIMALS, 6, 5) - LSHIFT)] = '%'; draw_progress_string(PPOS, screenstr); - } + } } #endif #if ENABLED(SHOW_REMAINING_TIME) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index d46b8e7ab0c03..0f63730d66ed6 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -378,9 +378,7 @@ void MarlinUI::draw_status_screen() { dwin_string.set(); char prefix = ' '; #if ENABLED(SHOW_REMAINING_TIME) - // i have no idea how this works and no hardwaer to dabble, someone please make it work with global MarlinUI::rotate_progress() - // if (TERN1(ROTATE_PROGRESS_DISPLAY, blink) && print_job_timer.isRunning()) - if (blink && print_job_timer.isRunning()) { + if (TERN1(ROTATE_PROGRESS_DISPLAY, blink) && print_job_timer.isRunning()) { time = get_remaining_time(); prefix = 'R'; } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index b71894de3a4fe..6f963c0e24d07 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1725,7 +1725,7 @@ void MarlinUI::init() { #endif ); } - + void (*const MarlinUI::string_ptr[])() = { #if ENABLED(SHOW_REMAINING_TIME) MarlinUI::stringRemain, @@ -1740,9 +1740,9 @@ void MarlinUI::init() { MarlinUI::stringElapsed #endif }; - - #define STRINGS (COUNT_ENABLED(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)) - void MarlinUI::rotate_progress(){ // Renew and redraw all enabled progress strings + + #define STRINGS COUNT_ENABLED(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME) + void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings static bool prev_blink; static uint8_t i; if (prev_blink != get_blink()) { @@ -1750,8 +1750,9 @@ void MarlinUI::init() { if (++i >= STRINGS) i = 0; (*string_ptr[i])(); } - }; -#endif + } + +#endif // HAS_PRINT_PROGRESS #if ENABLED(SDSUPPORT)