Browse Source

🎨 Refactor Host Actions as singleton

Scott Lahteine 3 years ago
parent
commit
ee28a14e8e

+ 2
- 2
Marlin/src/MarlinCore.cpp View File

872
   SERIAL_ERROR_MSG(STR_ERR_KILLED);
872
   SERIAL_ERROR_MSG(STR_ERR_KILLED);
873
 
873
 
874
   #ifdef ACTION_ON_KILL
874
   #ifdef ACTION_ON_KILL
875
-    host_action_kill();
875
+    hostui.kill();
876
   #endif
876
   #endif
877
 
877
 
878
   minkill(steppers_off);
878
   minkill(steppers_off);
1525
   #endif
1525
   #endif
1526
 
1526
 
1527
   #if ENABLED(HOST_PROMPT_SUPPORT)
1527
   #if ENABLED(HOST_PROMPT_SUPPORT)
1528
-    SETUP_RUN(host_action_prompt_end());
1528
+    SETUP_RUN(hostui.prompt_end());
1529
   #endif
1529
   #endif
1530
 
1530
 
1531
   #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
1531
   #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)

+ 1
- 1
Marlin/src/feature/e_parser.h View File

199
             case EP_M112: killed_by_M112 = true; break;
199
             case EP_M112: killed_by_M112 = true; break;
200
             case EP_M410: quickstop_by_M410 = true; break;
200
             case EP_M410: quickstop_by_M410 = true; break;
201
             #if ENABLED(HOST_PROMPT_SUPPORT)
201
             #if ENABLED(HOST_PROMPT_SUPPORT)
202
-              case EP_M876SN: host_response_handler(M876_reason); break;
202
+              case EP_M876SN: hostui.handle_response(M876_reason); break;
203
             #endif
203
             #endif
204
             #if ENABLED(REALTIME_REPORTING_COMMANDS)
204
             #if ENABLED(REALTIME_REPORTING_COMMANDS)
205
               case EP_GRBL_STATUS: report_current_position_moving(); break;
205
               case EP_GRBL_STATUS: report_current_position_moving(); break;

+ 66
- 45
Marlin/src/feature/host_actions.cpp View File

24
 
24
 
25
 #if ENABLED(HOST_ACTION_COMMANDS)
25
 #if ENABLED(HOST_ACTION_COMMANDS)
26
 
26
 
27
-#include "host_actions.h"
28
-
29
 //#define DEBUG_HOST_ACTIONS
27
 //#define DEBUG_HOST_ACTIONS
30
 
28
 
29
+#include "host_actions.h"
30
+
31
 #if ENABLED(ADVANCED_PAUSE_FEATURE)
31
 #if ENABLED(ADVANCED_PAUSE_FEATURE)
32
   #include "pause.h"
32
   #include "pause.h"
33
   #include "../gcode/queue.h"
33
   #include "../gcode/queue.h"
37
   #include "runout.h"
37
   #include "runout.h"
38
 #endif
38
 #endif
39
 
39
 
40
-void host_action(FSTR_P const fstr, const bool eol) {
40
+HostUI hostui;
41
+
42
+flag_t HostUI::flag;
43
+
44
+void HostUI::action(FSTR_P const fstr, const bool eol) {
45
+  if (!flag.bits) return;
41
   PORT_REDIRECT(SerialMask::All);
46
   PORT_REDIRECT(SerialMask::All);
42
   SERIAL_ECHOPGM("//action:");
47
   SERIAL_ECHOPGM("//action:");
43
   SERIAL_ECHOF(fstr);
48
   SERIAL_ECHOF(fstr);
45
 }
50
 }
46
 
51
 
47
 #ifdef ACTION_ON_KILL
52
 #ifdef ACTION_ON_KILL
48
-  void host_action_kill() { host_action(F(ACTION_ON_KILL)); }
53
+  void HostUI::kill() { action(F(ACTION_ON_KILL)); }
49
 #endif
54
 #endif
50
 #ifdef ACTION_ON_PAUSE
55
 #ifdef ACTION_ON_PAUSE
51
-  void host_action_pause(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSE), eol); }
56
+  void HostUI::pause(const bool eol/*=true*/) { action(F(ACTION_ON_PAUSE), eol); }
52
 #endif
57
 #endif
53
 #ifdef ACTION_ON_PAUSED
58
 #ifdef ACTION_ON_PAUSED
54
-  void host_action_paused(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSED), eol); }
59
+  void HostUI::paused(const bool eol/*=true*/) { action(F(ACTION_ON_PAUSED), eol); }
55
 #endif
60
 #endif
56
 #ifdef ACTION_ON_RESUME
61
 #ifdef ACTION_ON_RESUME
57
-  void host_action_resume() { host_action(F(ACTION_ON_RESUME)); }
62
+  void HostUI::resume() { action(F(ACTION_ON_RESUME)); }
58
 #endif
63
 #endif
59
 #ifdef ACTION_ON_RESUMED
64
 #ifdef ACTION_ON_RESUMED
60
-  void host_action_resumed() { host_action(F(ACTION_ON_RESUMED)); }
65
+  void HostUI::resumed() { action(F(ACTION_ON_RESUMED)); }
61
 #endif
66
 #endif
62
 #ifdef ACTION_ON_CANCEL
67
 #ifdef ACTION_ON_CANCEL
63
-  void host_action_cancel() { host_action(F(ACTION_ON_CANCEL)); }
68
+  void HostUI::cancel() { action(F(ACTION_ON_CANCEL)); }
64
 #endif
69
 #endif
65
 #ifdef ACTION_ON_START
70
 #ifdef ACTION_ON_START
