🎨 Apply F() to status message

This commit is contained in:
Scott Lahteine
2021-09-25 17:05:11 -05:00
committed by Scott Lahteine
parent 433eedd50f
commit 360311f232
44 changed files with 194 additions and 196 deletions

View File

@ -163,7 +163,7 @@ 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_P(GET_TEXT(MSG_G26_CANCELED), 99);
ui.set_status(GET_TEXT_F(MSG_G26_CANCELED), 99);
TERN_(HAS_LCD_MENU, ui.quick_feedback());
ui.wait_for_release();
return true;
@ -323,7 +323,7 @@ typedef struct {
if (bed_temp > 25) {
#if HAS_WIRED_LCD
ui.set_status_P(GET_TEXT(MSG_G26_HEATING_BED), 99);
ui.set_status(GET_TEXT_F(MSG_G26_HEATING_BED), 99);
ui.quick_feedback();
TERN_(HAS_LCD_MENU, ui.capture());
#endif
@ -342,7 +342,7 @@ typedef struct {
// Start heating the active nozzle
#if HAS_WIRED_LCD
ui.set_status_P(GET_TEXT(MSG_G26_HEATING_NOZZLE), 99);
ui.set_status(GET_TEXT_F(MSG_G26_HEATING_NOZZLE), 99);
ui.quick_feedback();
#endif
thermalManager.setTargetHotend(hotend_temp, active_extruder);
@ -372,7 +372,7 @@ typedef struct {
if (prime_flag == -1) { // The user wants to control how much filament gets purged
ui.capture();
ui.set_status_P(GET_TEXT(MSG_G26_MANUAL_PRIME), 99);
ui.set_status(GET_TEXT_F(MSG_G26_MANUAL_PRIME), 99);
ui.chirp();
destination = current_position;
@ -399,7 +399,7 @@ typedef struct {
ui.wait_for_release();
ui.set_status_P(GET_TEXT(MSG_G26_PRIME_DONE), 99);
ui.set_status(GET_TEXT_F(MSG_G26_PRIME_DONE), 99);
ui.quick_feedback();
ui.release();
}
@ -407,7 +407,7 @@ typedef struct {
#endif
{
#if HAS_WIRED_LCD
ui.set_status_P(GET_TEXT(MSG_G26_FIXED_LENGTH), 99);
ui.set_status(GET_TEXT_F(MSG_G26_FIXED_LENGTH), 99);
ui.quick_feedback();
#endif
destination = current_position;
@ -854,7 +854,7 @@ void GcodeSuite::G26() {
} while (--g26_repeats && location.valid());
LEAVE:
ui.set_status_P(GET_TEXT(MSG_G26_LEAVING), -1);
ui.set_status(GET_TEXT_F(MSG_G26_LEAVING), -1);
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, ExtUI::G26_FINISH));
g26.retract_filament(destination);

View File

@ -636,7 +636,7 @@ G29_TYPE GcodeSuite::G29() {
if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue;
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
abl.measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
@ -681,7 +681,7 @@ G29_TYPE GcodeSuite::G29() {
LOOP_L_N(i, 3) {
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing point ", i + 1, "/3.");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1)));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1)));
// Retain the last probe position
abl.probePos = xy_pos_t(points[i]);

View File

@ -152,7 +152,7 @@ void GcodeSuite::G29() {
// After recording the last point, activate home and activate
mbl_probe_index = -1;
SERIAL_ECHOLNPGM("Mesh probing done.");
TERN_(HAS_STATUS_MESSAGE, ui.set_status(GET_TEXT(MSG_MESH_DONE)));
TERN_(HAS_STATUS_MESSAGE, LCD_MESSAGE(MSG_MESH_DONE));
BUZZ(100, 659);
BUZZ(100, 698);
@ -214,7 +214,7 @@ void GcodeSuite::G29() {
if (state == MeshNext) {
SERIAL_ECHOLNPGM("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS);
if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
}
report_current_position();

View File

@ -156,7 +156,7 @@
homeaxis(Z_AXIS);
}
else {
LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
LCD_MESSAGE(MSG_ZPROBE_OUT);
SERIAL_ECHO_MSG(STR_ZPROBE_OUT_SER);
}
}

View File

@ -477,11 +477,11 @@ void GcodeSuite::G33() {
SERIAL_ECHOLNPGM("G33 Auto Calibrate");
// Report settings
PGM_P const checkingac = PSTR("Checking... AC");
SERIAL_ECHOPGM_P(checkingac);
FSTR_P const checkingac = F("Checking... AC");
SERIAL_ECHOF(checkingac);
if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
SERIAL_EOL();
ui.set_status_P(checkingac);
ui.set_status(checkingac);
print_calibration_settings(_endstop_results, _angle_results);

View File

@ -31,7 +31,7 @@
#include "../../module/stepper.h"
#include "../../module/planner.h"
#include "../../module/probe.h"
#include "../../lcd/marlinui.h" // for LCD_MESSAGEPGM
#include "../../lcd/marlinui.h" // for LCD_MESSAGE
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
@ -229,7 +229,7 @@ void GcodeSuite::G34() {
const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false);
if (isnan(z_probed_height)) {
SERIAL_ECHOLNPGM("Probing failed");
LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED);
LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
err_break = true;
break;
}
@ -328,7 +328,7 @@ void GcodeSuite::G34() {
auto decreasing_accuracy = [](const_float_t v1, const_float_t v2) {
if (v1 < v2 * 0.7f) {
SERIAL_ECHOLNPGM("Decreasing Accuracy Detected.");
LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY);
LCD_MESSAGE(MSG_DECREASING_ACCURACY);
return true;
}
return false;
@ -411,7 +411,7 @@ void GcodeSuite::G34() {
if (success_break) {
SERIAL_ECHOLNPGM("Target accuracy achieved.");
LCD_MESSAGEPGM(MSG_ACCURACY_ACHIEVED);
LCD_MESSAGE(MSG_ACCURACY_ACHIEVED);
break;
}

View File

@ -351,7 +351,7 @@ void GcodeSuite::M192() {
}
const celsius_t target_temp = parser.value_celsius();
ui.set_status_P(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT(MSG_PROBE_HEATING) : GET_TEXT(MSG_PROBE_COOLING));
ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
}

View File

@ -79,7 +79,7 @@ void GcodeSuite::M48() {
};
if (!probe.can_reach(test_position)) {
ui.set_status_P(GET_TEXT(MSG_M48_OUT_OF_BOUNDS), 99);
ui.set_status(GET_TEXT_F(MSG_M48_OUT_OF_BOUNDS), 99);
SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
return;
}
@ -144,7 +144,7 @@ void GcodeSuite::M48() {
LOOP_L_N(n, n_samples) {
#if HAS_STATUS_MESSAGE
// Display M48 progress in the status bar
ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
#endif
// When there are "legs" of movement move around the point before probing
@ -260,7 +260,7 @@ void GcodeSuite::M48() {
#if HAS_STATUS_MESSAGE
// Display M48 results in the status bar
char sigma_str[8];
ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
ui.status_printf(0, F(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
#endif
}

View File

@ -136,7 +136,7 @@ void GcodeSuite::M17() {
}
}
else {
LCD_MESSAGEPGM(MSG_NO_MOVE);
LCD_MESSAGE(MSG_NO_MOVE);
stepper.enable_all_steppers();
}
}

View File

@ -25,7 +25,7 @@
#include "../../module/temperature.h"
#include "../../module/planner.h" // for planner.finish_and_disable
#include "../../module/printcounter.h" // for print_job_timer.stop
#include "../../lcd/marlinui.h" // for LCD_MESSAGEPGM_P
#include "../../lcd/marlinui.h" // for LCD_MESSAGE_F
#include "../../inc/MarlinConfig.h"
@ -95,5 +95,5 @@ void GcodeSuite::M81() {
powerManager.power_off_soon();
#endif
LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF "."));
LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF ".");
}

View File

@ -91,7 +91,7 @@ void GcodeSuite::M428() {
diff[i] = -current_position[i];
if (!WITHIN(diff[i], -20, 20)) {
SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR);
LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!"));
LCD_ALERTMESSAGE_F("Err: Too far!");
BUZZ(200, 40);
return;
}
@ -99,7 +99,7 @@ void GcodeSuite::M428() {
LOOP_LINEAR_AXES(i) set_home_offset((AxisEnum)i, diff[i]);
report_current_position();
LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED);
LCD_MESSAGE(MSG_HOME_OFFSETS_APPLIED);
BUZZ(100, 659);
BUZZ(100, 698);
}

View File

@ -59,7 +59,7 @@ void GcodeSuite::M0_M1() {
if (parser.string_arg)
ui.set_status(parser.string_arg, true);
else {
LCD_MESSAGEPGM(MSG_USERWAIT);
LCD_MESSAGE(MSG_USERWAIT);
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
ui.reset_progress_bar_timeout();
#endif

View File

@ -38,7 +38,7 @@ void GcodeSuite::G4() {
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
#endif
if (!ui.has_status()) LCD_MESSAGEPGM(MSG_DWELL);
if (!ui.has_status()) LCD_MESSAGE(MSG_DWELL);
dwell(dwell_ms);
}

View File

@ -513,7 +513,7 @@ void GCodeQueue::get_serial_commands() {
TERN_(BEZIER_CURVE_SUPPORT, case 5:)
PORT_REDIRECT(SERIAL_PORTMASK(p)); // Reply to the serial port that sent the command
SERIAL_ECHOLNPGM(STR_ERR_STOPPED);
LCD_MESSAGEPGM(MSG_STOPPED);
LCD_MESSAGE(MSG_STOPPED);
break;
}
}

View File

@ -83,7 +83,7 @@ void GcodeSuite::M140_M190(const bool isM190) {
thermalManager.setTargetBed(temp);
ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));
ui.set_status(thermalManager.isHeatingBed() ? GET_TEXT_F(MSG_BED_HEATING) : GET_TEXT_F(MSG_BED_COOLING));
// with PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190));

View File

@ -69,7 +69,7 @@ void GcodeSuite::M191() {
const bool is_heating = thermalManager.isHeatingChamber();
if (is_heating || !no_wait_for_cooling) {
ui.set_status_P(is_heating ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING));
ui.set_status(is_heating ? GET_TEXT_F(MSG_CHAMBER_HEATING) : GET_TEXT_F(MSG_CHAMBER_COOLING));
thermalManager.wait_for_chamber(false);
}
}

View File

@ -58,7 +58,7 @@ void GcodeSuite::M193() {
cooler.enable();
thermalManager.setTargetCooler(parser.value_celsius());
if (thermalManager.isLaserCooling()) {
ui.set_status_P(GET_TEXT(MSG_LASER_COOLING));
LCD_MESSAGE(MSG_LASER_COOLING);
thermalManager.wait_for_cooler(true);
}
}

View File

@ -85,7 +85,7 @@ void GcodeSuite::M303() {
KEEPALIVE_STATE(NOT_BUSY);
#endif
LCD_MESSAGEPGM(MSG_PID_AUTOTUNE);
LCD_MESSAGE(MSG_PID_AUTOTUNE);
thermalManager.PID_autotune(temp, hid, c, u);
ui.reset_status();
}