zcalibrate: clear the mesh and reset the offset before doing calibration

This commit is contained in:
alfrix committed 2024-01-02 07:07:51 -03:00
1 parent 906831a151
commit 469a13fd02
1 file changed
+13 -10
+13 -10
View File
@@ -128,17 +128,20 @@ class Panel(ScreenPanel):
self.buttons['start'].set_sensitive(False)
if self._printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script("G28")
if method == "probe":
self._move_to_position()
self._screen._ws.klippy.gcode_script("PROBE_CALIBRATE")
elif method == "mesh":
self._screen._ws.klippy.gcode_script("SET_GCODE_OFFSET Z=0")
if method == "mesh":
self._screen._ws.klippy.gcode_script("BED_MESH_CALIBRATE")
elif method == "delta":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE")
elif method == "delta_manual":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE METHOD=manual")
elif method == "endstop":
self._screen._ws.klippy.gcode_script("Z_ENDSTOP_CALIBRATE")
else:
self._screen._ws.klippy.gcode_script("BED_MESH_CLEAR")
if method == "probe":
self._move_to_position()
self._screen._ws.klippy.gcode_script("PROBE_CALIBRATE")
elif method == "delta":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE")
elif method == "delta_manual":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE METHOD=manual")
elif method == "endstop":
self._screen._ws.klippy.gcode_script("Z_ENDSTOP_CALIBRATE")
def _move_to_position(self):
x_position = y_position = None