|
@@ -39,10 +39,6 @@
|
39
|
39
|
#include "../../feature/power_loss_recovery.h"
|
40
|
40
|
#endif
|
41
|
41
|
|
42
|
|
-#if ENABLED(HOST_ACTION_COMMANDS)
|
43
|
|
- #include "../../feature/host_actions.h"
|
44
|
|
-#endif
|
45
|
|
-
|
46
|
42
|
#if HAS_GAMES
|
47
|
43
|
#include "game/game.h"
|
48
|
44
|
#endif
|
|
@@ -50,61 +46,10 @@
|
50
|
46
|
#define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL))
|
51
|
47
|
#define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE))
|
52
|
48
|
|
53
|
|
-#if MACHINE_CAN_PAUSE
|
54
|
|
-
|
55
|
|
- void lcd_pause_job() {
|
56
|
|
- ui.synchronize(PSTR(MSG_PAUSE_PRINT));
|
57
|
|
-
|
58
|
|
- #if ENABLED(POWER_LOSS_RECOVERY)
|
59
|
|
- if (recovery.enabled) recovery.save(true, false);
|
60
|
|
- #endif
|
61
|
|
-
|
62
|
|
- #if ENABLED(HOST_PROMPT_SUPPORT)
|
63
|
|
- host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume"));
|
64
|
|
- #endif
|
65
|
|
-
|
66
|
|
- #if ENABLED(PARK_HEAD_ON_PAUSE)
|
67
|
|
- lcd_pause_show_message(PAUSE_MESSAGE_PAUSING, PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress
|
68
|
|
- enqueue_and_echo_commands_P(PSTR("M25 P\nM24"));
|
69
|
|
- #elif ENABLED(SDSUPPORT)
|
70
|
|
- enqueue_and_echo_commands_P(PSTR("M25"));
|
71
|
|
- #elif defined(ACTION_ON_PAUSE)
|
72
|
|
- host_action_pause();
|
73
|
|
- #endif
|
74
|
|
- }
|
75
|
|
-
|
76
|
|
- void lcd_resume() {
|
77
|
|
- #if ENABLED(SDSUPPORT)
|
78
|
|
- if (card.isPaused()) enqueue_and_echo_commands_P(PSTR("M24"));
|
79
|
|
- #endif
|
80
|
|
- #ifdef ACTION_ON_RESUME
|
81
|
|
- host_action_resume();
|
82
|
|
- #endif
|
83
|
|
- }
|
84
|
|
-
|
85
|
|
-#endif // MACHINE_CAN_PAUSE
|
86
|
|
-
|
87
|
49
|
#if MACHINE_CAN_STOP
|
88
|
|
-
|
89
|
|
- void lcd_abort_job() {
|
90
|
|
- #if ENABLED(SDSUPPORT)
|
91
|
|
- wait_for_heatup = wait_for_user = false;
|
92
|
|
- card.flag.abort_sd_printing = true;
|
93
|
|
- #endif
|
94
|
|
- #ifdef ACTION_ON_CANCEL
|
95
|
|
- host_action_cancel();
|
96
|
|
- #endif
|
97
|
|
- #if ENABLED(HOST_PROMPT_SUPPORT)
|
98
|
|
- host_prompt_open(PROMPT_INFO, PSTR("UI Abort"));
|
99
|
|
- #endif
|
100
|
|
- ui.set_status_P(PSTR(MSG_PRINT_ABORTED), -1);
|
101
|
|
- ui.return_to_status();
|
102
|
|
- }
|
103
|
|
-
|
104
|
50
|
void menu_abort_confirm() {
|
105
|
|
- do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), lcd_abort_job, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), nullptr, PSTR("?"));
|
|
51
|
+ do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), ui.abort_print, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), nullptr, PSTR("?"));
|
106
|
52
|
}
|
107
|
|
-
|
108
|
53
|
#endif // MACHINE_CAN_STOP
|
109
|
54
|
|
110
|
55
|
#if ENABLED(PRUSA_MMU2)
|
|
@@ -160,7 +105,7 @@ void menu_main() {
|
160
|
105
|
|
161
|
106
|
if (busy) {
|
162
|
107
|
#if MACHINE_CAN_PAUSE
|
163
|
|
- MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_pause_job);
|
|
108
|
+ MENU_ITEM(function, MSG_PAUSE_PRINT, ui.pause_print);
|
164
|
109
|
#endif
|
165
|
110
|
#if MACHINE_CAN_STOP
|
166
|
111
|
MENU_ITEM(submenu, MSG_STOP_PRINT, menu_abort_confirm);
|
|
@@ -204,7 +149,7 @@ void menu_main() {
|
204
|
149
|
|| card.isPaused()
|
205
|
150
|
#endif
|
206
|
151
|
);
|
207
|
|
- if (paused) MENU_ITEM(function, MSG_RESUME_PRINT, lcd_resume);
|
|
152
|
+ if (paused) MENU_ITEM(function, MSG_RESUME_PRINT, ui.resume_print);
|
208
|
153
|
#endif
|
209
|
154
|
|
210
|
155
|
MENU_ITEM(submenu, MSG_MOTION, menu_motion);
|