From 9a1c02591ba4c3d5b41f4c64edd819ea1860b75b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Apr 2023 17:51:45 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Status=20Me?= =?UTF-8?q?ssage=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/mmu/mmu2.cpp | 6 ++-- Marlin/src/feature/pause.cpp | 15 ++++---- Marlin/src/gcode/bedlevel/G26.cpp | 36 ++++++++------------ Marlin/src/gcode/calibrate/M48.cpp | 2 +- Marlin/src/lcd/language/language_en.h | 4 ++- Marlin/src/lcd/marlinui.cpp | 4 +-- Marlin/src/lcd/marlinui.h | 8 +++++ Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 4 +-- Marlin/src/module/settings.cpp | 4 +-- 9 files changed, 43 insertions(+), 40 deletions(-) diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 7b6a48954b6..b56e3d9c291 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -978,10 +978,10 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { manage_response(false, false); if (recover) { - LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER); + LCD_MESSAGE(MSG_MMU2_REMOVE_AND_CLICK); mmu2_attn_buzz(); - TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR))); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover"))); + TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_MMU2_EJECT_RECOVER), FPSTR(CONTINUE_STR))); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_MMU2_EJECT_RECOVER))); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); mmu2_attn_buzz(true); diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 488f5920c25..9e0f51fad63 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -201,7 +201,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; // LCD click or M108 will clear this - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Load Filament"))); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENTLOAD))); #if ENABLED(HOST_PROMPT_SUPPORT) const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder); @@ -465,7 +465,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool // If axes don't need to home then the nozzle can park if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move - TERN_(DWIN_LCD_PROUI, if (!do_park) ui.set_status(GET_TEXT_F(MSG_PARK_FAILED))); + if (!do_park) LCD_MESSAGE(MSG_PARK_FAILED); #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; @@ -554,9 +554,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING))); - TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING))); - - TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING)); + LCD_MESSAGE(MSG_REHEATING); // Re-enable the heaters if they timed out HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e); @@ -573,8 +571,11 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR))); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE))); - TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE)); + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)); + #else + LCD_MESSAGE(MSG_REHEATDONE); + #endif IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index aa6e0c1f0c5..fe20423b8d8 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -162,8 +162,8 @@ float g26_random_deviation = 0.0; */ bool user_canceled() { if (!ui.button_pressed()) return false; // Return if the button isn't pressed - ui.set_status(GET_TEXT_F(MSG_G26_CANCELED), 99); - TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); + LCD_MESSAGE_MAX(MSG_G26_CANCELED); + ui.quick_feedback(); ui.wait_for_release(); return true; } @@ -321,11 +321,9 @@ typedef struct { #if HAS_HEATED_BED if (bed_temp > 25) { - #if HAS_WIRED_LCD - ui.set_status(GET_TEXT_F(MSG_G26_HEATING_BED), 99); - ui.quick_feedback(); - TERN_(HAS_MARLINUI_MENU, ui.capture()); - #endif + LCD_MESSAGE_MAX(MSG_G26_HEATING_BED); + ui.quick_feedback(); + TERN_(HAS_MARLINUI_MENU, ui.capture()); thermalManager.setTargetBed(bed_temp); // Wait for the temperature to stabilize @@ -340,20 +338,16 @@ typedef struct { #endif // HAS_HEATED_BED // Start heating the active nozzle - #if HAS_WIRED_LCD - ui.set_status(GET_TEXT_F(MSG_G26_HEATING_NOZZLE), 99); - ui.quick_feedback(); - #endif + LCD_MESSAGE_MAX(MSG_G26_HEATING_NOZZLE); + ui.quick_feedback(); thermalManager.setTargetHotend(hotend_temp, active_extruder); // Wait for the temperature to stabilize if (!thermalManager.wait_for_hotend(active_extruder, true OPTARG(G26_CLICK_CAN_CANCEL, true))) return G26_ERR; - #if HAS_WIRED_LCD - ui.reset_status(); - ui.quick_feedback(); - #endif + ui.reset_status(); + ui.completion_feedback(); return G26_OK; } @@ -371,7 +365,7 @@ typedef struct { if (prime_flag == -1) { // The user wants to control how much filament gets purged ui.capture(); - ui.set_status(GET_TEXT_F(MSG_G26_MANUAL_PRIME), 99); + LCD_MESSAGE_MAX(MSG_G26_MANUAL_PRIME); ui.chirp(); destination = current_position; @@ -398,17 +392,15 @@ typedef struct { ui.wait_for_release(); - ui.set_status(GET_TEXT_F(MSG_G26_PRIME_DONE), 99); + LCD_MESSAGE_MAX(MSG_G26_PRIME_DONE); ui.quick_feedback(); ui.release(); } else #endif { - #if HAS_WIRED_LCD - ui.set_status(GET_TEXT_F(MSG_G26_FIXED_LENGTH), 99); - ui.quick_feedback(); - #endif + LCD_MESSAGE_MAX(MSG_G26_FIXED_LENGTH); + ui.quick_feedback(); destination = current_position; destination.e += prime_length; prepare_internal_move_to_destination(fr_slow_e); @@ -853,7 +845,7 @@ void GcodeSuite::G26() { } while (--g26_repeats && location.valid()); LEAVE: - ui.set_status(GET_TEXT_F(MSG_G26_LEAVING), -1); + LCD_MESSAGE_MIN(MSG_G26_LEAVING); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, ExtUI::G26_FINISH)); g26.retract_filament(destination); diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index ff14175c71d..5e0c21b42e4 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -84,7 +84,7 @@ void GcodeSuite::M48() { }; if (!probe.can_reach(test_position)) { - ui.set_status(GET_TEXT_F(MSG_M48_OUT_OF_BOUNDS), 99); + LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS); SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); return; } diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 68c231d5561..244d61a712c 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -639,6 +639,7 @@ namespace Language_en { LSTR MSG_CHAMBER_COOLING = _UxGT("Chamber Cooling..."); LSTR MSG_LASER_COOLING = _UxGT("Laser Cooling..."); LSTR MSG_DELTA_CALIBRATE = _UxGT("Delta Calibration"); + LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Delta Calibration in progress"); LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Calibrate X"); LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrate Y"); LSTR MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrate Z"); @@ -749,7 +750,8 @@ namespace Language_en { LSTR MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); LSTR MSG_MMU2_RESET = _UxGT("Reset MMU"); LSTR MSG_MMU2_RESETTING = _UxGT("MMU Resetting..."); - LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("Remove, click"); + LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("MMU2 Eject Recover"); + LSTR MSG_MMU2_REMOVE_AND_CLICK = _UxGT("Remove and click..."); LSTR MSG_MIX = _UxGT("Mix"); LSTR MSG_MIX_COMPONENT_N = _UxGT("Component ="); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 88cdb990762..22b3fa27d71 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -671,7 +671,7 @@ void MarlinUI::init() { #if HAS_MARLINUI_MENU if (use_click()) { #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - next_filament_display = millis() + 5000UL; // Show status message for 5s + pause_filament_display(); #endif goto_screen(menu_main); reinit_lcd(); // Revive a noisy shared SPI LCD @@ -1592,7 +1592,7 @@ void MarlinUI::init() { #endif #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - next_filament_display = ms + 5000UL; // Show status message for 5s + pause_filament_display(ms); // Show status message for 5s #endif #endif diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 9d6d235e96d..32d747da430 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -469,6 +469,7 @@ public: #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) static millis_t next_filament_display; + static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; } #endif #if HAS_TOUCH_SLEEP @@ -493,6 +494,11 @@ public: static void status_screen(); + #else + + static void quick_feedback(const bool=true) {} + static void completion_feedback(const bool=true) {} + #endif #if HAS_MARLINUI_U8GLIB @@ -803,5 +809,7 @@ private: #define LCD_MESSAGE_F(S) ui.set_status(F(S)) #define LCD_MESSAGE(M) ui.set_status(GET_TEXT_F(M)) +#define LCD_MESSAGE_MIN(M) ui.set_status(GET_TEXT_F(M), -1) +#define LCD_MESSAGE_MAX(M) ui.set_status(GET_TEXT_F(M), 99) #define LCD_ALERTMESSAGE_F(S) ui.set_alert_status(F(S)) #define LCD_ALERTMESSAGE(M) ui.set_alert_status(GET_TEXT_F(M)) diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index a33edd1659b..3b04de9eb00 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -68,8 +68,8 @@ void _man_probe_pt(const xy_pos_t &xy) { float lcd_probe_pt(const xy_pos_t &xy) { _man_probe_pt(xy); ui.defer_status_screen(); - TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR))); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Delta Calibration in progress"))); + TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_DELTA_CALIBRATION_IN_PROGRESS), FPSTR(CONTINUE_STR))); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_DELTA_CALIBRATION_IN_PROGRESS))); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); ui.goto_previous_screen_no_defer(); return current_position.z; diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index ca5b940c5d1..8ebc8c61f54 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1706,7 +1706,7 @@ void MarlinSettings::postprocess() { stored_ver[1] = '\0'; } DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); - TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION)); + LCD_MESSAGE(MSG_ERR_EEPROM_VERSION); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION))); IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version()); @@ -2662,7 +2662,7 @@ void MarlinSettings::postprocess() { else if (working_crc != stored_crc) { eeprom_error = true; DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); - TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_CRC)); + LCD_MESSAGE(MSG_ERR_EEPROM_CRC); TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC))); IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc()); }