🎨 Refactor Host Actions as singleton

This commit is contained in:
Scott Lahteine
2021-10-15 00:24:08 -05:00
parent de5aefd09e
commit ee28a14e8e
26 changed files with 208 additions and 150 deletions

View File

@@ -96,8 +96,7 @@ void event_filament_runout(const uint8_t extruder) {
//action:out_of_filament
#if ENABLED(HOST_PROMPT_SUPPORT)
host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool);
host_action_prompt_show();
hostui.prompt_do(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool); //action:out_of_filament
#endif
const bool run_runout_script = !runout.host_handling;
@@ -109,18 +108,18 @@ void event_filament_runout(const uint8_t extruder) {
|| TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
)
) {
host_action_paused(false);
hostui.paused(false);
}
else {
// Legacy Repetier command for use until newer version supports standard dialog
// To be removed later when pause command also triggers dialog
#ifdef ACTION_ON_FILAMENT_RUNOUT
host_action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
hostui.action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
SERIAL_CHAR(tool);
SERIAL_EOL();
#endif
host_action_pause(false);
hostui.pause(false);
}
SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
SERIAL_CHAR(tool);