Simplify and fix z fade height editing

Fix #10761
This commit is contained in:
Scott Lahteine 2018-05-20 12:32:25 -05:00
parent ad49088173
commit bf61be8ede

View File

@ -493,6 +493,11 @@ uint16_t max_display_update_time = 0;
void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
if (currentScreen != screen) { if (currentScreen != screen) {
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
// Shadow for editing the fade height
new_z_fade_height = planner.z_fade_height;
#endif
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING)
static millis_t doubleclick_expire_ms = 0; static millis_t doubleclick_expire_ms = 0;
// Going to lcd_main_menu from status screen? Remember first click time. // Going to lcd_main_menu from status screen? Remember first click time.
@ -1067,13 +1072,6 @@ void lcd_quick_feedback(const bool clear_buttons) {
* *
*/ */
#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);
@ -1100,18 +1098,11 @@ void lcd_quick_feedback(const bool clear_buttons) {
MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
#endif #endif
if (planner.movesplanned() || IS_SD_PRINTING) { if (planner.movesplanned() || IS_SD_PRINTING)
MENU_ITEM(submenu, MSG_TUNE, MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) else
_lcd_goto_tune_menu
#else
lcd_tune_menu
#endif
);
}
else {
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
}
MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
@ -2048,13 +2039,6 @@ void lcd_quick_feedback(const bool clear_buttons) {
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,
@ -2653,13 +2637,6 @@ void lcd_quick_feedback(const bool clear_buttons) {
END_MENU(); END_MENU();
} }
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
void _lcd_goto_bed_leveling() {
lcd_goto_screen(lcd_bed_leveling);
new_z_fade_height = planner.z_fade_height;
}
#endif
#endif // LCD_BED_LEVELING #endif // LCD_BED_LEVELING
/** /**
@ -2699,29 +2676,14 @@ void lcd_quick_feedback(const bool clear_buttons) {
// //
#if ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(AUTO_BED_LEVELING_UBL)
MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, ( MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_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)
#endif #endif
MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling);
MENU_ITEM(submenu, MSG_BED_LEVELING, (
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
_lcd_goto_bed_leveling
#else
lcd_bed_leveling
#endif
)
);
#elif PLANNER_LEVELING && DISABLED(SLIM_LCD_MENUS) #elif PLANNER_LEVELING && DISABLED(SLIM_LCD_MENUS)