mirror of https://github.com/Desuuuu/klipper.git
probe: Catch and propagate errors raised during ProbePointsHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
e110e1fecc
commit
3819ad2986
|
@ -181,16 +181,24 @@ class ProbePointsHelper:
|
||||||
self.busy = True
|
self.busy = True
|
||||||
self.move_next()
|
self.move_next()
|
||||||
if self.probe is not None:
|
if self.probe is not None:
|
||||||
while self.busy:
|
try:
|
||||||
self.gcode.run_script("PROBE")
|
while self.busy:
|
||||||
self.cmd_NEXT({})
|
self.gcode.run_script("PROBE")
|
||||||
|
self.cmd_NEXT({})
|
||||||
|
except:
|
||||||
|
self.finalize(False)
|
||||||
|
raise
|
||||||
def move_next(self):
|
def move_next(self):
|
||||||
x, y = self.probe_points[len(self.results)]
|
x, y = self.probe_points[len(self.results)]
|
||||||
curpos = self.toolhead.get_position()
|
curpos = self.toolhead.get_position()
|
||||||
curpos[0] = x
|
curpos[0] = x
|
||||||
curpos[1] = y
|
curpos[1] = y
|
||||||
curpos[2] = self.horizontal_move_z
|
curpos[2] = self.horizontal_move_z
|
||||||
self.toolhead.move(curpos, self.speed)
|
try:
|
||||||
|
self.toolhead.move(curpos, self.speed)
|
||||||
|
except homing.EndstopError as e:
|
||||||
|
self.finalize(False)
|
||||||
|
raise self.gcode.error(str(e))
|
||||||
self.gcode.reset_last_position()
|
self.gcode.reset_last_position()
|
||||||
cmd_NEXT_help = "Move to the next XY position to probe"
|
cmd_NEXT_help = "Move to the next XY position to probe"
|
||||||
def cmd_NEXT(self, params):
|
def cmd_NEXT(self, params):
|
||||||
|
@ -200,7 +208,11 @@ class ProbePointsHelper:
|
||||||
# Lift toolhead
|
# Lift toolhead
|
||||||
curpos = self.toolhead.get_position()
|
curpos = self.toolhead.get_position()
|
||||||
curpos[2] = self.horizontal_move_z
|
curpos[2] = self.horizontal_move_z
|
||||||
self.toolhead.move(curpos, self.lift_speed)
|
try:
|
||||||
|
self.toolhead.move(curpos, self.lift_speed)
|
||||||
|
except homing.EndstopError as e:
|
||||||
|
self.finalize(False)
|
||||||
|
raise self.gcode.error(str(e))
|
||||||
# Move to next position
|
# Move to next position
|
||||||
if len(self.results) == len(self.probe_points):
|
if len(self.results) == len(self.probe_points):
|
||||||
self.toolhead.get_last_move_time()
|
self.toolhead.get_last_move_time()
|
||||||
|
|
Loading…
Reference in New Issue