66
-  void host_action_start() { host_action(F(ACTION_ON_START)); }
71
+  void HostUI::start() { action(F(ACTION_ON_START)); }
72
+#endif
73
+
74
+#if ENABLED(G29_RETRY_AND_RECOVER)
75
+  #ifdef ACTION_ON_G29_RECOVER
76
+    void HostUI::g29_recover() { action(F(ACTION_ON_G29_RECOVER)); }
77
+  #endif
78
+  #ifdef ACTION_ON_G29_FAILURE
79
+    void HostUI::g29_failure() { action(F(ACTION_ON_G29_FAILURE)); }
80
+  #endif
67
 #endif
81
 #endif
68
 
82
 
69
 #if ENABLED(HOST_PROMPT_SUPPORT)
83
 #if ENABLED(HOST_PROMPT_SUPPORT)
70
 
84
 
85
+  PromptReason HostUI::host_prompt_reason = PROMPT_NOT_DEFINED;
86
+
71
   PGMSTR(CONTINUE_STR, "Continue");
87
   PGMSTR(CONTINUE_STR, "Continue");
72
   PGMSTR(DISMISS_STR, "Dismiss");
88
   PGMSTR(DISMISS_STR, "Dismiss");
73
 
89
 
75
     extern bool wait_for_user;
91
     extern bool wait_for_user;
76
   #endif
92
   #endif
77
 
93
 
78
-  PromptReason host_prompt_reason = PROMPT_NOT_DEFINED;
79
-
80
-  void host_action_notify(const char * const cstr) {
94
+  void HostUI::notify(const char * const cstr) {
95
+    if (!flag.bits) return;
81
     PORT_REDIRECT(SerialMask::All);
96
     PORT_REDIRECT(SerialMask::All);
82
-    host_action(F("notification "), false);
97
+    action(F("notification "), false);
83
     SERIAL_ECHOLN(cstr);
98
     SERIAL_ECHOLN(cstr);
84
   }
99
   }
85
 
100
 
86
-  void host_action_notify(FSTR_P const fstr) {
101
+  void HostUI::notify_P(PGM_P const pstr) {
102
+    if (!flag.bits) return;
87
     PORT_REDIRECT(SerialMask::All);
103
     PORT_REDIRECT(SerialMask::All);
88
-    host_action(F("notification "), false);
89
-    SERIAL_ECHOLNF(fstr);
104
+    action(F("notification "), false);
105
+    SERIAL_ECHOLNPGM_P(pstr);
90
   }
106
   }
91
 
107
 
92
-  void host_action_prompt(FSTR_P const ptype, const bool eol=true) {
108
+  void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) {
109
+    if (!flag.bits) return;
93
     PORT_REDIRECT(SerialMask::All);
110
     PORT_REDIRECT(SerialMask::All);
94
-    host_action(F("prompt_"), false);
111
+    action(F("prompt_"), false);
95
     SERIAL_ECHOF(ptype);
112
     SERIAL_ECHOF(ptype);
96
     if (eol) SERIAL_EOL();
113
     if (eol) SERIAL_EOL();
97
   }
114
   }
98
 
115
 
99
-  void host_action_prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
100
-    host_action_prompt(ptype, false);
116
+  void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
117
+    if (!flag.bits) return;
118
+    prompt(ptype, false);
101
     PORT_REDIRECT(SerialMask::All);
119
     PORT_REDIRECT(SerialMask::All);
102
     SERIAL_CHAR(' ');
120
     SERIAL_CHAR(' ');
103
     SERIAL_ECHOF(fstr);
121
     SERIAL_ECHOF(fstr);
104
     if (extra_char != '\0') SERIAL_CHAR(extra_char);
122
     if (extra_char != '\0') SERIAL_CHAR(extra_char);
105
     SERIAL_EOL();
123
     SERIAL_EOL();
106
   }
124
   }
107
-  void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
108
-    host_action_prompt_end();
125
+  void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
126
+    if (!flag.bits) return;
127
+    prompt_end();
109
     host_prompt_reason = reason;
128
     host_prompt_reason = reason;
110
-    host_action_prompt_plus(F("begin"), fstr, extra_char);
129
+    prompt_plus(F("begin"), fstr, extra_char);
111
   }
130
   }
112
-  void host_action_prompt_button(FSTR_P const fstr) { host_action_prompt_plus(F("button"), fstr); }
113
-  void host_action_prompt_end() { host_action_prompt(F("end")); }
114
-  void host_action_prompt_show() { host_action_prompt(F("show")); }
115
-
116
-  void _host_prompt_show(FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
117
-    if (btn1) host_action_prompt_button(btn1);
118
-    if (btn2) host_action_prompt_button(btn2);
119
-    host_action_prompt_show();
131
+  void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
132
+  void HostUI::prompt_end() { prompt(F("end")); }
133
+  void HostUI::prompt_show() { prompt(F("show")); }
134
+
135
+  void HostUI::_prompt_show(FSTR_P const btn1, FSTR_P const btn2) {
136
+    if (btn1) prompt_button(btn1);
137
+    if (btn2) prompt_button(btn2);
138
+    prompt_show();
120
   }
139
   }
121
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
122
-    host_action_prompt_begin(reason, fstr);
123
-    _host_prompt_show(btn1, btn2);
140
+  void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
141
+    prompt_begin(reason, fstr);
142
+    _prompt_show(btn1, btn2);
124
   }
143
   }
125
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
126
-    host_action_prompt_begin(reason, fstr, extra_char);
127
-    _host_prompt_show(btn1, btn2);
144
+  void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
145
+    prompt_begin(reason, fstr, extra_char);
146
+    _prompt_show(btn1, btn2);
128
   }
