Reorganization (#1029)
This commit is contained in:
parent
0f47d45294
commit
6190581101
@ -19,9 +19,56 @@ extruder = 210
|
||||
[menu __main]
|
||||
name: {{ gettext('Main Menu') }}
|
||||
|
||||
[menu __main homing]
|
||||
name: {{ gettext('Homing') }}
|
||||
|
||||
|
||||
[menu __main move]
|
||||
name: {{ gettext('Move') }}
|
||||
icon: move
|
||||
panel: move
|
||||
|
||||
[menu move homing homeall]
|
||||
name: {{ gettext('Home All') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28"}
|
||||
|
||||
[menu move homing homex]
|
||||
name: {{ gettext('Home X') }}
|
||||
icon: home-x
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X"}
|
||||
|
||||
[menu move homing homey]
|
||||
name: {{ gettext('Home Y') }}
|
||||
icon: home-y
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Y"}
|
||||
|
||||
[menu move homing homez]
|
||||
name: {{ gettext('Home Z') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Z"}
|
||||
|
||||
[menu move homing homexy]
|
||||
name: {{ gettext('Home XY') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X Y"}
|
||||
|
||||
[menu move homing quad_gantry_level]
|
||||
name: {{ gettext('Quad Gantry Level') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"QUAD_GANTRY_LEVEL"}
|
||||
enable: {{ printer.quad_gantry_level is defined }}
|
||||
|
||||
[menu move homing Z-Tilt]
|
||||
name: {{ gettext('Z Tilt') }}
|
||||
icon: z-tilt
|
||||
method: printer.gcode.script
|
||||
params: {"script":"Z_TILT_ADJUST"}
|
||||
enable: {{ printer.z_tilt is defined }}
|
||||
|
||||
[menu __main temperature]
|
||||
name: {{ gettext('Temperature') }}
|
||||
@ -29,12 +76,14 @@ icon: heat-up
|
||||
panel: temperature
|
||||
enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
|
||||
|
||||
[menu __main actions]
|
||||
name: {{ gettext('Actions') }}
|
||||
icon: move
|
||||
[menu __main extrude]
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: extrude
|
||||
panel: extrude
|
||||
enable: {{ printer.extruders.count > 0 }}
|
||||
|
||||
[menu __main config]
|
||||
name: {{ gettext('Configuration') }}
|
||||
[menu __main more]
|
||||
name: {{ gettext('More') }}
|
||||
icon: settings
|
||||
|
||||
[menu __main print]
|
||||
@ -42,142 +91,81 @@ name: {{ gettext('Print') }}
|
||||
icon: print
|
||||
panel: print
|
||||
|
||||
[menu __main homing homeall]
|
||||
name: {{ gettext('Home All') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28"}
|
||||
|
||||
[menu __main homing homex]
|
||||
name: {{ gettext('Home X') }}
|
||||
icon: home-x
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X"}
|
||||
|
||||
[menu __main homing homey]
|
||||
name: {{ gettext('Home Y') }}
|
||||
icon: home-y
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Y"}
|
||||
|
||||
[menu __main homing homez]
|
||||
name: {{ gettext('Home Z') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Z"}
|
||||
|
||||
[menu __main homing homexy]
|
||||
name: {{ gettext('Home XY') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X Y"}
|
||||
|
||||
[menu __main homing quad_gantry_level]
|
||||
name: {{ gettext('Quad Gantry Level') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"QUAD_GANTRY_LEVEL"}
|
||||
enable: {{ printer.quad_gantry_level is defined }}
|
||||
|
||||
[menu __main homing Z-Tilt]
|
||||
name: {{ gettext('Z Tilt') }}
|
||||
icon: z-tilt
|
||||
method: printer.gcode.script
|
||||
params: {"script":"Z_TILT_ADJUST"}
|
||||
enable: {{ printer.z_tilt is defined }}
|
||||
|
||||
|
||||
[menu __main actions move]
|
||||
name: {{ gettext('Move') }}
|
||||
icon: move
|
||||
panel: move
|
||||
|
||||
[menu __main actions extrude]
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: filament
|
||||
panel: extrude
|
||||
enable: {{ printer.extruders.count > 0 }}
|
||||
|
||||
[menu __main actions fan]
|
||||
name: {{ gettext('Fan') }}
|
||||
icon: fan
|
||||
panel: fan
|
||||
enable: {{ printer.fans.count > 0 }}
|
||||
|
||||
[menu __main actions macros]
|
||||
name: {{ gettext('Macros') }}
|
||||
icon: custom-script
|
||||
panel: gcode_macros
|
||||
enable: {{ printer.gcode_macros.count > 0 }}
|
||||
|
||||
[menu __main actions pins]
|
||||
name: {{ gettext('Pins') }}
|
||||
icon: fine-tune
|
||||
panel: pins
|
||||
enable: {{ printer.output_pins.count > 0 }}
|
||||
|
||||
[menu __main actions power]
|
||||
name: {{ gettext('Power') }}
|
||||
icon: shutdown
|
||||
panel: power
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
|
||||
[menu __main actions disablemotors]
|
||||
name: {{ gettext('Disable Motors') }}
|
||||
icon: motor-off
|
||||
method: printer.gcode.script
|
||||
params: {"script":"M18"}
|
||||
|
||||
[menu __main actions camera]
|
||||
name: {{ gettext('Camera') }}
|
||||
icon: camera
|
||||
panel: camera
|
||||
enable: {{ camera_configured }}
|
||||
|
||||
[menu __main actions console]
|
||||
name: {{ gettext('Console') }}
|
||||
icon: console
|
||||
panel: console
|
||||
|
||||
[menu __main config bedlevel]
|
||||
[menu __main more bedlevel]
|
||||
name: {{ gettext('Bed Level') }}
|
||||
icon: bed-level
|
||||
panel: bed_level
|
||||
enable: {{ printer.bed_screws or printer.screws_tilt_adjust}}
|
||||
|
||||
[menu __main config bedmesh]
|
||||
[menu __main more bedmesh]
|
||||
name: {{ gettext('Bed Mesh') }}
|
||||
icon: bed-mesh
|
||||
panel: bed_mesh
|
||||
enable: {{ printer.bed_mesh is defined }}
|
||||
|
||||
[menu __main config zoffset]
|
||||
[menu __main more zoffset]
|
||||
name: {{ gettext('Z Calibrate') }}
|
||||
icon: z-farther
|
||||
panel: zcalibrate
|
||||
|
||||
[menu __main config limits]
|
||||
[menu __main more limits]
|
||||
name: {{ gettext('Limits') }}
|
||||
icon: fine-tune
|
||||
panel: limits
|
||||
|
||||
[menu __main config network]
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __main config retraction]
|
||||
[menu __main more retraction]
|
||||
name: {{ gettext('Retraction') }}
|
||||
icon: retract
|
||||
panel: retraction
|
||||
enable: {{ printer.firmware_retraction }}
|
||||
|
||||
[menu __main config system]
|
||||
[menu __main more fan]
|
||||
name: {{ gettext('Fan') }}
|
||||
icon: fan
|
||||
panel: fan
|
||||
enable: {{ printer.fans.count > 0 }}
|
||||
|
||||
[menu __main more macros]
|
||||
name: {{ gettext('Macros') }}
|
||||
icon: custom-script
|
||||
panel: gcode_macros
|
||||
enable: {{ printer.gcode_macros.count > 0 }}
|
||||
|
||||
[menu __main more pins]
|
||||
name: {{ gettext('Pins') }}
|
||||
icon: hashtag
|
||||
panel: pins
|
||||
enable: {{ printer.output_pins.count > 0 }}
|
||||
|
||||
[menu __main more power]
|
||||
name: {{ gettext('Power') }}
|
||||
icon: shutdown
|
||||
panel: power
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
|
||||
[menu __main more camera]
|
||||
name: {{ gettext('Camera') }}
|
||||
icon: camera
|
||||
panel: camera
|
||||
enable: {{ camera_configured }}
|
||||
|
||||
[menu __main more console]
|
||||
name: {{ gettext('Console') }}
|
||||
icon: console
|
||||
panel: console
|
||||
|
||||
[menu __main more system]
|
||||
name: {{ gettext('System') }}
|
||||
icon: info
|
||||
panel: system
|
||||
|
||||
[menu __main config save]
|
||||
[menu __main more input_shaper]
|
||||
name: {{ gettext('Input Shaper') }}
|
||||
icon: move
|
||||
panel: input_shaper
|
||||
enable: {{ printer.input_shaper }}
|
||||
|
||||
[menu __main more save]
|
||||
name: {{ gettext('Save Config') }}
|
||||
icon: complete
|
||||
method: printer.gcode.script
|
||||
@ -187,16 +175,15 @@ confirm:
|
||||
|
||||
{{ gettext('Klipper will reboot') }}
|
||||
|
||||
[menu __main config settings]
|
||||
name: {{ gettext('Settings') }}
|
||||
[menu __main more settings]
|
||||
name: KlipperScreen
|
||||
icon: settings
|
||||
panel: settings
|
||||
|
||||
[menu __main config input_shaper]
|
||||
name: {{ gettext('Input Shaper') }}
|
||||
icon: move
|
||||
panel: input_shaper
|
||||
enable: {{ printer.input_shaper }}
|
||||
[menu __main more network]
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __print]
|
||||
name: {{ gettext('Print Control') }}
|
||||
@ -291,6 +278,6 @@ panel: system
|
||||
enable: {{ moonraker_connected }}
|
||||
|
||||
[menu __splashscreen settings]
|
||||
name: {{ gettext('Settings') }}
|
||||
name: KlipperScreen
|
||||
icon: settings
|
||||
panel: settings
|
||||
|
@ -74,6 +74,7 @@ class MenuPanel(ScreenPanel):
|
||||
for i in range(len(self.items)):
|
||||
key = list(self.items[i])[0]
|
||||
item = self.items[i][key]
|
||||
scale = 1.1 if 12 < len(self.items) <= 16 else None # hack to fit a 4th row
|
||||
|
||||
printer = self._printer.get_printer_status_data()
|
||||
|
||||
@ -81,7 +82,7 @@ class MenuPanel(ScreenPanel):
|
||||
icon = self._screen.env.from_string(item['icon']).render(printer) if item['icon'] else None
|
||||
style = self._screen.env.from_string(item['style']).render(printer) if item['style'] else None
|
||||
|
||||
b = self._gtk.Button(icon, name, style or f"color{i % 4 + 1}")
|
||||
b = self._gtk.Button(icon, name, style or f"color{i % 4 + 1}", scale=scale)
|
||||
|
||||
if item['panel'] is not None:
|
||||
panel = self._screen.env.from_string(item['panel']).render(printer)
|
||||
|
@ -28,10 +28,7 @@ class MovePanel(ScreenPanel):
|
||||
'y-': self._gtk.Button("arrow-down", "Y-", "color2"),
|
||||
'z+': self._gtk.Button("z-farther", "Z+", "color3"),
|
||||
'z-': self._gtk.Button("z-closer", "Z-", "color3"),
|
||||
'home': self._gtk.Button("home", _("Home All"), "color4"),
|
||||
'home_xy': self._gtk.Button("home", _("Home XY"), "color4"),
|
||||
'z_tilt': self._gtk.Button("z-tilt", _("Z Tilt"), "color4"),
|
||||
'quad_gantry_level': self._gtk.Button("z-tilt", _("Quad Gantry Level"), "color4"),
|
||||
'home': self._gtk.Button("home", _("Home"), "color4"),
|
||||
'motors_off': self._gtk.Button("motor-off", _("Disable Motors"), "color4"),
|
||||
}
|
||||
self.buttons['x+'].connect("clicked", self.move, "X", "+")
|
||||
@ -41,9 +38,6 @@ class MovePanel(ScreenPanel):
|
||||
self.buttons['z+'].connect("clicked", self.move, "Z", "+")
|
||||
self.buttons['z-'].connect("clicked", self.move, "Z", "-")
|
||||
self.buttons['home'].connect("clicked", self.home)
|
||||
self.buttons['home_xy'].connect("clicked", self.homexy)
|
||||
self.buttons['z_tilt'].connect("clicked", self.z_tilt)
|
||||
self.buttons['quad_gantry_level'].connect("clicked", self.quad_gantry_level)
|
||||
script = {"script": "M18"}
|
||||
self.buttons['motors_off'].connect("clicked", self._screen._confirm_send_action,
|
||||
_("Are you sure you wish to disable motors?"),
|
||||
@ -77,15 +71,7 @@ class MovePanel(ScreenPanel):
|
||||
grid.attach(self.buttons['z-'], 3, 1, 1, 1)
|
||||
|
||||
grid.attach(self.buttons['home'], 0, 0, 1, 1)
|
||||
|
||||
if self._printer.config_section_exists("z_tilt"):
|
||||
grid.attach(self.buttons['z_tilt'], 2, 0, 1, 1)
|
||||
elif self._printer.config_section_exists("quad_gantry_level"):
|
||||
grid.attach(self.buttons['quad_gantry_level'], 2, 0, 1, 1)
|
||||
elif "delta" in self._printer.get_config_section("printer")['kinematics']:
|
||||
grid.attach(self.buttons['motors_off'], 2, 0, 1, 1)
|
||||
else:
|
||||
grid.attach(self.buttons['home_xy'], 2, 0, 1, 1)
|
||||
grid.attach(self.buttons['motors_off'], 2, 0, 1, 1)
|
||||
|
||||
distgrid = Gtk.Grid()
|
||||
for j, i in enumerate(self.distances):
|
||||
@ -153,7 +139,7 @@ class MovePanel(ScreenPanel):
|
||||
self.add_option('options', self.settings, name, option[name])
|
||||
|
||||
def process_busy(self, busy):
|
||||
buttons = ("home", "home_xy", "z_tilt", "quad_gantry_level")
|
||||
buttons = ("home", "motors_off")
|
||||
for button in buttons:
|
||||
if button in self.buttons:
|
||||
self.buttons[button].set_sensitive(not busy)
|
||||
@ -266,13 +252,10 @@ class MovePanel(ScreenPanel):
|
||||
return False
|
||||
|
||||
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)
|
||||
if "delta" in self._printer.get_config_section("printer")['kinematics']:
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
|
||||
return
|
||||
name = "homing"
|
||||
disname = self._screen._config.get_menu_name("move", name)
|
||||
menuitems = self._screen._config.get_menu_items("move", name)
|
||||
self._screen.show_panel(name, "menu", disname, 1, False, items=menuitems)
|
||||
|
@ -44,7 +44,7 @@ button.color4:disabled label {
|
||||
|
||||
button label {
|
||||
margin-top: .25em;
|
||||
margin-bottom: .5em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
button.color1 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user