Skip to content

Commit 9a1c025

Browse files
committed
πŸ§‘β€πŸ’» Status Message cleanup
1 parent 48b712f commit 9a1c025

File tree

9 files changed

+43
-40
lines changed

9 files changed

+43
-40
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,10 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
978978
manage_response(false, false);
979979

980980
if (recover) {
981-
LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
981+
LCD_MESSAGE(MSG_MMU2_REMOVE_AND_CLICK);
982982
mmu2_attn_buzz();
983-
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
984-
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
983+
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_MMU2_EJECT_RECOVER), FPSTR(CONTINUE_STR)));
984+
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_MMU2_EJECT_RECOVER)));
985985
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
986986
mmu2_attn_buzz(true);
987987

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

+8-7
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);
@@ -465,7 +465,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
465465

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

470470
#if ENABLED(DUAL_X_CARRIAGE)
471471
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
554554

555555
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
556556

557-
TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING)));
558-
559-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING));
557+
LCD_MESSAGE(MSG_REHEATING);
560558

561559
// Re-enable the heaters if they timed out
562560
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
573571
HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
574572

575573
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
576-
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)));
577-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE));
574+
#if ENABLED(EXTENSIBLE_UI)
575+
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE));
576+
#else
577+
LCD_MESSAGE(MSG_REHEATDONE);
578+
#endif
578579

579580
IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true);
580581

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

+14-22
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

+1-1
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

+3-1
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ namespace Language_en {
639639
LSTR MSG_CHAMBER_COOLING = _UxGT("Chamber Cooling...");
640640
LSTR MSG_LASER_COOLING = _UxGT("Laser Cooling...");
641641
LSTR MSG_DELTA_CALIBRATE = _UxGT("Delta Calibration");
642+
LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Delta Calibration in progress");
642643
LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Calibrate X");
643644
LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrate Y");
644645
LSTR MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrate Z");
@@ -749,7 +750,8 @@ namespace Language_en {
749750
LSTR MSG_MMU2_FILAMENT_N = _UxGT("Filament ~");
750751
LSTR MSG_MMU2_RESET = _UxGT("Reset MMU");
751752
LSTR MSG_MMU2_RESETTING = _UxGT("MMU Resetting...");
752-
LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("Remove, click");
753+
LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("MMU2 Eject Recover");
754+
LSTR MSG_MMU2_REMOVE_AND_CLICK = _UxGT("Remove and click...");
753755

754756
LSTR MSG_MIX = _UxGT("Mix");
755757
LSTR MSG_MIX_COMPONENT_N = _UxGT("Component =");

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void MarlinUI::init() {
671671
#if HAS_MARLINUI_MENU
672672
if (use_click()) {
673673
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
674-
next_filament_display = millis() + 5000UL; // Show status message for 5s
674+
pause_filament_display();
675675
#endif
676676
goto_screen(menu_main);
677677
reinit_lcd(); // Revive a noisy shared SPI LCD
@@ -1592,7 +1592,7 @@ void MarlinUI::init() {
15921592
#endif
15931593

15941594
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
1595-
next_filament_display = ms + 5000UL; // Show status message for 5s
1595+
pause_filament_display(ms); // Show status message for 5s
15961596
#endif
15971597

15981598
#endif

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

+8
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ class MarlinUI {
469469

470470
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
471471
static millis_t next_filament_display;
472+
static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; }
472473
#endif
473474

474475
#if HAS_TOUCH_SLEEP
@@ -493,6 +494,11 @@ class MarlinUI {
493494

494495
static void status_screen();
495496

497+
#else
498+
499+
static void quick_feedback(const bool=true) {}
500+
static void completion_feedback(const bool=true) {}
501+
496502
#endif
497503

498504
#if HAS_MARLINUI_U8GLIB
@@ -803,5 +809,7 @@ class MarlinUI {
803809

804810
#define LCD_MESSAGE_F(S) ui.set_status(F(S))
805811
#define LCD_MESSAGE(M) ui.set_status(GET_TEXT_F(M))
812+
#define LCD_MESSAGE_MIN(M) ui.set_status(GET_TEXT_F(M), -1)
813+
#define LCD_MESSAGE_MAX(M) ui.set_status(GET_TEXT_F(M), 99)
806814
#define LCD_ALERTMESSAGE_F(S) ui.set_alert_status(F(S))
807815
#define LCD_ALERTMESSAGE(M) ui.set_alert_status(GET_TEXT_F(M))

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

+2-2
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ void MarlinSettings::postprocess() {
17061706
stored_ver[1] = '\0';
17071707
}
17081708
DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1709-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION));
1709+
LCD_MESSAGE(MSG_ERR_EEPROM_VERSION);
17101710
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION)));
17111711

17121712
IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version());
@@ -2662,7 +2662,7 @@ void MarlinSettings::postprocess() {
26622662
else if (working_crc != stored_crc) {
26632663
eeprom_error = true;
26642664
DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2665-
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_CRC));
2665+
LCD_MESSAGE(MSG_ERR_EEPROM_CRC);
26662666
TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC)));
26672667
IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc());
26682668
}

0 commit comments

Comments
Β (0)