147
   }
129
 
148
 
130
-  void filament_load_host_prompt() {
131
-    const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out);
132
-    host_prompt_do(PROMPT_FILAMENT_RUNOUT, F("Paused"), F("PurgeMore"),
133
-      disable_to_continue ? F("DisableRunout") : FPSTR(CONTINUE_STR)
134
-    );
135
-  }
149
+  #if ENABLED(ADVANCED_PAUSE_FEATURE)
150
+    void HostUI::filament_load_prompt() {
151
+      const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out);
152
+      prompt_do(PROMPT_FILAMENT_RUNOUT, F("Paused"), F("PurgeMore"),
153
+        disable_to_continue ? F("DisableRunout") : FPSTR(CONTINUE_STR)
154
+      );
155
+    }
156
+  #endif
136
 
157
 
137
   //
158
   //
138
   // Handle responses from the host, such as:
159
   // Handle responses from the host, such as:
141
   //  - Resume Print response
162
   //  - Resume Print response
142
   //  - Dismissal of info
163
   //  - Dismissal of info
143
   //
164
   //
144
-  void host_response_handler(const uint8_t response) {
165
+  void HostUI::handle_response(const uint8_t response) {
145
     const PromptReason hpr = host_prompt_reason;
166
     const PromptReason hpr = host_prompt_reason;
146
     host_prompt_reason = PROMPT_NOT_DEFINED;  // Reset now ahead of logic
167
     host_prompt_reason = PROMPT_NOT_DEFINED;  // Reset now ahead of logic
147
     switch (hpr) {
168
     switch (hpr) {

+ 78
- 40
Marlin/src/feature/host_actions.h View File

24
 #include "../inc/MarlinConfigPre.h"
24
 #include "../inc/MarlinConfigPre.h"
25
 #include "../HAL/shared/Marduino.h"
25
 #include "../HAL/shared/Marduino.h"
26
 
26
 
27
-void host_action(FSTR_P const fstr, const bool eol=true);
28
-
29
-#ifdef ACTION_ON_KILL
30
-  void host_action_kill();
31
-#endif
32
-#ifdef ACTION_ON_PAUSE
33
-  void host_action_pause(const bool eol=true);
34
-#endif
35
-#ifdef ACTION_ON_PAUSED
36
-  void host_action_paused(const bool eol=true);
37
-#endif
38
-#ifdef ACTION_ON_RESUME
39
-  void host_action_resume();
40
-#endif
41
-#ifdef ACTION_ON_RESUMED
42
-  void host_action_resumed();
43
-#endif
44
-#ifdef ACTION_ON_CANCEL
45
-  void host_action_cancel();
46
-#endif
47
-#ifdef ACTION_ON_START
48
-  void host_action_start();
49
-#endif
27
+typedef union {
28
+  uint8_t bits;
29
+  struct { bool info:1, errors:1, debug:1; };
30
+} flag_t;
50
 
31
 
51
 #if ENABLED(HOST_PROMPT_SUPPORT)
32
 #if ENABLED(HOST_PROMPT_SUPPORT)
52
 
33
 
53
-  extern const char CONTINUE_STR[], DISMISS_STR[];
54
-
55
   enum PromptReason : uint8_t {
34
   enum PromptReason : uint8_t {
56
     PROMPT_NOT_DEFINED,
35
     PROMPT_NOT_DEFINED,
57
     PROMPT_FILAMENT_RUNOUT,
36
     PROMPT_FILAMENT_RUNOUT,
61
     PROMPT_INFO
40
     PROMPT_INFO
62
   };
41
   };
63
 
42
 
64
-  extern PromptReason host_prompt_reason;
43
+#endif
65
 
44
 
66
-  void host_response_handler(const uint8_t response);
67
-  void host_action_notify(const char * const cstr);
68
-  void host_action_notify(FSTR_P const fstr);
69
-  void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
70
-  void host_action_prompt_button(FSTR_P const fstr);
71
-  void host_action_prompt_end();
72
-  void host_action_prompt_show();
73
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
74
-  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
75
-  inline void host_prompt_open(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
76
-    if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, fstr, btn1, btn2);
77
-  }
45
+class HostUI {
46
+  public:
78
 
47
 
79
-  void filament_load_host_prompt();
48
+  static flag_t flag;
49
+  HostUI() { flag.bits = 0xFF; }
80
 
50
 
81
-#endif
51
+  static void action(FSTR_P const fstr, const bool eol=true);
52
+
53
+  #ifdef ACTION_ON_KILL
54
+    static void kill();
55
+  #endif
56
+  #ifdef ACTION_ON_PAUSE
57
+    static void pause(const bool eol=true);
58
+  #endif
59
+  #ifdef ACTION_ON_PAUSED
60
+    static void paused(const bool eol=true);
61
+  #endif
62
+  #ifdef ACTION_ON_RESUME
63
+    static void resume();
64
+  #endif
65
+  #ifdef ACTION_ON_RESUMED
66
+    static void resumed();
67
+  #endif
68
+  #ifdef ACTION_ON_CANCEL
69
+    static void cancel();
70
+  #endif
71
+  #ifdef ACTION_ON_START
72
+    static void start();
73
+  #endif
74
+
75
+  #if ENABLED(G29_RETRY_AND_RECOVER)
76
+    #ifdef ACTION_ON_G29_RECOVER
77
+      static void g29_recover();
78
+    #endif
79
+    #ifdef ACTION_ON_G29_FAILURE
80
+      static void g29_failure();
81
+    #endif
82
+  #endif
83
+
84
+  #if ENABLED(HOST_PROMPT_SUPPORT)
85
+    private:
86
+    static void prompt(FSTR_P const ptype, const bool eol=true);
87
+    static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0');
88
+    static void prompt_show();
89
+    static void _prompt_show(FSTR_P const btn1, FSTR_P const btn2);
90
+
91
+    public:
92
+    static PromptReason host_prompt_reason;
93
+
94
+    static void handle_response(const uint8_t response);
95
+
96
+    static void notify_P(PGM_P const message);
97
+    static inline void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); }
98
+    static void notify(const char * const message);
99
+
100
+    static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
101
+    static void prompt_button(FSTR_P const fstr);
102
+    static void prompt_end();
103
+    static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
104
+    static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
105
+    static inline void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
106
+      if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
107
+    }
108
+
109
+    #if ENABLED(ADVANCED_PAUSE_FEATURE)
110
+      static void filament_load_prompt();
111
+    #endif
112
+
113
+  #endif
114
+
115
+};
116
+
117
+extern HostUI hostui;
118
+
119
+extern const char CONTINUE_STR[], DISMISS_STR[];

