Add HOST_PROMPT_SUPPORT (#13039)

This commit is contained in:
InsanityAutomation
2019-02-12 16:55:47 -05:00
committed by Scott Lahteine
parent 0feeef2604
commit 7f1b69b0c8
189 changed files with 2076 additions and 3479 deletions

View File

@ -28,6 +28,7 @@
#include "../ultralcd.h"
#include "../../module/planner.h"
#include "../../module/motion.h"
#include "../../module/printcounter.h"
#include "../../gcode/queue.h"
#include "../../sd/cardreader.h"
#include "../../libs/buzzer.h"
@ -189,7 +190,9 @@ void MenuItem_bool::action_edit(PGM_P pstr, bool *ptr, screenFunc_t callback) {
void _lcd_set_z_fade_height() { set_z_fade_height(lcd_z_fade_height); }
#endif
bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); }
bool printer_busy() {
return planner.movesplanned() || IS_SD_PRINTING() || print_job_timer.isRunning();
}
/**
* General function to go directly to a screen

View File

@ -52,6 +52,9 @@ void _man_probe_pt(const float &rx, const float &ry) {
KEEPALIVE_STATE(PAUSED_FOR_USER);
ui.defer_status_screen(true);
wait_for_user = true;
#if ENABLED(HOST_PROMPT_SUPPORT)
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
#endif
while (wait_for_user) idle();
KEEPALIVE_STATE(IN_HANDLER);
ui.goto_previous_screen_no_defer();

View File

@ -42,11 +42,19 @@
#include "../../sd/cardreader.h"
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
#include "../../feature/host_actions.h"
#endif
void lcd_pause() {
#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_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress
enqueue_and_echo_commands_P(PSTR("M25 P\nM24"));
@ -75,6 +83,9 @@ void lcd_stop() {
#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();
}
@ -147,9 +158,9 @@ void menu_main() {
}
#endif // !HAS_ENCODER_WHEEL && SDSUPPORT
#if ENABLED(SDSUPPORT) || defined(ACTION_ON_RESUME)
#if ENABLED(SDSUPPORT)
if (card.isFileOpen() && card.isPaused())
#if ENABLED(SDSUPPORT) || ENABLED(HOST_ACTION_COMMANDS)
#if DISABLED(HOST_ACTION_COMMANDS)
if (card_open && card.isPaused())
#endif
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_resume);
#endif