aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-16 22:02:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-20 21:03:22 -0400
commit4115a77342239bfbef3be2463e3ba6b5c3616167 (patch)
treebfe930fb3fca2db45b3a78e5ed4943dde29fe2ab /klippy/extras
parent560d48dbc9bbea51c317ebeef92f9262d31923f1 (diff)
downloadkutter-4115a77342239bfbef3be2463e3ba6b5c3616167.tar.gz
kutter-4115a77342239bfbef3be2463e3ba6b5c3616167.tar.xz
kutter-4115a77342239bfbef3be2463e3ba6b5c3616167.zip
gcode: Automatically call reset_last_position() on a toolhead set_position()
Generate a "toolhead:set_position" event on a call to toolhead.set_position() and use that event to automatically call gcode.reset_last_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/force_move.py2
-rw-r--r--klippy/extras/homing_override.py1
-rw-r--r--klippy/extras/probe.py1
-rw-r--r--klippy/extras/tuning_tower.py1
-rw-r--r--klippy/extras/z_tilt.py1
5 files changed, 0 insertions, 6 deletions
diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py
index 394da525..eb2577df 100644
--- a/klippy/extras/force_move.py
+++ b/klippy/extras/force_move.py
@@ -132,8 +132,6 @@ class ForceMove:
z = gcmd.get_float('Z', curpos[2])
logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f", x, y, z)
toolhead.set_position([x, y, z, curpos[3]], homing_axes=(0, 1, 2))
- gcode = self.printer.lookup_object('gcode')
- gcode.reset_last_position()
def load_config(config):
return ForceMove(config)
diff --git a/klippy/extras/homing_override.py b/klippy/extras/homing_override.py
index 1561aabc..c5503b13 100644
--- a/klippy/extras/homing_override.py
+++ b/klippy/extras/homing_override.py
@@ -51,7 +51,6 @@ class HomingOverride:
pos[axis] = loc
homing_axes.append(axis)
toolhead.set_position(pos, homing_axes=homing_axes)
- self.gcode.reset_last_position()
# Perform homing
kwparams = { 'printer': self.template.create_status_wrapper() }
kwparams['params'] = gcmd.get_command_parameters()
diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py
index 02d1b5b9..539a6572 100644
--- a/klippy/extras/probe.py
+++ b/klippy/extras/probe.py
@@ -123,7 +123,6 @@ class PrinterProbe:
pos = toolhead.get_position()
self.gcode.respond_info("probe at %.3f,%.3f is z=%.6f"
% (pos[0], pos[1], pos[2]))
- self.gcode.reset_last_position()
return pos[:3]
def _move(self, coord, speed):
toolhead = self.printer.lookup_object('toolhead')
diff --git a/klippy/extras/tuning_tower.py b/klippy/extras/tuning_tower.py
index dcdc67fe..753e5433 100644
--- a/klippy/extras/tuning_tower.py
+++ b/klippy/extras/tuning_tower.py
@@ -35,7 +35,6 @@ class TuningTower:
self.command_fmt = "%s %s=%%.9f" % (command, parameter)
self.normal_transform = self.gcode.set_move_transform(self, force=True)
self.last_z = -99999999.9
- self.gcode.reset_last_position()
self.get_position()
gcmd.respond_info("Starting tuning test (start=%.6f factor=%.6f)"
% (self.start, self.factor))
diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py
index 577b7e70..c4c58c9e 100644
--- a/klippy/extras/z_tilt.py
+++ b/klippy/extras/z_tilt.py
@@ -65,7 +65,6 @@ class ZAdjustHelper:
last_stepper.set_trapq(toolhead.get_trapq())
curpos[2] += first_stepper_offset
toolhead.set_position(curpos)
- gcode.reset_last_position()
class RetryHelper:
def __init__(self, config, error_msg_extra = ""):