+ 1
- 1
Marlin/src/feature/mmu/mmu2.cpp View File

962
   if (recover)  {
962
   if (recover)  {
963
     LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
963
     LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
964
     BUZZ(200, 404);
964
     BUZZ(200, 404);
965
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
965
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
966
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
966
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
967
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
967
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
968
     BUZZ(200, 404);
968
     BUZZ(200, 404);

+ 14
- 14
Marlin/src/feature/pause.cpp View File

198
 
198
 
199
     #if ENABLED(HOST_PROMPT_SUPPORT)
199
     #if ENABLED(HOST_PROMPT_SUPPORT)
200
       const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
200
       const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
201
-      host_prompt_do(PROMPT_USER_CONTINUE, F("Load Filament T"), tool, FPSTR(CONTINUE_STR));
201
+      hostui.prompt_do(PROMPT_USER_CONTINUE, F("Load Filament T"), tool, FPSTR(CONTINUE_STR));
202
     #endif
202
     #endif
203
 
203
 
204
     while (wait_for_user) {
204
     while (wait_for_user) {
253
     if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
253
     if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
254
 
254
 
255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
256
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
256
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
257
     TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
257
     TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
258
     wait_for_user = true; // A click or M108 breaks the purge_length loop
258
     wait_for_user = true; // A click or M108 breaks the purge_length loop
259
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
259
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
271
         unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
271
         unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
272
       }
272
       }
273
 
273
 
274
-      TERN_(HOST_PROMPT_SUPPORT, filament_load_host_prompt()); // Initiate another host prompt.
274
+      TERN_(HOST_PROMPT_SUPPORT, hostui.filament_load_prompt()); // Initiate another host prompt.
275
 
275
 
276
       #if M600_PURGE_MORE_RESUMABLE
276
       #if M600_PURGE_MORE_RESUMABLE
277
         if (show_lcd) {
277
         if (show_lcd) {
291
     } while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
291
     } while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
292
 
292
 
293
   #endif
293
   #endif
294
-  TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());
294
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end());
295
 
295
 
296
   return true;
296
   return true;
297
 }
297
 }
397
 
397
 
398
   #if ENABLED(HOST_ACTION_COMMANDS)
398
   #if ENABLED(HOST_ACTION_COMMANDS)
399
     #ifdef ACTION_ON_PAUSED
399
     #ifdef ACTION_ON_PAUSED
400
-      host_action_paused();
400
+      hostui.paused();
401
     #elif defined(ACTION_ON_PAUSE)
401
     #elif defined(ACTION_ON_PAUSE)
402
-      host_action_pause();
402
+      hostui.pause();
403
     #endif
403
     #endif
404
   #endif
404
   #endif
405
 
405
 
406
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
406
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
407
 
407
 
408
   // Indicate that the printer is paused
408
   // Indicate that the printer is paused
409
   ++did_pause_print;
409
   ++did_pause_print;
512
 
512
 
513
   // Wait for filament insert by user and press button
513
   // Wait for filament insert by user and press button
514
   KEEPALIVE_STATE(PAUSED_FOR_USER);
514
   KEEPALIVE_STATE(PAUSED_FOR_USER);
515
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
515
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
516
   TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED)));
516
   TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED)));
517
   wait_for_user = true;    // LCD click or M108 will clear this
517
   wait_for_user = true;    // LCD click or M108 will clear this
518
   while (wait_for_user) {
518
   while (wait_for_user) {
528
       ui.pause_show_message(PAUSE_MESSAGE_HEAT);
528
       ui.pause_show_message(PAUSE_MESSAGE_HEAT);
529
       SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
529
       SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
530
 
530
 
531
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
531
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
532
 
532
 
533
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_HEATER_TIMEOUT)));
533
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_HEATER_TIMEOUT)));
534
 
534
 
535
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108
535
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108
536
 
536
 
537
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
537
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
538
 
538
 
539
       TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING)));
539
       TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING)));
540
 
540
 
554
 
554
 
555
       HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
555
       HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
556
 
556
 
557
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
557
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
558
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)));
558
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)));
559
       TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
559
       TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
560
 
560
 
664
   ui.pause_show_message(PAUSE_MESSAGE_STATUS);
664
   ui.pause_show_message(PAUSE_MESSAGE_STATUS);
665
 
665
 
666
   #ifdef ACTION_ON_RESUMED
666
   #ifdef ACTION_ON_RESUMED
667
-    host_action_resumed();
667
+    hostui.resumed();
668
   #elif defined(ACTION_ON_RESUME)
