Skip to content

Commit

Permalink
🩹 ProUI - Remove ManualZOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 11, 2023
1 parent 7717beb commit 01e58de
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 37 deletions.
1 change: 1 addition & 0 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@
// Clear probe pin settings when no probe is selected
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
#undef USE_PROBE_FOR_Z_HOMING
#undef Z_MIN_PROBE_REPEATABILITY_TEST
#endif

#if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X)
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
#define SERVO_DELAY { 50 }
#endif

#if !HAS_BED_PROBE
#undef BABYSTEP_ZPROBE_OFFSET
#endif
#if !HAS_STOWABLE_PROBE
#undef PROBE_DEPLOY_STOW_MENU
#endif
Expand Down
20 changes: 11 additions & 9 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1938,15 +1938,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Make sure Z raise values are set
*/
#ifndef Z_CLEARANCE_DEPLOY_PROBE
#error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
#elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
#error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
#elif Z_CLEARANCE_DEPLOY_PROBE < 0
#error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
#elif Z_CLEARANCE_BETWEEN_PROBES < 0
#error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
#elif Z_AFTER_PROBING < 0
#error "Probes need Z_AFTER_PROBING >= 0."
#error "Z_CLEARANCE_DEPLOY_PROBE is required for bed probes."
#else
static_assert(Z_CLEARANCE_DEPLOY_PROBE >= 0, "Probes require Z_CLEARANCE_DEPLOY_PROBE >= 0.");
#endif
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#error "Z_CLEARANCE_BETWEEN_PROBES is required for bed probes."
#else
static_assert(Z_CLEARANCE_BETWEEN_PROBES >= 0, "Probes require Z_CLEARANCE_BETWEEN_PROBES >= 0.");
#endif
#ifdef Z_AFTER_PROBING
static_assert(Z_AFTER_PROBING >= 0, "Probes require Z_AFTER_PROBING >= 0.");
#endif

#if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
Expand Down
19 changes: 4 additions & 15 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,8 @@
#include "../../../feature/bltouch.h"
#endif

#if EITHER(BABYSTEPPING, HAS_BED_PROBE)
#define HAS_ZOFFSET_ITEM 1
#if ENABLED(BABYSTEPPING)
#include "../../../feature/babystep.h"
#if !HAS_BED_PROBE
#define JUST_BABYSTEP 1
#endif
#endif
#if ENABLED(BABYSTEPPING)
#include "../../../feature/babystep.h"
#endif

#if ENABLED(POWER_LOSS_RECOVERY)
Expand Down Expand Up @@ -197,8 +191,8 @@
#define DWIN_UPDATE_INTERVAL 1024
#define DWIN_REMAIN_TIME_UPDATE_INTERVAL SEC_TO_MS(20)

#if HAS_MESH
#define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, HMI_data.ManualZOffset)
#if HAS_MESH && HAS_BED_PROBE
#define BABY_Z_VAR probe.offset.z
#else
float z_offset = 0;
#define BABY_Z_VAR z_offset
Expand Down Expand Up @@ -1473,10 +1467,6 @@ void DWIN_HomingStart() {

void DWIN_HomingDone() {
HMI_flag.home_flag = false;
#if DISABLED(HAS_BED_PROBE) && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
planner.synchronize();
babystep.add_mm(Z_AXIS, HMI_data.ManualZOffset);
#endif
HMI_ReturnScreen();
}

Expand Down Expand Up @@ -1696,7 +1686,6 @@ void DWIN_SetDataDefaults() {
#if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING)
HMI_data.z_after_homing = DEF_Z_AFTER_HOMING;
#endif
IF_DISABLED(HAS_BED_PROBE, HMI_data.ManualZOffset = 0);
#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
TERN_(LED_COLOR_PRESETS, leds.set_default());
ApplyLEDColor();
Expand Down
12 changes: 8 additions & 4 deletions Marlin/src/lcd/e3v2/proui/dwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
#include "../common/encoder.h"
#include "../../../libs/BL24CXX.h"

#if EITHER(BABYSTEPPING, HAS_BED_PROBE)
#define HAS_ZOFFSET_ITEM 1
#if !HAS_BED_PROBE
#define JUST_BABYSTEP 1
#endif
#endif

namespace GET_LANG(LCD_LANGUAGE) {
#define _MSG_PREHEAT(N) \
LSTR MSG_PREHEAT_##N = _UxGT("Preheat ") PREHEAT_## N ##_LABEL; \
Expand Down Expand Up @@ -118,15 +125,12 @@ typedef struct {
#if ENABLED(BAUD_RATE_GCODE)
bool Baud115K = false;
#endif

bool FullManualTramming = false;
bool MediaAutoMount = ENABLED(HAS_SD_EXTENDER);
#if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING)
uint8_t z_after_homing = DEF_Z_AFTER_HOMING;
#endif
#if ENABLED(MESH_BED_LEVELING)
float ManualZOffset = 0;
#endif
// Led
#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
LEDColor Led_Color = Def_Leds_Color;
#endif
Expand Down
10 changes: 6 additions & 4 deletions Marlin/src/lcd/menu/menu_bed_leveling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@
//
void _lcd_level_bed_done() {
if (!ui.wait_for_move) {
#if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING)
// Display "Done" screen and wait for moves to complete
line_to_z(Z_AFTER_PROBING);
ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE));
#if DISABLED(MESH_BED_LEVELING) && defined(Z_AFTER_PROBING)
if (Z_AFTER_PROBING) {
// Display "Done" screen and wait for moves to complete
line_to_z(Z_AFTER_PROBING);
ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE));
}
#endif
ui.goto_previous_screen_no_defer();
ui.completion_feedback();
Expand Down
8 changes: 3 additions & 5 deletions Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,9 @@ class Probe {
#endif

static void move_z_after_homing() {
#if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING)
do_z_clearance(HMI_data.z_after_homing, true);
#elif defined(Z_AFTER_HOMING)
do_z_clearance(Z_AFTER_HOMING, true);
#elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE)
#if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) || defined(Z_AFTER_HOMING)
do_z_clearance(Z_POST_CLEARANCE, true);
#elif HAS_BED_PROBE
move_z_after_probing();
#endif
}
Expand Down

0 comments on commit 01e58de

Please sign in to comment.