Skip to content

Commit d2e84e8

Browse files
committed
πŸ§‘β€πŸ’» Status Message cleanup
1 parent 3340491 commit d2e84e8

File tree

9 files changed

+43
-40
lines changed

9 files changed

+43
-40
lines changed

β€ŽMarlin/src/feature/mmu/mmu2.cppβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,10 +979,10 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
979979
manage_response(false, false);
980980

981981
if (recover) {
982-
LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
982+
LCD_MESSAGE(MSG_MMU2_REMOVE_AND_CLICK);
983983
mmu2_attn_buzz();
984-
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
985-
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
984+
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_MMU2_EJECT_RECOVER), FPSTR(CONTINUE_STR)));
985+
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_MMU2_EJECT_RECOVER)));
986986
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
987987
mmu2_attn_buzz(true);
988988

β€ŽMarlin/src/feature/pause.cppβ€Ž

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
201201
KEEPALIVE_STATE(PAUSED_FOR_USER);
202202
wait_for_user = true; // LCD click or M108 will clear this
203203

204-
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Load Filament")));
204+
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENTLOAD)));
205205

206206
#if ENABLED(HOST_PROMPT_SUPPORT)
207207
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
@@ -460,7 +460,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
460460

461461
// If axes don't need to home then the nozzle can park
462462
if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move
463-
TERN_(DWIN_LCD_PROUI, if (!do_park) ui.set_status(GET_TEXT_F(MSG_PARK_FAILED)));
463+
if (!do_park) LCD_MESSAGE(MSG_PARK_FAILED);
464464

465465
#if ENABLED(DUAL_X_CARRIAGE)
466466
const int8_t saved_ext = active_extruder;
@@ -549,9 +549,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
549549

550550
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
551551

552-
TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING)));
553-
554-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING));
552+
LCD_MESSAGE(MSG_REHEATING);
555553

556554
// Re-enable the heaters if they timed out
557555
HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
@@ -568,8 +566,11 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
568566
HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
569567

570568
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
571-
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)));
572-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE));
569+
#if ENABLED(EXTENSIBLE_UI)
570+
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE));
571+
#else
572+
LCD_MESSAGE(MSG_REHEATDONE);
573+
#endif
573574

574575
IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true);
575576