668
   #elif defined(ACTION_ON_RESUME)
669
-    host_action_resume();
669
+    hostui.resume();
670
   #endif
670
   #endif
671
 
671
 
672
   --did_pause_print;
672
   --did_pause_print;
673
 
673
 
674
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming"), FPSTR(DISMISS_STR)));
674
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Resuming"), FPSTR(DISMISS_STR)));
675
 
675
 
676
   // Resume the print job timer if it was running
676
   // Resume the print job timer if it was running
677
   if (print_job_timer.isPaused()) print_job_timer.start();
677
   if (print_job_timer.isPaused()) print_job_timer.start();

+ 4
- 5
Marlin/src/feature/runout.cpp View File

96
 
96
 
97
   //action:out_of_filament
97
   //action:out_of_filament
98
   #if ENABLED(HOST_PROMPT_SUPPORT)
98
   #if ENABLED(HOST_PROMPT_SUPPORT)
99
-    host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool);
100
-    host_action_prompt_show();
99
+    hostui.prompt_do(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool); //action:out_of_filament
101
   #endif
100
   #endif
102
 
101
 
103
   const bool run_runout_script = !runout.host_handling;
102
   const bool run_runout_script = !runout.host_handling;
109
         || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
108
         || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
110
       )
109
       )
111
     ) {
110
     ) {
112
-      host_action_paused(false);
111
+      hostui.paused(false);
113
     }
112
     }
114
     else {
113
     else {
115
       // Legacy Repetier command for use until newer version supports standard dialog
114
       // Legacy Repetier command for use until newer version supports standard dialog
116
       // To be removed later when pause command also triggers dialog
115
       // To be removed later when pause command also triggers dialog
117
       #ifdef ACTION_ON_FILAMENT_RUNOUT
116
       #ifdef ACTION_ON_FILAMENT_RUNOUT
118
-        host_action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
117
+        hostui.action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
119
         SERIAL_CHAR(tool);
118
         SERIAL_CHAR(tool);
120
         SERIAL_EOL();
119
         SERIAL_EOL();
121
       #endif
120
       #endif
122
 
121
 
123
-      host_action_pause(false);
122
+      hostui.pause(false);
124
     }
123
     }
125
     SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
124
     SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
126
     SERIAL_CHAR(tool);
125
     SERIAL_CHAR(tool);

+ 1
- 1
Marlin/src/gcode/config/M43.cpp View File

344
     #if HAS_RESUME_CONTINUE
344
     #if HAS_RESUME_CONTINUE
345
       KEEPALIVE_STATE(PAUSED_FOR_USER);
345
       KEEPALIVE_STATE(PAUSED_FOR_USER);
346
       wait_for_user = true;
346
       wait_for_user = true;
347
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
347
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
348
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("M43 Wait Called")));
348
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("M43 Wait Called")));
349
     #endif
349
     #endif
350
 
350
 

+ 1
- 1
Marlin/src/gcode/control/M111.cpp View File

26
  * M111: Set the debug level
26
  * M111: Set the debug level
27
  */
27
  */
28
 void GcodeSuite::M111() {
28
 void GcodeSuite::M111() {
29
-  if (parser.seen('S')) marlin_debug_flags = parser.byteval('S');
29
+  if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
30
 
30
 
31
   static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
31
   static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
32
   static PGMSTR(str_debug_2, STR_DEBUG_INFO);
32
   static PGMSTR(str_debug_2, STR_DEBUG_INFO);

+ 5
- 5
Marlin/src/gcode/gcode.cpp View File

237
 #if ENABLED(G29_RETRY_AND_RECOVER)
237
 #if ENABLED(G29_RETRY_AND_RECOVER)
238
 
238
 
239
   void GcodeSuite::event_probe_recover() {
239
   void GcodeSuite::event_probe_recover() {
240
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, F("G29 Retrying"), FPSTR(DISMISS_STR)));
240
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, F("G29 Retrying"), FPSTR(DISMISS_STR)));
241
     #ifdef ACTION_ON_G29_RECOVER
241
     #ifdef ACTION_ON_G29_RECOVER
242
-      host_action(F(ACTION_ON_G29_RECOVER));
242
+      hostui.g29_recover();
243
     #endif
243
     #endif
244
     #ifdef G29_RECOVER_COMMANDS
244
     #ifdef G29_RECOVER_COMMANDS
245
       process_subcommands_now(F(G29_RECOVER_COMMANDS));
245
       process_subcommands_now(F(G29_RECOVER_COMMANDS));
252
 
252
 
253
   void GcodeSuite::event_probe_failure() {
253
   void GcodeSuite::event_probe_failure() {
254
     #ifdef ACTION_ON_G29_FAILURE
254
     #ifdef ACTION_ON_G29_FAILURE
255
-      host_action(F(ACTION_ON_G29_FAILURE));
255
+      hostui.g29_failure();
256
     #endif
256
     #endif
257
     #ifdef G29_FAILURE_COMMANDS
257
     #ifdef G29_FAILURE_COMMANDS
258
       process_subcommands_now(F(G29_FAILURE_COMMANDS));
258
       process_subcommands_now(F(G29_FAILURE_COMMANDS));
259
     #endif
259
     #endif
260
     #if ENABLED(G29_HALT_ON_FAILURE)
260
     #if ENABLED(G29_HALT_ON_FAILURE)
261
       #ifdef ACTION_ON_CANCEL
261
       #ifdef ACTION_ON_CANCEL
262
-        host_action_cancel();
262
+        hostui.cancel();
263
       #endif
263
       #endif
264
       kill(GET_TEXT_F(MSG_LCD_PROBING_FAILED));
264
       kill(GET_TEXT_F(MSG_LCD_PROBING_FAILED));
265
     #endif
265
     #endif
282
       }
282
       }
