From 69d496e15725f611a21b12b882a58763f4b3380b Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Wed, 27 Dec 2017 21:57:51 +0100 Subject: [PATCH] autoload filament menu (PFW-95, PFW-96) --- Firmware/language_all.cpp | 5 +++++ Firmware/language_all.h | 2 ++ Firmware/language_en.h | 1 + Firmware/ultralcd.cpp | 11 ++++++++--- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Firmware/language_all.cpp b/Firmware/language_all.cpp index 18556e86..d16a0530 100644 --- a/Firmware/language_all.cpp +++ b/Firmware/language_all.cpp @@ -34,6 +34,11 @@ const char * const MSG_AUTHOR_LANG_TABLE[1] PROGMEM = { MSG_AUTHOR_EN }; +const char MSG_AUTOLOAD_FILAMENT_EN[] PROGMEM = "AUTOLoad filament"; +const char * const MSG_AUTOLOAD_FILAMENT_LANG_TABLE[1] PROGMEM = { + MSG_AUTOLOAD_FILAMENT_EN +}; + const char MSG_AUTO_HOME_EN[] PROGMEM = "Auto home"; const char * const MSG_AUTO_HOME_LANG_TABLE[1] PROGMEM = { MSG_AUTO_HOME_EN diff --git a/Firmware/language_all.h b/Firmware/language_all.h index 41af38fa..d514f00b 100644 --- a/Firmware/language_all.h +++ b/Firmware/language_all.h @@ -32,6 +32,8 @@ extern const char* const MSG_AMAX_LANG_TABLE[1]; #define MSG_AMAX LANG_TABLE_SELECT_EXPLICIT(MSG_AMAX_LANG_TABLE, 0) extern const char* const MSG_AUTHOR_LANG_TABLE[1]; #define MSG_AUTHOR LANG_TABLE_SELECT_EXPLICIT(MSG_AUTHOR_LANG_TABLE, 0) +extern const char* const MSG_AUTOLOAD_FILAMENT_LANG_TABLE[1]; +#define MSG_AUTOLOAD_FILAMENT LANG_TABLE_SELECT_EXPLICIT(MSG_AUTOLOAD_FILAMENT_LANG_TABLE, 0) extern const char* const MSG_AUTO_HOME_LANG_TABLE[1]; #define MSG_AUTO_HOME LANG_TABLE_SELECT_EXPLICIT(MSG_AUTO_HOME_LANG_TABLE, 0) extern const char* const MSG_A_RETRACT_LANG_TABLE[1]; diff --git a/Firmware/language_en.h b/Firmware/language_en.h index adc25d4b..9e1ac19b 100644 --- a/Firmware/language_en.h +++ b/Firmware/language_en.h @@ -70,6 +70,7 @@ #define MSG_SETTINGS "Settings" #define MSG_PREHEAT "Preheat" #define(length=17) MSG_UNLOAD_FILAMENT "Unload filament" +#define(length=17) MSG_AUTOLOAD_FILAMENT "AUTOLoad filament" #define(length=17) MSG_LOAD_FILAMENT "Load filament" #define(length=17) MSG_LOAD_FILAMENT_1 "Load filament 1" #define(length=17) MSG_LOAD_FILAMENT_2 "Load filament 2" diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 65eb6d56..3e145fa1 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1930,11 +1930,16 @@ void lcd_LoadFilament() { if (degHotend0() > EXTRUDE_MINTEMP) { + if (filament_autoload_enabled) + { + lcd_show_fullscreen_message_and_wait_P(PSTR("Autoloading filament is active, just insert filament...")); + return; + } custom_message = true; loading_flag = true; enquecommand_P(PSTR("M701")); //load filament SERIAL_ECHOLN("Loading filament"); - } + } else { @@ -5034,9 +5039,9 @@ static void lcd_main_menu() { #ifndef SNMM if (!filament_autoload_enabled) - { MENU_ITEM(function, MSG_LOAD_FILAMENT, lcd_LoadFilament); - } + else + MENU_ITEM(function, MSG_AUTOLOAD_FILAMENT, lcd_LoadFilament); MENU_ITEM(function, MSG_UNLOAD_FILAMENT, lcd_unLoadFilament); #endif #ifdef SNMM