β€ŽMarlin/src/gcode/bedlevel/G26.cppβ€Ž

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ float g26_random_deviation = 0.0;
162162
*/
163163
bool user_canceled() {
164164
if (!ui.button_pressed()) return false; // Return if the button isn't pressed
165-
ui.set_status(GET_TEXT_F(MSG_G26_CANCELED), 99);
166-
TERN_(HAS_MARLINUI_MENU, ui.quick_feedback());
165+
LCD_MESSAGE_MAX(MSG_G26_CANCELED);
166+
ui.quick_feedback();
167167
ui.wait_for_release();
168168
return true;
169169
}
@@ -321,11 +321,9 @@ typedef struct {
321321
#if HAS_HEATED_BED
322322

323323
if (bed_temp > 25) {
324-
#if HAS_WIRED_LCD
325-
ui.set_status(GET_TEXT_F(MSG_G26_HEATING_BED), 99);
326-
ui.quick_feedback();
327-
TERN_(HAS_MARLINUI_MENU, ui.capture());
328-
#endif
324+
LCD_MESSAGE_MAX(MSG_G26_HEATING_BED);
325+
ui.quick_feedback();
326+
TERN_(HAS_MARLINUI_MENU, ui.capture());
329327
thermalManager.setTargetBed(bed_temp);
330328

331329
// Wait for the temperature to stabilize
@@ -340,20 +338,16 @@ typedef struct {
340338
#endif // HAS_HEATED_BED
341339

342340
// Start heating the active nozzle
343-
#if HAS_WIRED_LCD
344-
ui.set_status(GET_TEXT_F(MSG_G26_HEATING_NOZZLE), 99);
345-
ui.quick_feedback();
346-
#endif
341+
LCD_MESSAGE_MAX(MSG_G26_HEATING_NOZZLE);
342+
ui.quick_feedback();
347343
thermalManager.setTargetHotend(hotend_temp, active_extruder);
348344

349345
// Wait for the temperature to stabilize
350346
if (!thermalManager.wait_for_hotend(active_extruder, true OPTARG(G26_CLICK_CAN_CANCEL, true)))
351347
return G26_ERR;
352348

353-
#if HAS_WIRED_LCD
354-
ui.reset_status();
355-
ui.quick_feedback();
356-
#endif
349+
ui.reset_status();
350+
ui.completion_feedback();
357351

358352
return G26_OK;
359353
}
@@ -371,7 +365,7 @@ typedef struct {
371365

372366
if (prime_flag == -1) { // The user wants to control how much filament gets purged
373367
ui.capture();
374-
ui.set_status(GET_TEXT_F(MSG_G26_MANUAL_PRIME), 99);
368+
LCD_MESSAGE_MAX(MSG_G26_MANUAL_PRIME);
375369
ui.chirp();
376370

377371
destination = current_position;
@@ -398,17 +392,15 @@ typedef struct {
398392

399393
ui.wait_for_release();
400394

401-
ui.set_status(GET_TEXT_F(MSG_G26_PRIME_DONE), 99);
395+
LCD_MESSAGE_MAX(MSG_G26_PRIME_DONE);
402396
ui.quick_feedback();
403397
ui.release();
404398
}
405399
else
406400
#endif
407401
{
408-
#if HAS_WIRED_LCD
409-
ui.set_status(GET_TEXT_F(MSG_G26_FIXED_LENGTH), 99);
410-
ui.quick_feedback();
411-
#endif
402+
LCD_MESSAGE_MAX(MSG_G26_FIXED_LENGTH);
403+
ui.quick_feedback();
412404
destination = current_position;
413405
destination.e += prime_length;
414406
prepare_internal_move_to_destination(fr_slow_e);
@@ -853,7 +845,7 @@ void GcodeSuite::G26() {
853845
} while (--g26_repeats && location.valid());
854846

855847
LEAVE:
856-
ui.set_status(GET_TEXT_F(MSG_G26_LEAVING), -1);
848+
LCD_MESSAGE_MIN(MSG_G26_LEAVING);
857849
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, ExtUI::G26_FINISH));
858850

859851
g26.retract_filament(destination);

β€ŽMarlin/src/gcode/calibrate/M48.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void GcodeSuite::M48() {
8484
};
8585

8686
if (!probe.can_reach(test_position)) {
87-
ui.set_status(GET_TEXT_F(MSG_M48_OUT_OF_BOUNDS), 99);
87+
LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS);
8888
SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
8989
return;
9090
}

β€ŽMarlin/src/lcd/language/language_en.hβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ namespace Language_en {
629629
LSTR MSG_CHAMBER_COOLING = _UxGT("Chamber Cooling...");
630630
LSTR MSG_LASER_COOLING = _UxGT("Laser Cooling...");
631631
LSTR MSG_DELTA_CALIBRATE = _UxGT("Delta Calibration");
632+
LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Delta Calibration in progress");
632633
LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Calibrate X");
633634
LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrate Y");
634635
LSTR MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrate Z");
@@ -739,7 +740,8 @@ namespace Language_en {
739740
LSTR MSG_MMU2_FILAMENT_N = _UxGT("Filament ~");
740741
LSTR MSG_MMU2_RESET = _UxGT("Reset MMU");
741742
LSTR MSG_MMU2_RESETTING = _UxGT("MMU Resetting...");
742-
LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("Remove, click");
743+
LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("MMU2 Eject Recover");
744+
LSTR MSG_MMU2_REMOVE_AND_CLICK = _UxGT("Remove and click...");
743745

744746
LSTR MSG_MIX = _UxGT("Mix");
745747
LSTR MSG_MIX_COMPONENT_N = _UxGT("Component =");

β€ŽMarlin/src/lcd/marlinui.cppβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ void MarlinUI::init() {
666666
#if HAS_MARLINUI_MENU
667667
if (use_click()) {
668668
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
669-
next_filament_display = millis() + 5000UL; // Show status message for 5s
669+
pause_filament_display();
670670
#endif
671671
goto_screen(menu_main);
672672
reinit_lcd(); // Revive a noisy shared SPI LCD
@@ -1581,7 +1581,7 @@ void MarlinUI::init() {
15811581
#endif
15821582

15831583
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
1584-
next_filament_display = ms + 5000UL; // Show status message for 5s
1584+
pause_filament_display(ms); // Show status message for 5s
15851585
#endif
15861586

15871587
#endif

β€ŽMarlin/src/lcd/marlinui.hβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ class MarlinUI {
467467

468468
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
469469
static millis_t next_filament_display;
470+
static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; }
470471
#endif
471472

472473
#if HAS_TOUCH_SLEEP
@@ -491,6 +492,11 @@ class MarlinUI {
491492

492493
static void status_screen();
493494

495+
#else
496+
497+
static void quick_feedback(const bool=true) {}
498+
static void completion_feedback(const bool=true) {}
499+
494500
#endif
495501

496502
#if HAS_MARLINUI_U8GLIB
@@ -801,5 +807,7 @@ class MarlinUI {
801807

802808
#define LCD_MESSAGE_F(S) ui.set_status(F(S))
803809
#define LCD_MESSAGE(M) ui.set_status(GET_TEXT_F(M))
810+
#define LCD_MESSAGE_MIN(M) ui.set_status(GET_TEXT_F(M), -1)
811+
#define LCD_MESSAGE_MAX(M) ui.set_status(GET_TEXT_F(M), 99)
804812
#define LCD_ALERTMESSAGE_F(S) ui.set_alert_status(F(S))
805813
#define LCD_ALERTMESSAGE(M) ui.set_alert_status(GET_TEXT_F(M))

β€ŽMarlin/src/lcd/menu/menu_delta_calibrate.cppβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ void _man_probe_pt(const xy_pos_t &xy) {
6868
float lcd_probe_pt(const xy_pos_t &xy) {
6969
_man_probe_pt(xy);
7070
ui.defer_status_screen();
71-
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
72-
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Delta Calibration in progress")));
71+
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_DELTA_CALIBRATION_IN_PROGRESS), FPSTR(CONTINUE_STR)));
72+
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_DELTA_CALIBRATION_IN_PROGRESS)));
7373
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
7474
ui.goto_previous_screen_no_defer();
7575
return current_position.z;

β€ŽMarlin/src/module/settings.cppβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ void MarlinSettings::postprocess() {
16851685
stored_ver[1] = '\0';
16861686
}
16871687
DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1688-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION));
1688+
LCD_MESSAGE(MSG_ERR_EEPROM_VERSION);
16891689
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION)));
16901690

16911691
IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version());
@@ -2631,7 +2631,7 @@ void MarlinSettings::postprocess() {
26312631
else if (working_crc != stored_crc) {
26322632
eeprom_error = true;
26332633
DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2634-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_CRC));
2634+
LCD_MESSAGE(MSG_ERR_EEPROM_CRC);
26352635
TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC)));
26362636
IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc());
26372637
}

0 commit comments

Comments
Β (0)