extrude: show during printing but disable buttons during printing, this allows disabling and checking the filament sensor
This commit is contained in:
parent
1c06e55442
commit
e3cbc1ea8c
@ -208,9 +208,9 @@ enable: {{ (printer.pause_resume.is_paused == True) }}
|
||||
|
||||
[menu __print extrude]
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: filament
|
||||
icon: extrude
|
||||
panel: extrude
|
||||
enable: {{ (printer.pause_resume.is_paused == True) and (printer.extruders.count > 0) }}
|
||||
enable: {{ printer.extruders.count > 0 }}
|
||||
|
||||
[menu __print power]
|
||||
name: {{ gettext('Power') }}
|
||||
|
@ -161,15 +161,22 @@ class Panel(ScreenPanel):
|
||||
|
||||
self.content.add(grid)
|
||||
|
||||
def process_busy(self, busy):
|
||||
def enable_buttons(self, enable):
|
||||
for button in self.buttons:
|
||||
if button == "temperature":
|
||||
continue
|
||||
self.buttons[button].set_sensitive((not busy))
|
||||
self.buttons[button].set_sensitive(enable)
|
||||
|
||||
def activate(self):
|
||||
if self._printer.state == "printing":
|
||||
self.enable_buttons(False)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action == "notify_busy":
|
||||
self.process_busy(data)
|
||||
if action == "notify_gcode_response":
|
||||
if "action:cancel" in data or "action:paused" in data:
|
||||
self.enable_buttons(True)
|
||||
elif "action:resumed" in data:
|
||||
self.enable_buttons(False)
|
||||
return
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user