MarlinUI support for up to 5 Material Presets (#18488)
- Add `I` preset parameter to `G26`, `M106`, `M140`, and `M190`. - Extend menu items to permit a string interpolation. - Keep material names in a list and interpolate in menu items. - Extend material presets to support up to 5 predefined materials. Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@@ -300,11 +300,12 @@ void menu_advanced_settings();
|
||||
|
||||
#if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS)
|
||||
|
||||
void _menu_configuration_preheat_settings(const uint8_t m) {
|
||||
void _menu_configuration_preheat_settings() {
|
||||
#define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP,
|
||||
#define _MAXTEMP_ITEM(N) HEATER_##N##_MAXTEMP,
|
||||
#define MINTEMP_ALL _MIN(REPEAT(HOTENDS, _MINTEMP_ITEM) 999)
|
||||
#define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
|
||||
const uint8_t m = MenuItemBase::itemIndex;
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
#if HAS_FAN
|
||||
@@ -323,18 +324,6 @@ void menu_advanced_settings();
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
void menu_preheat_material1_settings() { _menu_configuration_preheat_settings(0); }
|
||||
void menu_preheat_material2_settings() { _menu_configuration_preheat_settings(1); }
|
||||
#if PREHEAT_COUNT >= 3
|
||||
void menu_preheat_material3_settings() { _menu_configuration_preheat_settings(3); }
|
||||
#if PREHEAT_COUNT >= 4
|
||||
void menu_preheat_material4_settings() { _menu_configuration_preheat_settings(4); }
|
||||
#if PREHEAT_COUNT >= 5
|
||||
void menu_preheat_material5_settings() { _menu_configuration_preheat_settings(5); }
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void menu_configuration() {
|
||||
@@ -414,17 +403,8 @@ void menu_configuration() {
|
||||
|
||||
// Preheat configurations
|
||||
#if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS)
|
||||
SUBMENU(MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings);
|
||||
SUBMENU(MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings);
|
||||
#if PREHEAT_COUNT >= 3
|
||||
SUBMENU(MSG_PREHEAT_3_SETTINGS, menu_preheat_material3_settings);
|
||||
#if PREHEAT_COUNT >= 4
|
||||
SUBMENU(MSG_PREHEAT_4_SETTINGS, menu_preheat_material4_settings);
|
||||
#if PREHEAT_COUNT >= 5
|
||||
SUBMENU(MSG_PREHEAT_5_SETTINGS, menu_preheat_material5_settings);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
LOOP_L_N(m, PREHEAT_COUNT)
|
||||
SUBMENU_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings);
|
||||
#endif
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
Reference in New Issue
Block a user