|
|
@ -39,10 +39,6 @@ |
|
|
|
#include "../../feature/power_loss_recovery.h" |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(HOST_ACTION_COMMANDS) |
|
|
|
#include "../../feature/host_actions.h" |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_GAMES |
|
|
|
#include "game/game.h" |
|
|
|
#endif |
|
|
@ -50,61 +46,10 @@ |
|
|
|
#define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL)) |
|
|
|
#define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE)) |
|
|
|
|
|
|
|
#if MACHINE_CAN_PAUSE |
|
|
|
|
|
|
|
void lcd_pause_job() { |
|
|
|
ui.synchronize(PSTR(MSG_PAUSE_PRINT)); |
|
|
|
|
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
|
if (recovery.enabled) recovery.save(true, false); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE) |
|
|
|
lcd_pause_show_message(PAUSE_MESSAGE_PAUSING, PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress
|
|
|
|
enqueue_and_echo_commands_P(PSTR("M25 P\nM24")); |
|
|
|
#elif ENABLED(SDSUPPORT) |
|
|
|
enqueue_and_echo_commands_P(PSTR("M25")); |
|
|
|
#elif defined(ACTION_ON_PAUSE) |
|
|
|
host_action_pause(); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void lcd_resume() { |
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
if (card.isPaused()) enqueue_and_echo_commands_P(PSTR("M24")); |
|
|
|
#endif |
|
|
|
#ifdef ACTION_ON_RESUME |
|
|
|
host_action_resume(); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
#endif // MACHINE_CAN_PAUSE
|
|
|
|
|
|
|
|
#if MACHINE_CAN_STOP |
|
|
|
|
|
|
|
void lcd_abort_job() { |
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
wait_for_heatup = wait_for_user = false; |
|
|
|
card.flag.abort_sd_printing = true; |
|
|
|
#endif |
|
|
|
#ifdef ACTION_ON_CANCEL |
|
|
|
host_action_cancel(); |
|
|
|
#endif |
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
host_prompt_open(PROMPT_INFO, PSTR("UI Abort")); |
|
|
|
#endif |
|
|
|
ui.set_status_P(PSTR(MSG_PRINT_ABORTED), -1); |
|
|
|
ui.return_to_status(); |
|
|
|
} |
|
|
|
|
|
|
|
void menu_abort_confirm() { |
|
|
|
do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), lcd_abort_job, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), nullptr, PSTR("?")); |
|
|
|
do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), ui.abort_print, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), nullptr, PSTR("?")); |
|
|
|
} |
|
|
|
|
|
|
|
#endif // MACHINE_CAN_STOP
|
|
|
|
|
|
|
|
#if ENABLED(PRUSA_MMU2) |
|
|
@ -160,7 +105,7 @@ void menu_main() { |
|
|
|
|
|
|
|
if (busy) { |
|
|
|
#if MACHINE_CAN_PAUSE |
|
|
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_pause_job); |
|
|
|
MENU_ITEM(function, MSG_PAUSE_PRINT, ui.pause_print); |
|
|
|
#endif |
|
|
|
#if MACHINE_CAN_STOP |
|
|
|
MENU_ITEM(submenu, MSG_STOP_PRINT, menu_abort_confirm); |
|
|
@ -204,7 +149,7 @@ void menu_main() { |
|
|
|
|| card.isPaused() |
|
|
|
#endif |
|
|
|
); |
|
|
|
if (paused) MENU_ITEM(function, MSG_RESUME_PRINT, lcd_resume); |
|
|
|
if (paused) MENU_ITEM(function, MSG_RESUME_PRINT, ui.resume_print); |
|
|
|
#endif |
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOTION, menu_motion); |
|
|
|