🎨 Format, use status macros
This commit is contained in:
parent
5632ad65f5
commit
9324132a40
@ -1339,13 +1339,13 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
|
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
|
||||||
// The timeout (in ms) to return to the status screen from sub-menus
|
// The timeout to return to the status screen from sub-menus
|
||||||
//#define LCD_TIMEOUT_TO_STATUS 15000
|
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)
|
||||||
|
|
||||||
#if ENABLED(SHOW_BOOTSCREEN)
|
#if ENABLED(SHOW_BOOTSCREEN)
|
||||||
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
|
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
|
||||||
#if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
|
#if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
|
||||||
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
|
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3464,7 +3464,7 @@
|
|||||||
#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power
|
#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power
|
||||||
#if ENABLED(SPINDLE_LASER_USE_PWM)
|
#if ENABLED(SPINDLE_LASER_USE_PWM)
|
||||||
#define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
|
#define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
|
||||||
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32 and LPC)
|
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32, and LPC)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11
|
//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
void GcodeSuite::M117() {
|
void GcodeSuite::M117() {
|
||||||
|
|
||||||
if (parser.string_arg && parser.string_arg[0])
|
if (parser.string_arg && parser.string_arg[0])
|
||||||
ui.set_status(parser.string_arg);
|
ui.set_status(parser.string_arg, true);
|
||||||
else
|
else
|
||||||
ui.reset_status();
|
ui.reset_status();
|
||||||
|
|
||||||
|
@ -82,10 +82,9 @@ void GcodeSuite::M140_M190(const bool isM190) {
|
|||||||
if (!got_temp) return;
|
if (!got_temp) return;
|
||||||
|
|
||||||
thermalManager.setTargetBed(temp);
|
thermalManager.setTargetBed(temp);
|
||||||
|
thermalManager.isHeatingBed() ? LCD_MESSAGE(MSG_BED_HEATING) : LCD_MESSAGE(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
|
||||||
|
|
||||||
// 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));
|
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190));
|
||||||
|
|
||||||
if (isM190)
|
if (isM190)
|
||||||
|
@ -49,7 +49,7 @@ void GcodeSuite::M192() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const celsius_t target_temp = parser.value_celsius();
|
const celsius_t target_temp = parser.value_celsius();
|
||||||
ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
|
thermalManager.isProbeBelowTemp(target_temp) ? LCD_MESSAGE(MSG_PROBE_HEATING) : LCD_MESSAGE(MSG_PROBE_COOLING);
|
||||||
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
|
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2304,7 +2304,7 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) {
|
|||||||
inLev = true;
|
inLev = true;
|
||||||
zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW);
|
zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW);
|
||||||
if (isnan(zval))
|
if (isnan(zval))
|
||||||
ui.set_status(F("Position Not Reachable, check offsets"));
|
LCD_MESSAGE_F("Position Not Reachable, check offsets");
|
||||||
else {
|
else {
|
||||||
sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"),
|
sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"),
|
||||||
dtostrf(xpos, 1, 1, str_1),
|
dtostrf(xpos, 1, 1, str_1),
|
||||||
@ -2336,7 +2336,7 @@ void TramC () { Tram(4); }
|
|||||||
void Trammingwizard() {
|
void Trammingwizard() {
|
||||||
bed_mesh_t zval = {0};
|
bed_mesh_t zval = {0};
|
||||||
if (HMI_data.FullManualTramming) {
|
if (HMI_data.FullManualTramming) {
|
||||||
ui.set_status(F("Disable manual tramming"));
|
LCD_MESSAGE_F("Disable manual tramming");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
zval[0][0] = Tram(0);
|
zval[0][0] = Tram(0);
|
||||||
|
@ -593,7 +593,7 @@ void MarlinUI::init() {
|
|||||||
// share the same line on the display.
|
// share the same line on the display.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if DISABLED(PROGRESS_MSG_ONCE) || (PROGRESS_MSG_EXPIRE > 0)
|
#if DISABLED(PROGRESS_MSG_ONCE) || PROGRESS_MSG_EXPIRE > 0
|
||||||
#define GOT_MS
|
#define GOT_MS
|
||||||
const millis_t ms = millis();
|
const millis_t ms = millis();
|
||||||
#endif
|
#endif
|
||||||
@ -1420,6 +1420,7 @@ void MarlinUI::init() {
|
|||||||
#if SERVICE_INTERVAL_3 > 0
|
#if SERVICE_INTERVAL_3 > 0
|
||||||
static PGMSTR(service3, "> " SERVICE_NAME_3 "!");
|
static PGMSTR(service3, "> " SERVICE_NAME_3 "!");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FSTR_P msg;
|
FSTR_P msg;
|
||||||
if (printingIsPaused())
|
if (printingIsPaused())
|
||||||
msg = GET_TEXT_F(MSG_PRINT_PAUSED);
|
msg = GET_TEXT_F(MSG_PRINT_PAUSED);
|
||||||
@ -1450,13 +1451,18 @@ void MarlinUI::init() {
|
|||||||
set_status(msg, -1);
|
set_status(msg, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Status with a fixed string and alert level.
|
||||||
|
* @param fstr A constant F-string to set as the status.
|
||||||
|
* @param level Alert level. Negative to ignore and reset the level. Non-zero never expires.
|
||||||
|
*/
|
||||||
void MarlinUI::set_status(FSTR_P const fstr, int8_t level) {
|
void MarlinUI::set_status(FSTR_P const fstr, int8_t level) {
|
||||||
PGM_P const pstr = FTOP(fstr);
|
// Alerts block lower priority messages
|
||||||
if (level < 0) level = alert_level = 0;
|
if (level < 0) level = alert_level = 0;
|
||||||
if (level < alert_level) return;
|
if (level < alert_level) return;
|
||||||
alert_level = level;
|
alert_level = level;
|
||||||
|
|
||||||
TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(fstr));
|
PGM_P const pstr = FTOP(fstr);
|
||||||
|
|
||||||
// Since the message is encoded in UTF8 it must
|
// Since the message is encoded in UTF8 it must
|
||||||
// only be cut on a character boundary.
|
// only be cut on a character boundary.
|
||||||
@ -1476,6 +1482,8 @@ void MarlinUI::init() {
|
|||||||
strncpy_P(status_message, pstr, maxLen);
|
strncpy_P(status_message, pstr, maxLen);
|
||||||
status_message[maxLen] = '\0';
|
status_message[maxLen] = '\0';
|
||||||
|
|
||||||
|
TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(fstr));
|
||||||
|
|
||||||
finish_status(level > 0);
|
finish_status(level > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,10 +39,6 @@
|
|||||||
#define HAS_ENCODER_ACTION 1
|
#define HAS_ENCODER_ACTION 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_STATUS_MESSAGE
|
|
||||||
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if E_MANUAL > 1
|
#if E_MANUAL > 1
|
||||||
#define MULTI_E_MANUAL 1
|
#define MULTI_E_MANUAL 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,9 +29,8 @@
|
|||||||
#include "stepper.h"
|
#include "stepper.h"
|
||||||
#include "planner.h"
|
#include "planner.h"
|
||||||
#include "temperature.h"
|
#include "temperature.h"
|
||||||
|
|
||||||
#include "../gcode/gcode.h"
|
#include "../gcode/gcode.h"
|
||||||
|
#include "../lcd/marlinui.h"
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if IS_SCARA
|
#if IS_SCARA
|
||||||
@ -51,10 +50,6 @@
|
|||||||
#include "../feature/bltouch.h"
|
#include "../feature/bltouch.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_STATUS_MESSAGE
|
|
||||||
#include "../lcd/marlinui.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_FILAMENT_SENSOR
|
#if HAS_FILAMENT_SENSOR
|
||||||
#include "../feature/runout.h"
|
#include "../feature/runout.h"
|
||||||
#endif
|
#endif
|
||||||
@ -1325,7 +1320,7 @@ void prepare_line_to_destination() {
|
|||||||
);
|
);
|
||||||
SERIAL_ECHO_START();
|
SERIAL_ECHO_START();
|
||||||
SERIAL_ECHOLN(msg);
|
SERIAL_ECHOLN(msg);
|
||||||
TERN_(HAS_STATUS_MESSAGE, ui.set_status(msg));
|
ui.set_status(msg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -313,9 +313,9 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
|||||||
ui.set_status(ds_str, 99);
|
ui.set_status(ds_str, 99);
|
||||||
SERIAL_ECHOLNF(deploy ? GET_EN_TEXT_F(MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F(MSG_MANUAL_STOW));
|
SERIAL_ECHOLNF(deploy ? GET_EN_TEXT_F(MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F(MSG_MANUAL_STOW));
|
||||||
|
|
||||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
|
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, ds_str, FPSTR(CONTINUE_STR)));
|
||||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe")));
|
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(ds_str));
|
||||||
TERN_(DWIN_LCD_PROUI, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR)));
|
TERN_(DWIN_LCD_PROUI, DWIN_Popup_Confirm(ICON_BLTouch, ds_str, FPSTR(CONTINUE_STR)));
|
||||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||||
ui.reset_status();
|
ui.reset_status();
|
||||||
|
|
||||||
|
@ -651,7 +651,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||||||
|
|
||||||
// PID Tuning loop
|
// PID Tuning loop
|
||||||
wait_for_heatup = true; // Can be interrupted with M108
|
wait_for_heatup = true; // Can be interrupted with M108
|
||||||
TERN_(HAS_STATUS_MESSAGE, ui.set_status(F("Wait for heat up...")));
|
LCD_MESSAGE(MSG_HEATING);
|
||||||
while (wait_for_heatup) {
|
while (wait_for_heatup) {
|
||||||
|
|
||||||
const millis_t ms = millis();
|
const millis_t ms = millis();
|
||||||
|
@ -458,7 +458,7 @@ void CardReader::mount() {
|
|||||||
cdroot();
|
cdroot();
|
||||||
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) || PIN_EXISTS(SD_DETECT)
|
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) || PIN_EXISTS(SD_DETECT)
|
||||||
else if (marlin_state != MF_INITIALIZING)
|
else if (marlin_state != MF_INITIALIZING)
|
||||||
ui.set_status(GET_TEXT_F(MSG_MEDIA_INIT_FAIL), -1);
|
LCD_ALERTMESSAGE(MSG_MEDIA_INIT_FAIL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui.refresh();
|
ui.refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user