Import ENABLE_LEVELING_FADE_HEIGHT from 2.0.x (#9834)

This commit is contained in:
Scott Lahteine 2018-02-26 22:16:09 -06:00 committed by GitHub
parent ce5c848284
commit 1eb3364ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,6 +232,11 @@ uint16_t max_display_update_time = 0;
void lcd_delta_calibrate_menu(); void lcd_delta_calibrate_menu();
#endif #endif
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
static float new_z_fade_height;
void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); }
#endif
//////////////////////////////////////////// ////////////////////////////////////////////
//////////// Menu System Actions /////////// //////////// Menu System Actions ///////////
//////////////////////////////////////////// ////////////////////////////////////////////
@ -978,6 +983,13 @@ void kill_screen(const char* lcd_msg) {
* *
*/ */
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
void _lcd_goto_tune_menu() {
lcd_goto_screen(lcd_tune_menu);
new_z_fade_height = planner.z_fade_height;
}
#endif
void lcd_main_menu() { void lcd_main_menu() {
START_MENU(); START_MENU();
MENU_BACK(MSG_WATCH); MENU_BACK(MSG_WATCH);
@ -1005,7 +1017,13 @@ void kill_screen(const char* lcd_msg) {
#endif #endif
if (planner.movesplanned() || IS_SD_PRINTING) { if (planner.movesplanned() || IS_SD_PRINTING) {
MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); MENU_ITEM(submenu, MSG_TUNE,
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
_lcd_goto_tune_menu
#else
lcd_tune_menu
#endif
);
} }
else { else {
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
@ -1298,7 +1316,9 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
#endif #endif
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height);
#endif
// //
// Nozzle: // Nozzle:
// Nozzle [1-4]: // Nozzle [1-4]:
@ -1926,11 +1946,6 @@ void kill_screen(const char* lcd_msg) {
static bool new_level_state; static bool new_level_state;
void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(new_level_state); } void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(new_level_state); }
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
static float new_z_fade_height;
void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); }
#endif
/** /**
* Step 1: Bed Level entry-point * Step 1: Bed Level entry-point
* *
@ -1991,17 +2006,24 @@ void kill_screen(const char* lcd_msg) {
END_MENU(); END_MENU();
} }
void _lcd_goto_bed_leveling() { #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
lcd_goto_screen(lcd_bed_leveling); void _lcd_goto_bed_leveling() {
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) lcd_goto_screen(lcd_bed_leveling);
new_z_fade_height = planner.z_fade_height; new_z_fade_height = planner.z_fade_height;
#endif }
} #endif
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)
void _lcd_ubl_level_bed(); void _lcd_ubl_level_bed();
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
void _lcd_goto_ubl_level_bed() {
lcd_goto_screen(_lcd_ubl_level_bed);
new_z_fade_height = planner.z_fade_height;
}
#endif
static int16_t ubl_storage_slot = 0, static int16_t ubl_storage_slot = 0,
custom_hotend_temp = 190, custom_hotend_temp = 190,
side_points = 3, side_points = 3,
@ -2518,6 +2540,9 @@ void kill_screen(const char* lcd_msg) {
MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map);
MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu);
MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W"));
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height);
#endif
END_MENU(); END_MENU();
} }
@ -2559,7 +2584,13 @@ void kill_screen(const char* lcd_msg) {
// Level Bed // Level Bed
// //
#if ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(AUTO_BED_LEVELING_UBL)
MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); MENU_ITEM(submenu, MSG_UBL_LEVEL_BED,
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
_lcd_goto_ubl_level_bed
#else
_lcd_ubl_level_bed
#endif
);
#elif ENABLED(LCD_BED_LEVELING) #elif ENABLED(LCD_BED_LEVELING)
#if ENABLED(PROBE_MANUALLY) #if ENABLED(PROBE_MANUALLY)
if (!g29_in_progress) if (!g29_in_progress)