From f30b89953df1c53cb57c95216e33d1203da6b002 Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Tue, 11 Jun 2019 08:18:06 +0700 Subject: [PATCH] runout.distance_mm LCD edit item (#14066) --- Marlin/src/lcd/language/language_en.h | 3 +++ Marlin/src/lcd/menu/menu_advanced.cpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 163f7e83a6..2fee46b2fe 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -1197,6 +1197,9 @@ #ifndef MSG_RUNOUT_SENSOR #define MSG_RUNOUT_SENSOR _UxGT("Runout Sensor") #endif +#ifndef MSG_RUNOUT_DISTANCE_MM + #define MSG_RUNOUT_DISTANCE_MM _UxGT("Runout Dist mm") +#endif #ifndef MSG_ERR_HOMING_FAILED #define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index c3c3a76aa6..432b37ad27 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -43,6 +43,11 @@ #include "../../module/temperature.h" #endif +#ifdef FILAMENT_RUNOUT_DISTANCE_MM + #include "../../feature/runout.h" + float lcd_runout_distance_mm; +#endif + void menu_tmc(); void menu_backlash(); @@ -214,6 +219,12 @@ void menu_backlash(); #endif // EXTRUDERS > 1 #endif + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + MENU_ITEM_EDIT_CALLBACK(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{ + runout.set_runout_distance(lcd_runout_distance_mm); + }); + #endif + END_MENU(); } @@ -603,6 +614,9 @@ void menu_backlash(); #endif // !SLIM_LCD_MENUS void menu_advanced_settings() { + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + lcd_runout_distance_mm = runout.runout_distance(); + #endif START_MENU(); MENU_BACK(MSG_CONFIGURATION);