Encapsulate probe as singleton class (#16751)

This commit is contained in:
Scott Lahteine
2020-02-01 04:21:36 -06:00
committed by GitHub
parent 43d3463d5d
commit 90b6324563
33 changed files with 341 additions and 303 deletions

View File

@@ -113,8 +113,8 @@ void GcodeSuite::G76() {
}
// Ensure probe position is reachable
destination.set(
temp_comp.measure_point_x - probe_offset.x,
temp_comp.measure_point_y - probe_offset.y
temp_comp.measure_point_x - probe.offset_xy.x,
temp_comp.measure_point_y - probe.offset_xy.y
);
if (!position_is_reachable_by_probe(destination)) {
SERIAL_ECHOLNPGM("!Probe position unreachable - aborting.");
@@ -209,9 +209,9 @@ void GcodeSuite::G76() {
// Do a single probe
remember_feedrate_scaling_off();
const float measured_z = probe_at_point(
destination.x + probe_offset.x,
destination.y + probe_offset.y,
const float measured_z = probe.probe_at_point(
destination.x + probe.offset_xy.x,
destination.y + probe.offset_xy.y,
PROBE_PT_NONE
);
restore_feedrate_and_scaling();
@@ -318,9 +318,9 @@ void GcodeSuite::G76() {
// Do a single probe
remember_feedrate_scaling_off();
const float measured_z = probe_at_point(
destination.x + probe_offset.x,
destination.y + probe_offset.y,
const float measured_z = probe.probe_at_point(
destination.x + probe.offset_xy.x,
destination.y + probe.offset_xy.y,
PROBE_PT_NONE
);
restore_feedrate_and_scaling();