Hide multi-step G29 on Ender 3 V2

This commit is contained in:
Scott Lahteine 2020-09-03 16:52:31 -05:00 committed by Scott Lahteine
parent c113984b32
commit 4f1a14532b

View file

@ -28,6 +28,10 @@
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) && DISABLED(PROBE_MANUALLY)
#define HAS_ONESTEP_LEVELING 1
#endif
#include "dwin.h" #include "dwin.h"
#include <WString.h> #include <WString.h>
@ -57,7 +61,7 @@
#include "../../feature/host_actions.h" #include "../../feature/host_actions.h"
#endif #endif
#if HAS_LEVELING #if HAS_ONESTEP_LEVELING
#include "../../feature/bedlevel/bedlevel.h" #include "../../feature/bedlevel/bedlevel.h"
#endif #endif
@ -596,7 +600,7 @@ inline void Draw_Prepare_Menu() {
inline void Draw_Control_Menu() { inline void Draw_Control_Menu() {
Clear_Main_Window(); Clear_Main_Window();
const int16_t scroll = TERN(HAS_LEVELING, MROWS - index_control, 0); // Scrolled-up lines const int16_t scroll = TERN(HAS_ONESTEP_LEVELING, MROWS - index_control, 0); // Scrolled-up lines
#define CSCROL(L) (scroll + (L)) #define CSCROL(L) (scroll + (L))
#define CLINE(L) MBASE(CSCROL(L)) #define CLINE(L) MBASE(CSCROL(L))
@ -976,7 +980,7 @@ void Goto_MainMenu(void) {
ICON_Print(); ICON_Print();
ICON_Prepare(); ICON_Prepare();
ICON_Control(); ICON_Control();
TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(select_page.now == 3); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(select_page.now == 3);
} }
inline ENCODER_DiffState get_encoder_state() { inline ENCODER_DiffState get_encoder_state() {
@ -1782,7 +1786,7 @@ void HMI_MainMenu(void) {
case 0: ICON_Print(); break; case 0: ICON_Print(); break;
case 1: ICON_Print(); ICON_Prepare(); break; case 1: ICON_Print(); ICON_Prepare(); break;
case 2: ICON_Prepare(); ICON_Control(); break; case 2: ICON_Prepare(); ICON_Control(); break;
case 3: ICON_Control(); TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(1); break; case 3: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(1); break;
} }
} }
} }
@ -1791,8 +1795,8 @@ void HMI_MainMenu(void) {
switch (select_page.now) { switch (select_page.now) {
case 0: ICON_Print(); ICON_Prepare(); break; case 0: ICON_Print(); ICON_Prepare(); break;
case 1: ICON_Prepare(); ICON_Control(); break; case 1: ICON_Prepare(); ICON_Control(); break;
case 2: ICON_Control(); TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(0); break; case 2: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(0); break;
case 3: TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(1); break; case 3: TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(1); break;
} }
} }
} }
@ -1822,7 +1826,7 @@ void HMI_MainMenu(void) {
/* Leveling */ /* Leveling */
case 3: case 3:
#if HAS_LEVELING #if HAS_ONESTEP_LEVELING
checkkey = Leveling; checkkey = Leveling;
HMI_Leveling(); HMI_Leveling();
#else #else
@ -2324,7 +2328,7 @@ void HMI_Control(void) {
// Avoid flicker by updating only the previous menu // Avoid flicker by updating only the previous menu
if (encoder_diffState == ENCODER_DIFF_CW) { if (encoder_diffState == ENCODER_DIFF_CW) {
#define CONTROL_ITEMS (5 + ENABLED(HAS_LEVELING)) #define CONTROL_ITEMS (5 + ENABLED(HAS_ONESTEP_LEVELING))
if (select_control.inc(CONTROL_ITEMS)) { if (select_control.inc(CONTROL_ITEMS)) {
if (select_control.now > MROWS && select_control.now > index_control) { if (select_control.now > MROWS && select_control.now > index_control) {
index_control = select_control.now; index_control = select_control.now;
@ -2402,12 +2406,17 @@ void HMI_Control(void) {
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
/* Leveling */
void HMI_Leveling(void) { #if HAS_ONESTEP_LEVELING
Popup_Window_Leveling();
DWIN_UpdateLCD(); /* Leveling */
queue.inject_P(PSTR("G28O\nG29")); void HMI_Leveling(void) {
} Popup_Window_Leveling();
DWIN_UpdateLCD();
queue.inject_P(PSTR("G28O\nG29"));
}
#endif
/* Axis Move */ /* Axis Move */
void HMI_AxisMove(void) { void HMI_AxisMove(void) {
@ -2896,7 +2905,7 @@ void HMI_Info(void) {
ENCODER_DiffState encoder_diffState = get_encoder_state(); ENCODER_DiffState encoder_diffState = get_encoder_state();
if (encoder_diffState == ENCODER_DIFF_NO) return; if (encoder_diffState == ENCODER_DIFF_NO) return;
if (encoder_diffState == ENCODER_DIFF_ENTER) { if (encoder_diffState == ENCODER_DIFF_ENTER) {
#if HAS_LEVELING #if HAS_ONESTEP_LEVELING
checkkey = Control; checkkey = Control;
select_control.set(CONTROL_ITEMS); select_control.set(CONTROL_ITEMS);
Draw_Control_Menu(); Draw_Control_Menu();