From f7d9305786927a1d95903464af3480fd64049034 Mon Sep 17 00:00:00 2001 From: Vi B-P Date: Thu, 25 Feb 2021 11:23:17 -0500 Subject: [PATCH] Preheat Menu shortcut option (#20350) --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/inc/Conditionals_post.h | 4 ++++ Marlin/src/lcd/menu/menu_main.cpp | 8 ++++++++ Marlin/src/lcd/menu/menu_temperature.cpp | 22 +++++++++++++++++++++- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d545869988..0431b002f3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1147,6 +1147,9 @@ #endif #endif + // Insert a menu for preheating at the top level to allow for quick access + //#define PREHEAT_SHORTCUT_MENU_ITEM + #endif // HAS_LCD_MENU #if HAS_DISPLAY diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 585d48de8c..6de98e2a0e 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2380,6 +2380,10 @@ #endif #endif +#if !PREHEAT_COUNT + #undef PREHEAT_SHORTCUT_MENU_ITEM +#endif + /** * Up to 3 PWM fans */ diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 878ac83a5a..1e864e35be 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -97,6 +97,10 @@ void menu_configuration(); void menu_spindle_laser(); #endif +#if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM) + void menu_preheat_only(); +#endif + #if HAS_MULTI_LANGUAGE void menu_language(); #endif @@ -177,6 +181,10 @@ void menu_main() { ACTION_ITEM(MSG_HOST_START_PRINT, host_action_start); #endif + #if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM) + SUBMENU(MSG_PREHEAT_CUSTOM, menu_preheat_only); + #endif + SUBMENU(MSG_MOTION, menu_motion); } diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 01c1f8f547..f347efe6db 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -226,7 +226,7 @@ void menu_temperature() { #if PREHEAT_COUNT // - // Preheat for Materials 1 to 5 + // Preheat for all Materials // LOOP_L_N(m, PREHEAT_COUNT) { editable.int8 = m; @@ -249,4 +249,24 @@ void menu_temperature() { END_MENU(); } +#if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM) + + void menu_preheat_only() { + START_MENU(); + BACK_ITEM(MSG_MAIN); + + LOOP_L_N(m, PREHEAT_COUNT) { + editable.int8 = m; + #if HOTENDS > 1 || HAS_HEATED_BED + SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); + #else + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + #endif + } + + END_MENU(); + } + +#endif + #endif // HAS_LCD_MENU && HAS_TEMPERATURE