2018-10-28 02:31:06 +00:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2020-02-03 14:00:57 +00:00
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2018-10-28 02:31:06 +00:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 04:57:50 +00:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2018-10-28 02:31:06 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
//
|
|
|
|
// Filament Change Menu
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "../../inc/MarlinConfigPre.h"
|
|
|
|
|
2020-04-24 02:42:38 +00:00
|
|
|
#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
|
2018-10-28 02:31:06 +00:00
|
|
|
|
|
|
|
#include "menu.h"
|
|
|
|
#include "../../module/temperature.h"
|
|
|
|
#include "../../feature/pause.h"
|
2020-04-10 01:05:58 +00:00
|
|
|
#include "../../gcode/queue.h"
|
2019-02-13 02:08:34 +00:00
|
|
|
#if HAS_FILAMENT_SENSOR
|
2019-02-06 12:39:42 +00:00
|
|
|
#include "../../feature/runout.h"
|
|
|
|
#endif
|
2019-03-14 07:26:07 +00:00
|
|
|
|
2018-10-28 02:31:06 +00:00
|
|
|
//
|
|
|
|
// Change Filament > Change/Unload/Load Filament
|
|
|
|
//
|
2020-04-25 15:56:56 +00:00
|
|
|
static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT
|
|
|
|
static int8_t _change_filament_extruder; // = 0
|
2018-10-28 02:31:06 +00:00
|
|
|
|
2020-04-25 15:56:56 +00:00
|
|
|
inline PGM_P _change_filament_command() {
|
|
|
|
switch (_change_filament_mode) {
|
|
|
|
case PAUSE_MODE_LOAD_FILAMENT: return PSTR("M701 T%d");
|
|
|
|
case PAUSE_MODE_UNLOAD_FILAMENT: return _change_filament_extruder >= 0
|
|
|
|
? PSTR("M702 T%d") : PSTR("M702 ;%d");
|
2019-10-03 00:05:12 +00:00
|
|
|
case PAUSE_MODE_CHANGE_FILAMENT:
|
2019-03-14 07:26:07 +00:00
|
|
|
case PAUSE_MODE_PAUSE_PRINT:
|
2020-04-25 15:56:56 +00:00
|
|
|
default: break;
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
2020-04-25 15:56:56 +00:00
|
|
|
return PSTR("M600 B0 T%d");
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
2019-10-08 00:44:33 +00:00
|
|
|
// Initiate Filament Load/Unload/Change at the specified temperature
|
2020-04-25 15:56:56 +00:00
|
|
|
static void _change_filament(const uint16_t celsius) {
|
2018-10-28 02:31:06 +00:00
|
|
|
char cmd[11];
|
2020-04-25 15:56:56 +00:00
|
|
|
sprintf_P(cmd, _change_filament_command(), _change_filament_extruder);
|
|
|
|
thermalManager.setTargetHotend(celsius, _change_filament_extruder);
|
2020-04-10 01:05:58 +00:00
|
|
|
queue.inject(cmd);
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
2019-10-08 00:44:33 +00:00
|
|
|
//
|
|
|
|
// Menu to choose the temperature and start Filament Change
|
|
|
|
//
|
|
|
|
|
|
|
|
inline PGM_P change_filament_header(const PauseMode mode) {
|
2018-10-28 02:31:06 +00:00
|
|
|
switch (mode) {
|
2020-04-25 15:56:56 +00:00
|
|
|
case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTLOAD);
|
|
|
|
case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTUNLOAD);
|
2018-10-28 02:31:06 +00:00
|
|
|
default: break;
|
|
|
|
}
|
2019-10-10 00:46:10 +00:00
|
|
|
return GET_TEXT(MSG_FILAMENTCHANGE);
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
2019-10-08 00:44:33 +00:00
|
|
|
void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
2020-04-25 15:56:56 +00:00
|
|
|
_change_filament_mode = mode;
|
|
|
|
_change_filament_extruder = extruder;
|
2018-10-28 02:31:06 +00:00
|
|
|
START_MENU();
|
2019-09-27 08:06:23 +00:00
|
|
|
if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_CENTER|SS_INVERT);
|
2019-10-03 10:38:30 +00:00
|
|
|
BACK_ITEM(MSG_BACK);
|
2020-06-25 00:44:50 +00:00
|
|
|
ACTION_ITEM(MSG_PREHEAT_1, []{ _change_filament(ui.material_preset[0].hotend_temp); });
|
|
|
|
ACTION_ITEM(MSG_PREHEAT_2, []{ _change_filament(ui.material_preset[1].hotend_temp); });
|
2020-04-27 12:53:58 +00:00
|
|
|
EDIT_ITEM_FAST(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_extruder].target, EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, []{
|
2020-04-25 15:56:56 +00:00
|
|
|
_change_filament(thermalManager.temp_hotend[_change_filament_extruder].target);
|
2019-10-08 00:44:33 +00:00
|
|
|
});
|
2018-10-28 02:31:06 +00:00
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* "Change Filament" submenu
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
|
|
|
|
2020-04-28 04:52:11 +00:00
|
|
|
void menu_change_filament() {
|
2019-10-08 00:44:33 +00:00
|
|
|
// Say "filament change" when no print is active
|
|
|
|
editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT;
|
|
|
|
|
2020-04-28 04:52:11 +00:00
|
|
|
#if E_STEPPERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
|
|
|
|
bool too_cold = false;
|
|
|
|
for (uint8_t s = 0; !too_cold && s < E_STEPPERS; s++)
|
|
|
|
too_cold = thermalManager.targetTooColdToExtrude(s);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
|
|
|
const bool is_busy = printer_busy();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
START_MENU();
|
|
|
|
BACK_ITEM(MSG_MAIN);
|
|
|
|
|
2018-10-28 02:31:06 +00:00
|
|
|
// Change filament
|
|
|
|
#if E_STEPPERS == 1
|
2019-11-15 02:30:30 +00:00
|
|
|
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE);
|
2020-04-29 19:52:42 +00:00
|
|
|
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else
|
2019-11-15 02:30:30 +00:00
|
|
|
GCODES_ITEM_P(msg, PSTR("M600 B0"));
|
2018-10-28 02:31:06 +00:00
|
|
|
#else
|
2019-11-15 02:30:30 +00:00
|
|
|
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E);
|
2020-03-14 04:18:16 +00:00
|
|
|
LOOP_L_N(s, E_STEPPERS) {
|
2020-04-29 19:52:42 +00:00
|
|
|
if (thermalManager.targetTooColdToExtrude(s))
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else {
|
2019-11-15 02:30:30 +00:00
|
|
|
ACTION_ITEM_N_P(s, msg, []{
|
2020-01-27 21:57:22 +00:00
|
|
|
char cmd[13];
|
2019-11-15 02:30:30 +00:00
|
|
|
sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex));
|
2020-04-10 01:05:58 +00:00
|
|
|
queue.inject(cmd);
|
2019-11-15 02:30:30 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2018-10-28 02:31:06 +00:00
|
|
|
|
|
|
|
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
2020-04-28 04:52:11 +00:00
|
|
|
if (!is_busy) {
|
2018-10-28 02:31:06 +00:00
|
|
|
// Load filament
|
|
|
|
#if E_STEPPERS == 1
|
2019-11-15 02:30:30 +00:00
|
|
|
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD);
|
2020-04-29 19:52:42 +00:00
|
|
|
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else
|
2019-11-15 02:30:30 +00:00
|
|
|
GCODES_ITEM_P(msg_load, PSTR("M701"));
|
2018-10-28 02:31:06 +00:00
|
|
|
#else
|
2019-11-15 02:30:30 +00:00
|
|
|
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E);
|
2020-03-14 04:18:16 +00:00
|
|
|
LOOP_L_N(s, E_STEPPERS) {
|
2020-04-29 19:52:42 +00:00
|
|
|
if (thermalManager.targetTooColdToExtrude(s))
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else {
|
2019-11-15 02:30:30 +00:00
|
|
|
ACTION_ITEM_N_P(s, msg_load, []{
|
|
|
|
char cmd[12];
|
|
|
|
sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex));
|
2020-04-10 01:05:58 +00:00
|
|
|
queue.inject(cmd);
|
2019-11-15 02:30:30 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2018-10-28 02:31:06 +00:00
|
|
|
|
|
|
|
// Unload filament
|
|
|
|
#if E_STEPPERS == 1
|
2019-11-15 02:30:30 +00:00
|
|
|
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD);
|
2020-04-29 19:52:42 +00:00
|
|
|
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else
|
2019-11-15 02:30:30 +00:00
|
|
|
GCODES_ITEM_P(msg_unload, PSTR("M702"));
|
2018-10-28 02:31:06 +00:00
|
|
|
#else
|
|
|
|
#if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
|
2020-04-29 19:52:42 +00:00
|
|
|
if (too_cold)
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else
|
2020-04-28 04:52:11 +00:00
|
|
|
GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702"));
|
2019-11-15 02:30:30 +00:00
|
|
|
#endif
|
|
|
|
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E);
|
2020-03-14 04:18:16 +00:00
|
|
|
LOOP_L_N(s, E_STEPPERS) {
|
2020-04-29 19:52:42 +00:00
|
|
|
if (thermalManager.targetTooColdToExtrude(s))
|
2019-11-15 02:30:30 +00:00
|
|
|
SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
|
2020-04-29 19:52:42 +00:00
|
|
|
else {
|
2019-11-15 02:30:30 +00:00
|
|
|
ACTION_ITEM_N_P(s, msg_unload, []{
|
|
|
|
char cmd[12];
|
|
|
|
sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex));
|
2020-04-10 01:05:58 +00:00
|
|
|
queue.inject(cmd);
|
2019-11-15 02:30:30 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
} // !printer_busy
|
2018-10-28 02:31:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static uint8_t hotend_status_extruder = 0;
|
|
|
|
|
2019-03-14 07:26:07 +00:00
|
|
|
static PGM_P pause_header() {
|
|
|
|
switch (pause_mode) {
|
2020-04-28 04:52:11 +00:00
|
|
|
case PAUSE_MODE_CHANGE_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER);
|
|
|
|
case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_LOAD);
|
|
|
|
case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_UNLOAD);
|
2018-10-28 02:31:06 +00:00
|
|
|
default: break;
|
|
|
|
}
|
2019-10-10 00:46:10 +00:00
|
|
|
return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE);
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Portions from STATIC_ITEM...
|
|
|
|
#define HOTEND_STATUS_ITEM() do { \
|
|
|
|
if (_menuLineNr == _thisItemNr) { \
|
2018-11-11 18:16:24 +00:00
|
|
|
if (ui.should_draw()) { \
|
2019-11-02 12:28:20 +00:00
|
|
|
MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT); \
|
2018-11-11 18:16:24 +00:00
|
|
|
ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \
|
2018-10-28 02:31:06 +00:00
|
|
|
} \
|
|
|
|
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
2018-11-11 18:16:24 +00:00
|
|
|
ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
|
2018-10-28 02:31:06 +00:00
|
|
|
++encoderLine; \
|
|
|
|
} \
|
2018-11-11 18:16:24 +00:00
|
|
|
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); \
|
2018-10-28 02:31:06 +00:00
|
|
|
} \
|
|
|
|
++_thisItemNr; \
|
|
|
|
}while(0)
|
|
|
|
|
2019-03-14 07:26:07 +00:00
|
|
|
void menu_pause_option() {
|
2018-10-28 02:31:06 +00:00
|
|
|
START_MENU();
|
|
|
|
#if LCD_HEIGHT > 2
|
2019-09-27 08:06:23 +00:00
|
|
|
STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER);
|
2018-10-28 02:31:06 +00:00
|
|
|
#endif
|
2019-11-02 05:05:05 +00:00
|
|
|
ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_PURGE, []{ pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; });
|
2020-04-28 04:52:11 +00:00
|
|
|
|
2019-02-13 02:08:34 +00:00
|
|
|
#if HAS_FILAMENT_SENSOR
|
2020-04-28 04:52:11 +00:00
|
|
|
const bool still_out = runout.filament_ran_out;
|
2020-04-29 19:52:42 +00:00
|
|
|
if (still_out)
|
2019-10-03 10:38:30 +00:00
|
|
|
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
|
2020-04-28 04:52:11 +00:00
|
|
|
#else
|
|
|
|
constexpr bool still_out = false;
|
2019-02-06 12:39:42 +00:00
|
|
|
#endif
|
2020-04-28 04:52:11 +00:00
|
|
|
|
2020-04-29 19:52:42 +00:00
|
|
|
if (!still_out)
|
2020-04-28 04:52:11 +00:00
|
|
|
ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_RESUME, []{ pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; });
|
|
|
|
|
2018-10-28 02:31:06 +00:00
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
|
2018-11-06 10:13:48 +00:00
|
|
|
//
|
|
|
|
// ADVANCED_PAUSE_FEATURE message screens
|
|
|
|
//
|
2019-10-10 00:46:10 +00:00
|
|
|
// Warning: msg must have three null bytes to delimit lines!
|
|
|
|
//
|
|
|
|
void _lcd_pause_message(PGM_P const msg) {
|
|
|
|
PGM_P const msg1 = msg;
|
|
|
|
PGM_P const msg2 = msg1 + strlen_P(msg1) + 1;
|
|
|
|
PGM_P const msg3 = msg2 + strlen_P(msg2) + 1;
|
|
|
|
const bool has2 = msg2[0], has3 = msg3[0],
|
|
|
|
skip1 = !has2 && (LCD_HEIGHT) >= 5;
|
2018-11-06 10:13:48 +00:00
|
|
|
|
2018-10-28 02:31:06 +00:00
|
|
|
START_SCREEN();
|
2019-10-10 00:46:10 +00:00
|
|
|
STATIC_ITEM_P(pause_header(), SS_CENTER|SS_INVERT); // 1: Header
|
|
|
|
if (skip1) SKIP_ITEM(); // Move a single-line message down
|
|
|
|
STATIC_ITEM_P(msg1); // 2: Message Line 1
|
|
|
|
if (has2) STATIC_ITEM_P(msg2); // 3: Message Line 2
|
|
|
|
if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); // 4: Message Line 3 (if LCD has 5 lines)
|
|
|
|
if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM(); // Push Hotend Status down, if needed
|
|
|
|
HOTEND_STATUS_ITEM(); // 5: Hotend Status
|
2018-10-28 02:31:06 +00:00
|
|
|
END_SCREEN();
|
|
|
|
}
|
|
|
|
|
2020-04-12 01:36:17 +00:00
|
|
|
void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); }
|
2019-10-10 00:46:10 +00:00
|
|
|
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)); }
|
|
|
|
void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT)); }
|
|
|
|
void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); }
|
|
|
|
void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); }
|
|
|
|
void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING)); }
|
|
|
|
void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); }
|
2018-10-28 02:31:06 +00:00
|
|
|
|
2019-03-14 07:26:07 +00:00
|
|
|
void lcd_pause_purge_message() {
|
2019-10-10 00:46:10 +00:00
|
|
|
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
|
|
|
|
_lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE));
|
|
|
|
#else
|
|
|
|
_lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE));
|
|
|
|
#endif
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
2019-03-14 07:26:07 +00:00
|
|
|
FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) {
|
2018-10-28 02:31:06 +00:00
|
|
|
switch (message) {
|
2020-04-12 01:36:17 +00:00
|
|
|
case PAUSE_MESSAGE_PARKING: return lcd_pause_parking_message;
|
2019-03-14 07:26:07 +00:00
|
|
|
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;
|
|
|
|
case PAUSE_MESSAGE_INSERT: return lcd_pause_insert_message;
|
|
|
|
case PAUSE_MESSAGE_LOAD: return lcd_pause_load_message;
|
|
|
|
case PAUSE_MESSAGE_PURGE: return lcd_pause_purge_message;
|
|
|
|
case PAUSE_MESSAGE_RESUME: return lcd_pause_resume_message;
|
|
|
|
case PAUSE_MESSAGE_HEAT: return lcd_pause_heat_message;
|
|
|
|
case PAUSE_MESSAGE_HEATING: return lcd_pause_heating_message;
|
|
|
|
case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
|
2019-06-23 08:43:36 +00:00
|
|
|
return menu_pause_option;
|
2019-03-14 07:26:07 +00:00
|
|
|
case PAUSE_MESSAGE_STATUS:
|
2018-10-28 02:31:06 +00:00
|
|
|
default: break;
|
|
|
|
}
|
2019-05-09 16:45:55 +00:00
|
|
|
return nullptr;
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
2019-03-14 07:26:07 +00:00
|
|
|
void lcd_pause_show_message(
|
|
|
|
const PauseMessage message,
|
|
|
|
const PauseMode mode/*=PAUSE_MODE_SAME*/,
|
2018-10-28 02:31:06 +00:00
|
|
|
const uint8_t extruder/*=active_extruder*/
|
|
|
|
) {
|
2019-03-14 07:26:07 +00:00
|
|
|
if (mode != PAUSE_MODE_SAME) pause_mode = mode;
|
2018-10-28 02:31:06 +00:00
|
|
|
hotend_status_extruder = extruder;
|
|
|
|
const screenFunc_t next_screen = ap_message_screen(message);
|
|
|
|
if (next_screen) {
|
2019-03-23 21:30:43 +00:00
|
|
|
ui.defer_status_screen();
|
2018-11-11 18:16:24 +00:00
|
|
|
ui.goto_screen(next_screen);
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
else
|
2018-11-11 18:16:24 +00:00
|
|
|
ui.return_to_status();
|
2018-10-28 02:31:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HAS_LCD_MENU && ADVANCED_PAUSE_FEATURE
|