283
     }
283
     }
284
 
284
 
285
-    TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());
285
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end());
286
 
286
 
287
     #ifdef G29_SUCCESS_COMMANDS
287
     #ifdef G29_SUCCESS_COMMANDS
288
       process_subcommands_now(F(G29_SUCCESS_COMMANDS));
288
       process_subcommands_now(F(G29_SUCCESS_COMMANDS));

+ 1
- 1
Marlin/src/gcode/host/M876.cpp View File

33
  */
33
  */
34
 void GcodeSuite::M876() {
34
 void GcodeSuite::M876() {
35
 
35
 
36
-  if (parser.seenval('S')) host_response_handler((uint8_t)parser.value_int());
36
+  if (parser.seenval('S')) hostui.handle_response((uint8_t)parser.value_int());
37
 
37
 
38
 }
38
 }
39
 
39
 

+ 1
- 1
Marlin/src/gcode/lcd/M0_M1.cpp View File

84
 
84
 
85
   #endif
85
   #endif
86
 
86
 
87
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
87
+  TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
88
 
88
 
89
   TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
89
   TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
90
 
90
 

+ 1
- 1
Marlin/src/gcode/sd/M1001.cpp View File

97
     if (long_print) {
97
     if (long_print) {
98
       printerEventLEDs.onPrintCompleted();
98
       printerEventLEDs.onPrintCompleted();
99
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PRINT_DONE)));
99
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PRINT_DONE)));
100
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
100
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
101
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30))));
101
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30))));
102
       printerEventLEDs.onResumeAfterWait();
102
       printerEventLEDs.onResumeAfterWait();
103
     }
103
     }

+ 4
- 4
Marlin/src/gcode/sd/M24_M25.cpp View File

77
 
77
 
78
   #if ENABLED(HOST_ACTION_COMMANDS)
78
   #if ENABLED(HOST_ACTION_COMMANDS)
79
     #ifdef ACTION_ON_RESUME
79
     #ifdef ACTION_ON_RESUME
80
-      host_action_resume();
80
+      hostui.resume();
81
     #endif
81
     #endif
82
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
82
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
83
   #endif
83
   #endif
84
 
84
 
85
   ui.reset_status();
85
   ui.reset_status();
116
     IF_DISABLED(DWIN_CREALITY_LCD, ui.reset_status());
116
     IF_DISABLED(DWIN_CREALITY_LCD, ui.reset_status());
117
 
117
 
118
     #if ENABLED(HOST_ACTION_COMMANDS)
118
     #if ENABLED(HOST_ACTION_COMMANDS)
119
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
119
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
120
       #ifdef ACTION_ON_PAUSE
120
       #ifdef ACTION_ON_PAUSE
121
-        host_action_pause();
121
+        hostui.pause();
122
       #endif
122
       #endif
123
     #endif
123
     #endif
124
 
124
 

+ 1
- 1
Marlin/src/gcode/stats/M75-M78.cpp View File

49
  */
49
  */
50
 void GcodeSuite::M76() {
50
 void GcodeSuite::M76() {
51
   print_job_timer.pause();
51
   print_job_timer.pause();
52
-  TERN_(HOST_PAUSE_M76, host_action_pause());
52
+  TERN_(HOST_PAUSE_M76, hostui.pause());
53
 }
53
 }
54
 
54
 
