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]
|
[menu __print extrude]
|
||||||
name: {{ gettext('Extrude') }}
|
name: {{ gettext('Extrude') }}
|
||||||
icon: filament
|
icon: extrude
|
||||||
panel: extrude
|
panel: extrude
|
||||||
enable: {{ (printer.pause_resume.is_paused == True) and (printer.extruders.count > 0) }}
|
enable: {{ printer.extruders.count > 0 }}
|
||||||
|
|
||||||
[menu __print power]
|
[menu __print power]
|
||||||
name: {{ gettext('Power') }}
|
name: {{ gettext('Power') }}
|
||||||
|
@ -161,15 +161,22 @@ class Panel(ScreenPanel):
|
|||||||
|
|
||||||
self.content.add(grid)
|
self.content.add(grid)
|
||||||
|
|
||||||
def process_busy(self, busy):
|
def enable_buttons(self, enable):
|
||||||
for button in self.buttons:
|
for button in self.buttons:
|
||||||
if button == "temperature":
|
if button == "temperature":
|
||||||
continue
|
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):
|
def process_update(self, action, data):
|
||||||
if action == "notify_busy":
|
if action == "notify_gcode_response":
|
||||||
self.process_busy(data)
|
if "action:cancel" in data or "action:paused" in data:
|
||||||
|
self.enable_buttons(True)
|
||||||
|
elif "action:resumed" in data:
|
||||||
|
self.enable_buttons(False)
|
||||||
return
|
return
|
||||||
if action != "notify_status_update":
|
if action != "notify_status_update":
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user