Allow no raise after run_z_probe in probe_pt

This commit is contained in:
Scott Lahteine
2018-03-21 01:01:43 -05:00
parent ae39fbd646
commit c352954882
7 changed files with 28 additions and 21 deletions

View File

@ -604,7 +604,7 @@ void GcodeSuite::G29() {
#else // !PROBE_MANUALLY
{
const bool stow_probe_after_each = parser.boolval('E');
const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE;
measured_z = 0;
@ -650,7 +650,7 @@ void GcodeSuite::G29() {
if (!position_is_reachable_by_probe(xProbe, yProbe)) continue;
#endif
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
if (isnan(measured_z)) {
set_bed_leveling_enabled(abl_should_enable);
@ -687,7 +687,7 @@ void GcodeSuite::G29() {
// Retain the last probe position
xProbe = points[i].x;
yProbe = points[i].y;
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
if (isnan(measured_z)) {
set_bed_leveling_enabled(abl_should_enable);
break;

View File

@ -137,7 +137,7 @@ static void G33_cleanup(
inline float calibration_probe(const float nx, const float ny, const bool stow) {
#if HAS_BED_PROBE
return probe_pt(nx, ny, stow, 0, false);
return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false);
#else
UNUSED(stow);
return lcd_probe_pt(nx, ny);

View File

@ -70,7 +70,7 @@ void GcodeSuite::M48() {
return;
}
const bool stow_probe_after_each = parser.boolval('E');
const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE;
float X_current = current_position[X_AXIS],
Y_current = current_position[Y_AXIS];
@ -114,7 +114,7 @@ void GcodeSuite::M48() {
double mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples];
// Move to the first point, deploy, and probe
const float t = probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, verbose_level);
const float t = probe_pt(X_probe_location, Y_probe_location, raise_after, verbose_level);
bool probing_good = !isnan(t);
if (probing_good) {
@ -190,7 +190,7 @@ void GcodeSuite::M48() {
} // n_legs
// Probe a single point
sample_set[n] = probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, 0);
sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after, 0);
// Break the loop if the probe fails
probing_good = !isnan(sample_set[n]);

View File

@ -51,8 +51,8 @@ void GcodeSuite::G30() {
setup_for_endstop_or_probe_move();
const bool do_stow = parser.boolval('E');
const float measured_z = probe_pt(xpos, ypos, do_stow, 1);
const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_NONE;
const float measured_z = probe_pt(xpos, ypos, raise_after, 1);
if (!isnan(measured_z)) {
SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));
@ -62,7 +62,7 @@ void GcodeSuite::G30() {
clean_up_after_endstop_or_probe_move();
if (do_stow) move_z_after_probing();
if (raise_after == PROBE_PT_STOW) move_z_after_probing();
report_current_position();
}