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
 #ifndef MSG_RUNOUT_SENSOR
1197
 #ifndef MSG_RUNOUT_SENSOR
1198
   #define MSG_RUNOUT_SENSOR                   _UxGT("Runout Sensor")
1198
   #define MSG_RUNOUT_SENSOR                   _UxGT("Runout Sensor")
1199
 #endif
1199
 #endif
1200
+#ifndef MSG_RUNOUT_DISTANCE_MM
1201
+  #define MSG_RUNOUT_DISTANCE_MM              _UxGT("Runout Dist mm")
1202
+#endif
1200
 #ifndef MSG_ERR_HOMING_FAILED
1203
 #ifndef MSG_ERR_HOMING_FAILED
1201
   #define MSG_ERR_HOMING_FAILED               _UxGT("Homing failed")
1204
   #define MSG_ERR_HOMING_FAILED               _UxGT("Homing failed")
1202
 #endif
1205
 #endif

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

43
   #include "../../module/temperature.h"
43
   #include "../../module/temperature.h"
44
 #endif
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
 void menu_tmc();
51
 void menu_tmc();
47
 void menu_backlash();
52
 void menu_backlash();
48
 
53
 
214
       #endif // EXTRUDERS > 1
219
       #endif // EXTRUDERS > 1
215
     #endif
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
     END_MENU();
228
     END_MENU();
218
   }
229
   }
219
 
230
 
603
 #endif // !SLIM_LCD_MENUS
614
 #endif // !SLIM_LCD_MENUS
604
 
615
 
605
 void menu_advanced_settings() {
616
 void menu_advanced_settings() {
617
+  #ifdef FILAMENT_RUNOUT_DISTANCE_MM
618
+    lcd_runout_distance_mm = runout.runout_distance();
619
+  #endif  
606
   START_MENU();
620
   START_MENU();
607
   MENU_BACK(MSG_CONFIGURATION);
621
   MENU_BACK(MSG_CONFIGURATION);
608
 
622
 

Loading…
Cancel
Save