Fix up pausing / parking display (#17460)

This commit is contained in:
Scott Lahteine
2020-04-11 20:36:17 -05:00
committed by GitHub
parent dfb5968bfe
commit e4903396d4
18 changed files with 43 additions and 60 deletions

View File

@ -76,9 +76,6 @@ int32_t MenuEditItemBase::minEditValue,
screenFunc_t MenuEditItemBase::callbackFunc;
bool MenuEditItemBase::liveEdit;
// Prevent recursion into screen handlers
bool no_reentry = false;
////////////////////////////////////////////
//////// Menu Navigation & History /////////
////////////////////////////////////////////
@ -314,29 +311,18 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
////////////////////////////////////////////
//
// Display the synchronize screen until moves are
// finished, and don't return to the caller until
// done. ** This blocks the command queue! **
// Display a "synchronize" screen with a custom message until
// all moves are finished. Go back to calling screen when done.
//
static PGM_P sync_message;
void MarlinUI::_synchronize() {
if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message);
if (no_reentry) return;
// Make this the current handler till all moves are done
const screenFunc_t old_screen = currentScreen;
goto_screen(_synchronize);
no_reentry = true;
planner.synchronize(); // idle() is called until moves complete
no_reentry = false;
goto_screen(old_screen);
}
// Display the synchronize screen with a custom message
// ** This blocks the command queue! **
void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) {
sync_message = msg ?: GET_TEXT(MSG_MOVING);
_synchronize();
static PGM_P sync_message = msg ?: GET_TEXT(MSG_MOVING);
save_previous_screen();
goto_screen([]{
if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message);
});
defer_status_screen();
planner.synchronize(); // idle() is called until moves complete
goto_previous_screen_no_defer();
}
/**

View File

@ -262,7 +262,7 @@ void _lcd_pause_message(PGM_P const msg) {
END_SCREEN();
}
void lcd_pause_pausing_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_INIT)); }
void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); }
void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); }
void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); }
void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); }
@ -282,7 +282,7 @@ void lcd_pause_purge_message() {
FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) {
switch (message) {
case PAUSE_MESSAGE_PAUSING: return lcd_pause_pausing_message;
case PAUSE_MESSAGE_PARKING: return lcd_pause_parking_message;
case PAUSE_MESSAGE_CHANGING: return lcd_pause_changing_message;
case PAUSE_MESSAGE_UNLOAD: return lcd_pause_unload_message;
case PAUSE_MESSAGE_WAITING: return lcd_pause_waiting_message;

View File

@ -51,7 +51,7 @@ float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5
// separate value that doesn't lose precision.
static int16_t ubl_encoderPosition = 0;
static void _lcd_mesh_fine_tune(PGM_P msg) {
static void _lcd_mesh_fine_tune(PGM_P const msg) {
ui.defer_status_screen();
if (ubl.encoder_diff) {
ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1;
@ -74,12 +74,13 @@ static void _lcd_mesh_fine_tune(PGM_P msg) {
}
}
void _lcd_mesh_edit_NOP() {
void lcd_limbo() {
ui.currentScreen = []{};
ui.defer_status_screen();
}
float lcd_mesh_edit() {
ui.goto_screen(_lcd_mesh_edit_NOP);
lcd_limbo();
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
_lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDITOR));
return mesh_edit_value;
@ -87,7 +88,7 @@ float lcd_mesh_edit() {
void lcd_mesh_edit_setup(const float &initial) {
mesh_edit_value = mesh_edit_accumulator = initial;
ui.goto_screen(_lcd_mesh_edit_NOP);
lcd_limbo();
}
void _lcd_z_offset_edit() {
@ -437,10 +438,9 @@ void ubl_map_move_to_xy() {
void set_current_from_steppers_for_axis(const AxisEnum axis);
void sync_plan_position();
void _lcd_do_nothing() {}
void _lcd_hard_stop() {
const screenFunc_t old_screen = ui.currentScreen;
ui.currentScreen = _lcd_do_nothing;
lcd_limbo();
planner.quick_stop();
ui.currentScreen = old_screen;
set_current_from_steppers_for_axis(ALL_AXES);