diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index 1f6704acc..59558febb 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -445,6 +445,11 @@ The following information is available in the `quad_gantry_level` object (this object is available if quad_gantry_level is defined): - `applied`: True if the gantry leveling process has been run and completed successfully. +- `z_height`: A list of four numbers indicating the Z actuator positions. + Set to `[0,0,0,0]` if the gantry leveling process has not been run. +- `z_positions`: A list of four numbers indicating the positions at which + the Z probe triggered during a quad gantry level. Set to `[0,0,0,0]` if + the gantry leveling process has not been run. ## query_endstops diff --git a/klippy/extras/quad_gantry_level.py b/klippy/extras/quad_gantry_level.py index 5556d5e1d..9942c0d6a 100644 --- a/klippy/extras/quad_gantry_level.py +++ b/klippy/extras/quad_gantry_level.py @@ -34,6 +34,8 @@ class QuadGantryLevel: raise config.error( "Need exactly 4 probe points for quad_gantry_level") self.z_status = z_tilt.ZAdjustStatus(self.printer) + self.z_height = [0,0,0,0] + self.z_positions = [0,0,0,0] self.z_helper = z_tilt.ZAdjustHelper(config, 4) self.gantry_corners = config.getlists('gantry_corners', parser=float, seps=(',', '\n'), count=2) @@ -90,6 +92,9 @@ class QuadGantryLevel: z_height[2] = self.plot(slope_y_s23, self.gantry_corners[1][1]) z_height[3] = self.plot(slope_y_s23, self.gantry_corners[0][1]) + self.z_height = z_height + self.z_positions = z_positions + ainfo = zip(["z","z1","z2","z3"], z_height[0:4]) apos = " ".join(["%s: %06f" % (x) for x in ainfo]) self.gcode.respond_info("Actuator Positions:\n" + apos) @@ -122,7 +127,12 @@ class QuadGantryLevel: def plot(self,f,x): return f[0]*x + f[1] def get_status(self, eventtime): - return self.z_status.get_status(eventtime) + status = { + 'z_height': self.z_height, + 'z_positions': self.z_positions, + } + status.update(self.z_status.get_status(eventtime)) + return status def load_config(config): return QuadGantryLevel(config)