aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/z_tilt.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-09-26 10:32:57 -0400
committerKevinOConnor <kevin@koconnor.net>2018-10-01 11:12:30 -0400
commit8e7eac9b08a6ae3ecf94919faca02a9df5e10551 (patch)
tree412702a216b7ffc74642e7c52deb967b28864905 /klippy/extras/z_tilt.py
parentae4eb35a707fe588b77806bc77a2515b1d1a2d01 (diff)
downloadkutter-8e7eac9b08a6ae3ecf94919faca02a9df5e10551.tar.gz
kutter-8e7eac9b08a6ae3ecf94919faca02a9df5e10551.tar.xz
kutter-8e7eac9b08a6ae3ecf94919faca02a9df5e10551.zip
probe: Implement ProbePointsHelper get_probed_position() locally
Now that all users of ProbePointsHelper use the same get_probed_position() code, it is possible to implement that locally within the ProbePointsHelper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/z_tilt.py')
-rw-r--r--klippy/extras/z_tilt.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py
index 684bf01f..f5c4614d 100644
--- a/klippy/extras/z_tilt.py
+++ b/klippy/extras/z_tilt.py
@@ -20,7 +20,7 @@ class ZTilt:
config.get_name()))
if len(z_positions) < 2:
raise config.error("z_tilt requires at least two z_positions")
- self.probe_helper = probe.ProbePointsHelper(config, self)
+ self.probe_helper = probe.ProbePointsHelper(config, self.probe_finalize)
self.z_steppers = []
# Register Z_TILT_ADJUST command
self.gcode = self.printer.lookup_object('gcode')
@@ -40,10 +40,7 @@ class ZTilt:
cmd_Z_TILT_ADJUST_help = "Adjust the Z tilt"
def cmd_Z_TILT_ADJUST(self, params):
self.probe_helper.start_probe()
- def get_probed_position(self):
- kin = self.printer.lookup_object('toolhead').get_kinematics()
- return kin.calc_position()
- def finalize(self, offsets, positions):
+ def probe_finalize(self, offsets, positions):
z_offset = offsets[2]
logging.info("Calculating bed tilt with: %s", positions)
params = { 'x_adjust': 0., 'y_adjust': 0., 'z_adjust': z_offset }