More advanced pause tweaks (#12356)
* Followup to LCD_TIMEOUT_TO_STATUS=0 * Make continuous purge screen fit 20x4 * Unify purge message modes * Preserve last-set pause header mode
This commit is contained in:
@ -1131,6 +1131,10 @@
|
||||
#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for")
|
||||
#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge")
|
||||
#endif
|
||||
#ifndef MSG_FILAMENT_CHANGE_CONT_PURGE_1
|
||||
#define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Click to finish")
|
||||
#define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("filament purge")
|
||||
#endif
|
||||
#ifndef MSG_FILAMENT_CHANGE_RESUME_1
|
||||
#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print")
|
||||
#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume...")
|
||||
@ -1160,6 +1164,9 @@
|
||||
#ifndef MSG_FILAMENT_CHANGE_PURGE_1
|
||||
#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...")
|
||||
#endif
|
||||
#ifndef MSG_FILAMENT_CHANGE_CONT_PURGE_1
|
||||
#define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Click to finish")
|
||||
#endif
|
||||
#ifndef MSG_FILAMENT_CHANGE_RESUME_1
|
||||
#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...")
|
||||
#endif
|
||||
|
@ -59,7 +59,11 @@ typedef struct {
|
||||
} menuPosition;
|
||||
menuPosition screen_history[6];
|
||||
uint8_t screen_history_depth = 0;
|
||||
bool screen_changed, defer_return_to_status;
|
||||
bool screen_changed;
|
||||
|
||||
#if LCD_TIMEOUT_TO_STATUS
|
||||
bool defer_return_to_status;
|
||||
#endif
|
||||
|
||||
// Value Editing
|
||||
PGM_P editLabel;
|
||||
@ -97,10 +101,12 @@ void lcd_goto_previous_menu() {
|
||||
lcd_return_to_status();
|
||||
}
|
||||
|
||||
void lcd_goto_previous_menu_no_defer() {
|
||||
defer_return_to_status = false;
|
||||
lcd_goto_previous_menu();
|
||||
}
|
||||
#if LCD_TIMEOUT_TO_STATUS
|
||||
void lcd_goto_previous_menu_no_defer() {
|
||||
set_defer_return_to_status(false);
|
||||
lcd_goto_previous_menu();
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////
|
||||
/////////// Common Menu Actions ////////////
|
||||
@ -234,7 +240,7 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
|
||||
currentScreen = screen;
|
||||
encoderPosition = encoder;
|
||||
if (screen == lcd_status_screen) {
|
||||
defer_return_to_status = false;
|
||||
set_defer_return_to_status(false);
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
ubl.lcd_map_control = false;
|
||||
#endif
|
||||
@ -343,7 +349,7 @@ void lcd_completion_feedback(const bool good/*=true*/) {
|
||||
|
||||
void lcd_babystep_zoffset() {
|
||||
if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
const bool do_probe = (active_extruder == 0);
|
||||
#else
|
||||
|
@ -35,9 +35,13 @@ void scroll_screen(const uint8_t limit, const bool is_menu);
|
||||
bool use_click();
|
||||
bool printer_busy();
|
||||
void lcd_completion_feedback(const bool good=true);
|
||||
void lcd_goto_previous_menu();
|
||||
void lcd_goto_previous_menu_no_defer();
|
||||
void lcd_save_previous_screen();
|
||||
void lcd_goto_previous_menu();
|
||||
#if LCD_TIMEOUT_TO_STATUS
|
||||
void lcd_goto_previous_menu_no_defer();
|
||||
#else
|
||||
#define lcd_goto_previous_menu_no_defer() lcd_goto_previous_menu()
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////
|
||||
////////// Menu Item Numeric Types /////////
|
||||
|
@ -91,7 +91,7 @@ void _lcd_level_bed_corners_homing() {
|
||||
}
|
||||
|
||||
void _lcd_level_bed_corners() {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
if (!all_axes_known()) {
|
||||
set_all_unhomed();
|
||||
enqueue_and_echo_commands_P(PSTR("G28"));
|
||||
|
@ -191,7 +191,7 @@
|
||||
// Step 2: Continue Bed Leveling...
|
||||
//
|
||||
void _lcd_level_bed_continue() {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
set_all_unhomed();
|
||||
lcd_goto_screen(_lcd_level_bed_homing);
|
||||
enqueue_and_echo_commands_P(PSTR("G28"));
|
||||
|
@ -50,7 +50,7 @@ void _man_probe_pt(const float &rx, const float &ry) {
|
||||
float lcd_probe_pt(const float &rx, const float &ry) {
|
||||
_man_probe_pt(rx, ry);
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
wait_for_user = true;
|
||||
while (wait_for_user) idle();
|
||||
KEEPALIVE_STATE(IN_HANDLER);
|
||||
|
@ -458,47 +458,40 @@ void lcd_advanced_pause_resume_message() {
|
||||
}
|
||||
|
||||
void lcd_advanced_pause_purge_message() {
|
||||
START_SCREEN();
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_PURGE_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2);
|
||||
#ifdef MSG_FILAMENT_CHANGE_PURGE_3
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3);
|
||||
_lcd_advanced_pause_message(
|
||||
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
|
||||
PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_1)
|
||||
#ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_2
|
||||
, PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_2)
|
||||
#ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_3
|
||||
, PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_3)
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
PSTR(MSG_FILAMENT_CHANGE_PURGE_1)
|
||||
#ifdef MSG_FILAMENT_CHANGE_PURGE_2
|
||||
, PSTR(MSG_FILAMENT_CHANGE_PURGE_2)
|
||||
#ifdef MSG_FILAMENT_CHANGE_PURGE_3
|
||||
, PSTR(MSG_FILAMENT_CHANGE_PURGE_3)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
|
||||
#define _PURGE_BASE 3
|
||||
#else
|
||||
#define _PURGE_BASE 2
|
||||
#endif
|
||||
#if (_PURGE_BASE + defined(MSG_FILAMENT_CHANGE_PURGE_2) + defined(MSG_FILAMENT_CHANGE_PURGE_3)) < LCD_HEIGHT - 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
|
||||
STATIC_ITEM(MSG_USERWAIT);
|
||||
#endif
|
||||
END_SCREEN();
|
||||
);
|
||||
}
|
||||
|
||||
FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) {
|
||||
switch (message) {
|
||||
case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_WAITING: return lcd_advanced_pause_waiting_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message;
|
||||
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
|
||||
case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE:
|
||||
#else
|
||||
case ADVANCED_PAUSE_MESSAGE_PURGE:
|
||||
#endif
|
||||
return lcd_advanced_pause_purge_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_HEAT: return lcd_advanced_pause_heat_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_HEATING: return lcd_advanced_pause_heating_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR;
|
||||
return menu_advanced_pause_option;
|
||||
case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_WAITING: return lcd_advanced_pause_waiting_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_HEAT: return lcd_advanced_pause_heat_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_HEATING: return lcd_advanced_pause_heating_message;
|
||||
case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR;
|
||||
return menu_advanced_pause_option;
|
||||
case ADVANCED_PAUSE_MESSAGE_STATUS:
|
||||
default: break;
|
||||
}
|
||||
@ -507,14 +500,14 @@ FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message)
|
||||
|
||||
void lcd_advanced_pause_show_message(
|
||||
const AdvancedPauseMessage message,
|
||||
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/,
|
||||
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_SAME*/,
|
||||
const uint8_t extruder/*=active_extruder*/
|
||||
) {
|
||||
advanced_pause_mode = mode;
|
||||
if (mode != ADVANCED_PAUSE_MODE_SAME) advanced_pause_mode = mode;
|
||||
hotend_status_extruder = extruder;
|
||||
const screenFunc_t next_screen = ap_message_screen(message);
|
||||
if (next_screen) {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
lcd_goto_screen(next_screen);
|
||||
}
|
||||
else
|
||||
|
@ -95,7 +95,7 @@ static void lcd_power_loss_recovery_cancel() {
|
||||
}
|
||||
|
||||
void menu_job_recovery() {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
START_MENU();
|
||||
STATIC_ITEM(MSG_POWER_LOSS_RECOVERY);
|
||||
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume);
|
||||
|
@ -241,7 +241,7 @@ inline void lcd_move_e() { _lcd_move_e(); }
|
||||
screenFunc_t _manual_move_func_ptr;
|
||||
|
||||
void _goto_manual_move(const float scale) {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
move_menu_scale = scale;
|
||||
lcd_goto_screen(_manual_move_func_ptr);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ void lcd_sd_updir() {
|
||||
#endif
|
||||
|
||||
lcd_goto_screen(menu_sdcard, last_sdfile_encoderPosition);
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
last_sdfile_encoderPosition = 0xFFFF;
|
||||
|
||||
#if HAS_GRAPHICAL_LCD
|
||||
|
@ -78,13 +78,13 @@ void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); }
|
||||
void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); }
|
||||
void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; defer_return_to_status = true; }
|
||||
void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; }
|
||||
void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; set_defer_return_to_status(true); }
|
||||
void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; set_defer_return_to_status(true); }
|
||||
#endif
|
||||
|
||||
#if DISABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); }
|
||||
void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; defer_return_to_status = true; }
|
||||
void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; set_defer_return_to_status(true); }
|
||||
#endif
|
||||
|
||||
#endif // BABYSTEPPING
|
||||
|
@ -51,7 +51,7 @@ float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5
|
||||
static int16_t ubl_encoderPosition = 0;
|
||||
|
||||
static void _lcd_mesh_fine_tune(PGM_P msg) {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
if (ubl.encoder_diff) {
|
||||
ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1;
|
||||
ubl.encoder_diff = 0;
|
||||
@ -74,7 +74,7 @@ static void _lcd_mesh_fine_tune(PGM_P msg) {
|
||||
}
|
||||
|
||||
void _lcd_mesh_edit_NOP() {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
}
|
||||
|
||||
float lcd_mesh_edit() {
|
||||
@ -408,7 +408,7 @@ void _lcd_ubl_storage_mesh() {
|
||||
void _lcd_ubl_output_map_lcd();
|
||||
|
||||
void _lcd_ubl_map_homing() {
|
||||
defer_return_to_status = true;
|
||||
set_defer_return_to_status(true);
|
||||
_lcd_draw_homing();
|
||||
if (all_axes_homed()) {
|
||||
ubl.lcd_map_control = true; // Return to the map screen
|
||||
|
@ -281,7 +281,14 @@
|
||||
extern screenFunc_t currentScreen;
|
||||
void lcd_goto_screen(const screenFunc_t screen, const uint32_t encoder=0);
|
||||
|
||||
extern bool lcd_clicked, defer_return_to_status;
|
||||
extern bool lcd_clicked;
|
||||
#if LCD_TIMEOUT_TO_STATUS
|
||||
extern bool defer_return_to_status;
|
||||
inline void set_defer_return_to_status(const bool defer) { defer_return_to_status = defer; }
|
||||
#else
|
||||
constexpr bool defer_return_to_status = false;
|
||||
#define set_defer_return_to_status(D) NOOP
|
||||
#endif
|
||||
|
||||
extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
|
||||
extern uint8_t lcd_preheat_fan_speed[2];
|
||||
@ -309,7 +316,7 @@
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
void lcd_advanced_pause_show_message(const AdvancedPauseMessage message,
|
||||
const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT,
|
||||
const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_SAME,
|
||||
const uint8_t extruder=active_extruder);
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user