Move panel: Add Z-tilt/Quad-gantry-level/HomeXY button (#326)

This commit is contained in:
Alfredo Monclus 2021-11-16 23:05:02 -03:00 committed by GitHub
parent b52085746f
commit b959cf5b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

View File

@ -4,6 +4,9 @@ class KlippyGcodes:
HOME_X = "G28 X"
HOME_Y = "G28 Y"
HOME_Z = "G28 Z"
HOME_XY = "G28 X Y"
Z_TILT = "Z_TILT_ADJUST"
QUAD_GANTRY_LEVEL = "QUAD_GANTRY_LEVEL"
MOVE = "G1"
MOVE_ABSOLUTE = "G90"

View File

@ -59,6 +59,15 @@ class ScreenPanel:
def home(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
def homexy(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME_XY)
def z_tilt(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_TILT)
def quad_gantry_level(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.QUAD_GANTRY_LEVEL)
def menu_item_clicked(self, widget, panel, item):
print("### Creating panel " + item['panel'] + " : %s %s" % (panel, item))
if "items" in item:

View File

@ -39,6 +39,15 @@ class MovePanel(ScreenPanel):
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"), "color4")
self.labels['home'].connect("clicked", self.home)
self.labels['home-xy'] = self._gtk.ButtonImage("home", _("Home XY"), "color4")
self.labels['home-xy'].connect("clicked", self.homexy)
self.labels['z_tilt'] = self._gtk.ButtonImage("z-tilt", _("Z Tilt"), "color4")
self.labels['z_tilt'].connect("clicked", self.z_tilt)
self.labels['quad_gantry_level'] = self._gtk.ButtonImage("z-tilt", _("Quad Gantry Level"), "color4")
self.labels['quad_gantry_level'].connect("clicked", self.quad_gantry_level)
if self._screen.lang_ltr:
grid.attach(self.labels['x+'], 2, 1, 1, 1)
grid.attach(self.labels['x-'], 0, 1, 1, 1)
@ -52,6 +61,13 @@ class MovePanel(ScreenPanel):
grid.attach(self.labels['home'], 0, 0, 1, 1)
if self._printer.config_section_exists("z_tilt"):
grid.attach(self.labels['z_tilt'], 2, 0, 1, 1)
elif self._printer.config_section_exists("quad_gantry_level"):
grid.attach(self.labels['quad_gantry_level'], 2, 0, 1, 1)
else:
grid.attach(self.labels['home-xy'], 2, 0, 1, 1)
distgrid = Gtk.Grid()
j = 0
for i in self.distances: