Browse Source

runout.distance_mm LCD edit item (#14066)

Robby Candra 5 years ago
parent
commit
f30b89953d
2 changed files with 17 additions and 0 deletions
  1. 3
    0
      Marlin/src/lcd/language/language_en.h
  2. 14
    0
      Marlin/src/lcd/menu/menu_advanced.cpp

+ 3
- 0
Marlin/src/lcd/language/language_en.h View File

@@ -1197,6 +1197,9 @@
1197 1197
 #ifndef MSG_RUNOUT_SENSOR
1198 1198
   #define MSG_RUNOUT_SENSOR                   _UxGT("Runout Sensor")
1199 1199
 #endif
1200
+#ifndef MSG_RUNOUT_DISTANCE_MM
1201
+  #define MSG_RUNOUT_DISTANCE_MM              _UxGT("Runout Dist mm")
1202
+#endif
1200 1203
 #ifndef MSG_ERR_HOMING_FAILED
1201 1204
   #define MSG_ERR_HOMING_FAILED               _UxGT("Homing failed")
1202 1205
 #endif

+ 14
- 0
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -43,6 +43,11 @@
43 43
   #include "../../module/temperature.h"
44 44
 #endif
45 45
 
46
+#ifdef FILAMENT_RUNOUT_DISTANCE_MM
47
+  #include "../../feature/runout.h"
48
+  float lcd_runout_distance_mm;
49
+#endif
50
+
46 51
 void menu_tmc();
47 52
 void menu_backlash();
48 53
 
@@ -214,6 +219,12 @@ void menu_backlash();
214 219
       #endif // EXTRUDERS > 1
215 220
     #endif
216 221
 
222
+    #ifdef FILAMENT_RUNOUT_DISTANCE_MM
223
+      MENU_ITEM_EDIT_CALLBACK(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{
224
+        runout.set_runout_distance(lcd_runout_distance_mm);
225
+      });
226
+    #endif
227
+
217 228
     END_MENU();
218 229
   }
219 230
 
@@ -603,6 +614,9 @@ void menu_backlash();
603 614
 #endif // !SLIM_LCD_MENUS
604 615
 
605 616
 void menu_advanced_settings() {
617
+  #ifdef FILAMENT_RUNOUT_DISTANCE_MM
618
+    lcd_runout_distance_mm = runout.runout_distance();
619
+  #endif  
606 620
   START_MENU();
607 621
   MENU_BACK(MSG_CONFIGURATION);
608 622
 

Loading…
Cancel
Save