From 1be64c19d462a33f6f2d557d87294c4b4c83d605 Mon Sep 17 00:00:00 2001 From: Brad Hochgesang Date: Tue, 17 Jul 2018 15:11:34 -0500 Subject: [PATCH] Fix zhop detection issue related to issue #195. --- octoprint_octolapse/position.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/octoprint_octolapse/position.py b/octoprint_octolapse/position.py index e7fa6761..a38cee5a 100644 --- a/octoprint_octolapse/position.py +++ b/octoprint_octolapse/position.py @@ -1210,11 +1210,11 @@ def update(self, gcode, cmd, parameters): if pos.LastExtrusionHeight is not None: # calculate lift, taking into account floating point # rounding - lift = pos.distance_to_zlift(self.Printer.z_hop) + distance_to_lift = pos.distance_to_zlift(self.Printer.z_hop) # todo: replace rounding with a call to is close or greater than utility function - lift = utility.round_to(lift, self.PrinterTolerance) - is_lifted = lift >= self.Printer.z_hop and not ( + distance_to_lift = utility.round_to(distance_to_lift, self.PrinterTolerance) + is_lifted = distance_to_lift <= 0.0 and not ( self.Extruder.is_extruding() or self.Extruder.is_extruding_start() )