Allow faux leveling

master
Scott Lahteine 8 years ago
parent 2355d87e11
commit 81ffd98dd9

@ -4035,6 +4035,11 @@ inline void gcode_G28() {
* L Set the Left limit of the probing grid * L Set the Left limit of the probing grid
* R Set the Right limit of the probing grid * R Set the Right limit of the probing grid
* *
* Parameters with DEBUG_LEVELING_FEATURE only:
*
* C Make a totally fake grid with no actual probing.
* For use in testing when no probing is possible.
*
* Parameters with BILINEAR leveling only: * Parameters with BILINEAR leveling only:
* *
* Z Supply an additional Z probe offset * Z Supply an additional Z probe offset
@ -4077,6 +4082,12 @@ inline void gcode_G28() {
#endif #endif
#endif #endif
#if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
const bool faux = code_seen('C') && code_value_bool();
#else
bool constexpr faux = false;
#endif
// Don't allow auto-leveling without homing first // Don't allow auto-leveling without homing first
if (axis_unhomed_error(true, true, true)) return; if (axis_unhomed_error(true, true, true)) return;
@ -4292,7 +4303,7 @@ inline void gcode_G28() {
SYNC_PLAN_POSITION_KINEMATIC(); SYNC_PLAN_POSITION_KINEMATIC();
} }
setup_for_endstop_or_probe_move(); if (!faux) setup_for_endstop_or_probe_move();
//xProbe = yProbe = measured_z = 0; //xProbe = yProbe = measured_z = 0;
@ -4550,7 +4561,7 @@ inline void gcode_G28() {
if (!position_is_reachable(pos, true)) continue; if (!position_is_reachable(pos, true)) continue;
#endif #endif
measured_z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level); measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
if (isnan(measured_z)) { if (isnan(measured_z)) {
planner.abl_enabled = abl_should_enable; planner.abl_enabled = abl_should_enable;
@ -4585,7 +4596,7 @@ inline void gcode_G28() {
// Retain the last probe position // Retain the last probe position
xProbe = LOGICAL_X_POSITION(points[i].x); xProbe = LOGICAL_X_POSITION(points[i].x);
yProbe = LOGICAL_Y_POSITION(points[i].y); yProbe = LOGICAL_Y_POSITION(points[i].y);
measured_z = points[i].z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level); measured_z = points[i].z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
} }
if (isnan(measured_z)) { if (isnan(measured_z)) {
@ -4624,7 +4635,7 @@ inline void gcode_G28() {
// //
// Restore state after probing // Restore state after probing
clean_up_after_endstop_or_probe_move(); if (!faux) clean_up_after_endstop_or_probe_move();
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);

Loading…
Cancel
Save