probe: Check for toolhead movement during activate/deactivate_gcode scripts
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
df80d96ae6
commit
40f73dd7f4
|
@ -221,10 +221,20 @@ class ProbeEndstopWrapper:
|
|||
for stepper in kin.get_steppers('Z'):
|
||||
stepper.add_to_endstop(self)
|
||||
def home_prepare(self):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
start_pos = toolhead.get_position()
|
||||
self.activate_gcode.run_gcode_from_command()
|
||||
if toolhead.get_position()[:3] != start_pos[:3]:
|
||||
raise homing.CommandError(
|
||||
"Toolhead moved during probe activate_gcode script")
|
||||
self.mcu_endstop.home_prepare()
|
||||
def home_finalize(self):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
start_pos = toolhead.get_position()
|
||||
self.deactivate_gcode.run_gcode_from_command()
|
||||
if toolhead.get_position()[:3] != start_pos[:3]:
|
||||
raise homing.CommandError(
|
||||
"Toolhead moved during probe deactivate_gcode script")
|
||||
self.mcu_endstop.home_finalize()
|
||||
def get_position_endstop(self):
|
||||
return self.position_endstop
|
||||
|
|
Loading…
Reference in New Issue