From f6d4284d5ccc7e3041ab3d89a0a9244edcd157b9 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 6 Dec 2017 10:13:58 -0500 Subject: homing: Directly interact with the kinematic class on query_endstops() Move the query_endstop logic out of toolhead.py and into homing.py. Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'klippy/gcode.py') diff --git a/klippy/gcode.py b/klippy/gcode.py index c25608fb..ce6a59f5 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -409,7 +409,7 @@ class GCodeParser: if self.toolhead is None: self.cmd_default(params) return - raw_pos = self.toolhead.query_endstops("get_mcu_position") + raw_pos = homing.query_position(self.toolhead) self.respond("X:%.3f Y:%.3f Z:%.3f E:%.3f Count %s" % ( self.last_position[0], self.last_position[1], self.last_position[2], self.last_position[3], @@ -451,12 +451,7 @@ class GCodeParser: cmd_QUERY_ENDSTOPS_aliases = ["M119"] def cmd_QUERY_ENDSTOPS(self, params): # Get Endstop Status - if self.is_fileinput: - return - try: - res = self.toolhead.query_endstops() - except homing.EndstopError as e: - raise error(str(e)) + res = homing.query_endstops(self.toolhead) self.respond(" ".join(["%s:%s" % (name, ["open", "TRIGGERED"][not not t]) for name, t in res])) cmd_PID_TUNE_help = "Run PID Tuning" -- cgit v1.2.3-70-g09d2