55
 /**
55
 /**

+ 1
- 1
Marlin/src/lcd/e3v2/creality/dwin.cpp View File

2363
         card.abortFilePrintSoon();                     // Let the main loop handle SD abort
2363
         card.abortFilePrintSoon();                     // Let the main loop handle SD abort
2364
         dwin_abort_flag = true;                        // Reset feedrate, return to Home
2364
         dwin_abort_flag = true;                        // Reset feedrate, return to Home
2365
         #ifdef ACTION_ON_CANCEL
2365
         #ifdef ACTION_ON_CANCEL
2366
-          host_action_cancel();
2366
+          hostui.cancel();
2367
         #endif
2367
         #endif
2368
         Popup_Window_Home(true);
2368
         Popup_Window_Home(true);
2369
         if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish!
2369
         if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish!

+ 1
- 1
Marlin/src/lcd/e3v2/enhanced/dwin.cpp View File

1391
         card.abortFilePrintSoon();                     // Let the main loop handle SD abort
1391
         card.abortFilePrintSoon();                     // Let the main loop handle SD abort
1392
         dwin_abort_flag = true;                        // Reset feedrate, return to Home
1392
         dwin_abort_flag = true;                        // Reset feedrate, return to Home
1393
         #ifdef ACTION_ON_CANCEL
1393
         #ifdef ACTION_ON_CANCEL
1394
-          host_action_cancel();
1394
+          hostui.cancel();
1395
         #endif
1395
         #endif
1396
         DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done."));
1396
         DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done."));
1397
       }
1397
       }

+ 3
- 3
Marlin/src/lcd/e3v2/jyersui/dwin.cpp View File

4503
             #endif
4503
             #endif
4504
           }
4504
           }
4505
           else {
4505
           else {
4506
-            TERN_(HOST_ACTION_COMMANDS, host_action_resume());
4506
+            TERN_(HOST_ACTION_COMMANDS, hostui.resume());
4507
           }
4507
           }
4508
           Draw_Print_Screen();
4508
           Draw_Print_Screen();
4509
         }
4509
         }
4553
             #endif
4553
             #endif
4554
           }
4554
           }
4555
           else {
4555
           else {
4556
-            TERN_(HOST_ACTION_COMMANDS, host_action_pause());
4556
+            TERN_(HOST_ACTION_COMMANDS, hostui.pause());
4557
           }
4557
           }
4558
         }
4558
         }
4559
         Draw_Print_Screen();
4559
         Draw_Print_Screen();
4566
             thermalManager.disable_all_heaters();
4566
             thermalManager.disable_all_heaters();
4567
           }
4567
           }
4568
           else {
4568
           else {
4569
-            TERN_(HOST_ACTION_COMMANDS, host_action_cancel());
4569
+            TERN_(HOST_ACTION_COMMANDS, hostui.cancel());
4570
           }
4570
           }
4571
         }
4571
         }
4572
         else
4572
         else

+ 2
- 2
Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp View File

242
       if (ExtUI::isPrintingFromMedia())
242
       if (ExtUI::isPrintingFromMedia())
243
         ExtUI::pausePrint();
243
         ExtUI::pausePrint();
244
       #ifdef ACTION_ON_PAUSE
244
       #ifdef ACTION_ON_PAUSE
245
-        else host_action_pause();
245
+        else hostui.pause();
246
       #endif
246
       #endif
247
       GOTO_SCREEN(StatusScreen);
247
       GOTO_SCREEN(StatusScreen);
248
       break;
248
       break;
251
       if (ExtUI::isPrintingFromMedia())
251
       if (ExtUI::isPrintingFromMedia())
252
         ExtUI::resumePrint();
252
         ExtUI::resumePrint();
253
       #ifdef ACTION_ON_RESUME
253
       #ifdef ACTION_ON_RESUME
254
-        else host_action_resume();
254
+        else hostui.resume();
255
       #endif
255
       #endif
256
       GOTO_SCREEN(StatusScreen);
256
       GOTO_SCREEN(StatusScreen);
257
       break;
257
       break;

+ 1
- 1
Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/confirm_abort_print_dialog_box.cpp View File

41
       if (ExtUI::isPrintingFromMedia())
41
       if (ExtUI::isPrintingFromMedia())
42
          ExtUI::stopPrint();
42
          ExtUI::stopPrint();
43
       #ifdef ACTION_ON_CANCEL
43
       #ifdef ACTION_ON_CANCEL
44
-        else host_action_cancel();
44
+        else hostui.cancel();
45
       #endif
45
       #endif
46
       return true;
46
       return true;
47
     default:
47
     default:

+ 2
- 2
Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp View File

138
   if (ExtUI::isPrintingFromMedia())
138
   if (ExtUI::isPrintingFromMedia())
139
     ExtUI::pausePrint();
139
     ExtUI::pausePrint();
140
   #ifdef ACTION_ON_PAUSE
140
   #ifdef ACTION_ON_PAUSE
141
-    else host_action_pause();
141
+    else hostui.pause();
142
   #endif
142
   #endif
143
   GOTO_SCREEN(StatusScreen);
143
   GOTO_SCREEN(StatusScreen);
144
 }
144
 }
150
   else if (ExtUI::isPrintingFromMedia())
150
   else if (ExtUI::isPrintingFromMedia())
151
     ExtUI::resumePrint();
151
     ExtUI::resumePrint();
152
   #ifdef ACTION_ON_RESUME
152
   #ifdef ACTION_ON_RESUME
153
-    else host_action_resume();
153
+    else hostui.resume();
154
   #endif
154
   #endif
155
   GOTO_SCREEN(StatusScreen);
155
   GOTO_SCREEN(StatusScreen);
156
 }
156
 }

+ 1
- 1
Marlin/src/lcd/extui/ui_api.cpp View File

918
   #endif // HAS_LEVELING
918
   #endif // HAS_LEVELING
919
 
919
 
920
   #if ENABLED(HOST_PROMPT_SUPPORT)
920
   #if ENABLED(HOST_PROMPT_SUPPORT)
921
-    void setHostResponse(const uint8_t response) { host_response_handler(response); }
921
+    void setHostResponse(const uint8_t response) { hostui.handle_response(response); }
922
   #endif
922
   #endif
923
 
923
 
924
   #if ENABLED(PRINTCOUNTER)
924
   #if ENABLED(PRINTCOUNTER)

+ 10
- 10
Marlin/src/lcd/marlinui.cpp View File

1355
   void MarlinUI::set_status(const char * const cstr, const bool persist) {
1355
   void MarlinUI::set_status(const char * const cstr, const bool persist) {
1356
     if (alert_level) return;
1356
     if (alert_level) return;
1357
 
1357
 
1358
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(cstr));
1358
+    TERN_(HOST_PROMPT_SUPPORT, hostui.notify(cstr));
1359
 
1359
 
1360
     // Here we have a problem. The message is encoded in UTF8, so
1360
     // Here we have a problem. The message is encoded in UTF8, so
1361
     // arbitrarily cutting it will be a problem. We MUST be sure
1361
     // arbitrarily cutting it will be a problem. We MUST be sure
1427
     if (level < alert_level) return;
1427
     if (level < alert_level) return;
1428
     alert_level = level;
1428
     alert_level = level;
1429
 
1429
 
1430
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(fstr));
1430
+    TERN_(HOST_PROMPT_SUPPORT, hostui.notify(fstr));
1431
 
1431
 
1432
     // Since the message is encoded in UTF8 it must
1432
     // Since the message is encoded in UTF8 it must
1433
     // only be cut on a character boundary.
1433
     // only be cut on a character boundary.
1533
       card.abortFilePrintSoon();
1533
       card.abortFilePrintSoon();
1534
     #endif
1534
     #endif
1535
     #ifdef ACTION_ON_CANCEL
1535
     #ifdef ACTION_ON_CANCEL
1536
-      host_action_cancel();
1536
+      hostui.cancel();
1537
     #endif
1537
     #endif
1538
     IF_DISABLED(SDSUPPORT, print_job_timer.stop());
1538
     IF_DISABLED(SDSUPPORT, print_job_timer.stop());
1539
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
1539
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
1540
     LCD_MESSAGE(MSG_PRINT_ABORTED);
1540
     LCD_MESSAGE(MSG_PRINT_ABORTED);
1541
     TERN_(HAS_LCD_MENU, return_to_status());
1541
     TERN_(HAS_LCD_MENU, return_to_status());
1542
   }
1542
   }
1565
     #endif
1565
     #endif
1566
 
1566
 
1567
     TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
1567
     TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
1568
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
1568
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
1569
 
1569
 
1570
     LCD_MESSAGE(MSG_PRINT_PAUSED);
1570
     LCD_MESSAGE(MSG_PRINT_PAUSED);
1571
 
1571
 
1575
     #elif ENABLED(SDSUPPORT)
1575
     #elif ENABLED(SDSUPPORT)
1576
       queue.inject(F("M25"));
1576
       queue.inject(F("M25"));
1577
     #elif defined(ACTION_ON_PAUSE)
1577
     #elif defined(ACTION_ON_PAUSE)
1578
-      host_action_pause();
1578
+      hostui.pause();
1579
     #endif
1579
     #endif
1580
   }
1580
   }
1581
 
1581
 
1584
     TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false);
1584
     TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false);
1585
     TERN_(SDSUPPORT, if (IS_SD_PAUSED()) queue.inject_P(M24_STR));
1585
     TERN_(SDSUPPORT, if (IS_SD_PAUSED()) queue.inject_P(M24_STR));
1586
     #ifdef ACTION_ON_RESUME
1586
     #ifdef ACTION_ON_RESUME
1587
-      host_action_resume();
1587
+      hostui.resume();
1588
     #endif
1588
     #endif
1589
     print_job_timer.start(); // Also called by M24
1589
     print_job_timer.start(); // Also called by M24
1590
   }
1590
   }
1639
   // Send the status line as a host notification
1639
   // Send the status line as a host notification
1640
   //
1640
   //
1641
   void MarlinUI::set_status(const char * const cstr, const bool) {
1641
   void MarlinUI::set_status(const char * const cstr, const bool) {
1642
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(cstr), UNUSED(cstr));
1642
+    TERN(HOST_PROMPT_SUPPORT, hostui.notify(cstr), UNUSED(cstr));
1643
   }
1643
   }
1644
   void MarlinUI::set_status(FSTR_P const fstr, const int8_t) {
1644
   void MarlinUI::set_status(FSTR_P const fstr, const int8_t) {
1645
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
1645
+    TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr));
1646
   }
1646
   }
1647
   void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) {
1647
   void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) {
1648
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
1648
+    TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr));
1649
   }
1649
   }
1650
 
1650
 
1651
 #endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE
1651
 #endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE

+ 2
- 2
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

58
     #include "../../MarlinCore.h" // for wait_for_user_response()
58
     #include "../../MarlinCore.h" // for wait_for_user_response()
59
   #endif
59
   #endif
60
   #if ENABLED(HOST_PROMPT_SUPPORT)
60
   #if ENABLED(HOST_PROMPT_SUPPORT)
61
-    #include "../../feature/host_actions.h" // for host_prompt_do
61
+    #include "../../feature/host_actions.h" // for hostui.prompt_do
62
   #endif
62
   #endif
63
 
63
 
64
   float lcd_probe_pt(const xy_pos_t &xy) {
64
   float lcd_probe_pt(const xy_pos_t &xy) {
65
     _man_probe_pt(xy);
65
     _man_probe_pt(xy);
66
     ui.defer_status_screen();
66
     ui.defer_status_screen();
67
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
67
+    TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
68
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Delta Calibration in progress")));
68
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Delta Calibration in progress")));
69
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
69
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
70
     ui.goto_previous_screen_no_defer();
70
     ui.goto_previous_screen_no_defer();

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp View File

301
       ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
301
       ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
302
 
302
 
303
     #if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
303
     #if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
304
-      ACTION_ITEM(MSG_HOST_START_PRINT, host_action_start);
304
+      ACTION_ITEM(MSG_HOST_START_PRINT, hostui.start);
305
     #endif
305
     #endif
306
 
306
 
307
     #if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM)
307
     #if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM)

+ 2
- 2
Marlin/src/module/probe.cpp View File

140
       LCD_MESSAGE(MSG_MANUAL_DEPLOY_TOUCHMI);
140
       LCD_MESSAGE(MSG_MANUAL_DEPLOY_TOUCHMI);
141
       ui.return_to_status();
141
       ui.return_to_status();
142
 
142
 
143
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Deploy TouchMI"), FPSTR(CONTINUE_STR)));
143
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Deploy TouchMI"), FPSTR(CONTINUE_STR)));
144
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
144
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
145
       ui.reset_status();
145
       ui.reset_status();
146
       ui.goto_screen(prev_screen);
146
       ui.goto_screen(prev_screen);
295
       ui.set_status(ds_str, 99);
295
       ui.set_status(ds_str, 99);
296
       SERIAL_ECHOLNF(ds_str);
296
       SERIAL_ECHOLNF(ds_str);
297
 
297
 
298
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
298
+      TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
299
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe")));
299
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe")));
300
       TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR)));
300
       TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR)));
301
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
301
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());

Loading…
Cancel
Save