From fedf90680e2fa83cad0ff350c28f2c3c71b45f1f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 8 Oct 2018 14:23:20 -0400 Subject: [PATCH] homing: Pass printer instead of toolhead object to Homing class Signed-off-by: Kevin O'Connor --- klippy/extras/probe.py | 2 +- klippy/gcode.py | 2 +- klippy/homing.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index 865b240b..5a5096cf 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -47,7 +47,7 @@ class PrinterProbe: cmd_PROBE_help = "Probe Z-height at current XY position" def cmd_PROBE(self, params): toolhead = self.printer.lookup_object('toolhead') - homing_state = homing.Homing(toolhead) + homing_state = homing.Homing(self.printer) pos = toolhead.get_position() pos[2] = self.z_position endstops = [(self.mcu_probe, "probe")] diff --git a/klippy/gcode.py b/klippy/gcode.py index bae0c528..f6f8796a 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -513,7 +513,7 @@ class GCodeParser: axes.append(self.axis2pos[axis]) if not axes: axes = [0, 1, 2] - homing_state = homing.Homing(self.toolhead) + homing_state = homing.Homing(self.printer) if self.is_fileinput: homing_state.set_no_verify_retract() try: diff --git a/klippy/homing.py b/klippy/homing.py index 901af03d..f40994a0 100644 --- a/klippy/homing.py +++ b/klippy/homing.py @@ -10,8 +10,9 @@ ENDSTOP_SAMPLE_TIME = .000015 ENDSTOP_SAMPLE_COUNT = 4 class Homing: - def __init__(self, toolhead): - self.toolhead = toolhead + def __init__(self, printer): + self.printer = printer + self.toolhead = printer.lookup_object('toolhead') self.changed_axes = [] self.verify_retract = True def set_no_verify_retract(self):