zcalibrate: add manual delta_calibrate fix #575

This commit is contained in:
alfrix 2022-04-05 20:02:28 -03:00
parent dd72e7d46a
commit 4bace34847

View File

@ -42,7 +42,7 @@ class ZCalibratePanel(ScreenPanel):
self.widgets['cancel'] = self._gtk.ButtonImage('cancel', _('Abort'), 'color2') self.widgets['cancel'] = self._gtk.ButtonImage('cancel', _('Abort'), 'color2')
self.widgets['cancel'].connect("clicked", self.abort) self.widgets['cancel'].connect("clicked", self.abort)
functions = ["endstop", "probe", "mesh", "delta"] functions = ["endstop", "probe", "mesh", "delta", "delta_manual"]
pobox = Gtk.VBox() pobox = Gtk.VBox()
if not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"): if not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"):
endstop = self._gtk.Button(label="Endstop") endstop = self._gtk.Button(label="Endstop")
@ -67,11 +67,19 @@ class ZCalibratePanel(ScreenPanel):
functions.remove("mesh") functions.remove("mesh")
if "delta" in self._screen.printer.get_config_section("printer")['kinematics']: if "delta" in self._screen.printer.get_config_section("printer")['kinematics']:
delta = self._gtk.Button(label="Delta") if (self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch")):
delta.connect("clicked", self.start_calibration, "delta") delta = self._gtk.Button(label="Delta Automatic")
pobox.pack_start(delta, True, True, 5) delta.connect("clicked", self.start_calibration, "delta")
pobox.pack_start(delta, True, True, 5)
else:
functions.remove("delta")
delta_manual = self._gtk.Button(label="Delta Manual")
delta_manual.connect("clicked", self.start_calibration, "delta_manual")
pobox.pack_start(delta_manual, True, True, 5)
else: else:
functions.remove("delta") functions.remove("delta")
functions.remove("delta_manual")
logging.info("Available functions: %s" % functions) logging.info("Available functions: %s" % functions)
self.labels['popover'] = Gtk.Popover() self.labels['popover'] = Gtk.Popover()
@ -191,6 +199,8 @@ class ZCalibratePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script("BED_MESH_CALIBRATE") self._screen._ws.klippy.gcode_script("BED_MESH_CALIBRATE")
elif method == "delta": elif method == "delta":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE") 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": elif method == "endstop":
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_ENDSTOP_CALIBRATE) self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_ENDSTOP_CALIBRATE)