From c8434ec54b0517503af4aeee9016783d508118b0 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 8 Jan 2021 11:52:28 -0500 Subject: kinematics: Calculate axis_minimum/axis_maximum in advance Calculate the get_status() axis_minimum and axis_maximum fields in advance so that they don't need to be calculated on each get_status() call. Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'klippy/toolhead.py') diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 43931e4d..82cc1556 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -196,6 +196,7 @@ class DripModeEndSignal(Exception): # Main code to track events (and their timing) on the printer toolhead class ToolHead: + Coord = homing.Coord def __init__(self, config): self.printer = config.get_printer() self.reactor = self.printer.get_reactor() @@ -502,7 +503,7 @@ class ToolHead: res.update({ 'print_time': print_time, 'estimated_print_time': estimated_print_time, 'extruder': self.extruder.get_name(), - 'position': homing.Coord(*self.commanded_pos), + 'position': self.Coord(*self.commanded_pos), 'max_velocity': self.max_velocity, 'max_accel': self.max_accel, 'max_accel_to_decel': self.requested_accel_to_decel, -- cgit v1.2.3-70-g09d2