From ec58b23f3b3685b9b7dde2ac7ecfec3991eb3a8a Mon Sep 17 00:00:00 2001 From: Arksine Date: Thu, 14 Nov 2019 16:37:31 -0500 Subject: [PATCH] ProbePointsHelper: Optionally add xy offsets to probe points Signed-off-by: Eric Callahan --- klippy/extras/probe.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index 2de2c3d8..b87aff62 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -283,6 +283,7 @@ class ProbePointsHelper: self.name)) self.horizontal_move_z = config.getfloat('horizontal_move_z', 5.) self.speed = config.getfloat('speed', 50., above=0.) + self.use_offsets = False # Internal probing state self.lift_speed = self.speed self.probe_offsets = (0., 0., 0.) @@ -291,6 +292,8 @@ class ProbePointsHelper: if len(self.probe_points) < n: raise self.printer.config_error( "Need at least %d probe points for %s" % (n, self.name)) + def use_xy_offsets(self, use_offsets): + self.use_offsets = use_offsets def get_lift_speed(self): return self.lift_speed def _move_next(self): @@ -313,6 +316,9 @@ class ProbePointsHelper: self.results = [] # Move to next XY probe point curpos[:2] = self.probe_points[len(self.results)] + if self.use_offsets: + curpos[0] -= self.probe_offsets[0] + curpos[1] -= self.probe_offsets[1] toolhead.move(curpos, self.speed) self.gcode.reset_last_position() return False