✨ Support for "start" action command

Will (re)start the currently selected print job. Allows job control
through the printer control if supported by the firmware.

Cc @InsanityAutomation
This commit is contained in:
Gina Häußge committed 2020-09-14 09:48:37 +02:00
1 parent 7657544d74
commit d320b1c7a3
2 files changed
+15 -7

No files matched your search

+5 -1
View File
@@ -21,8 +21,12 @@ Action commands are a feature defined for the GCODE based RepRap communication p
OctoPrint out of the box supports handling of the above mentioned commands:
start
When this command is received from the printer, a job is currently selected and *not* active, OctoPrint
will start it just like if the "Start"/"Restart" button had been clicked.
cancel
When this command is received from the printer, OctoPrint will cancel a current print job like if the
When this command is received from the printer, OctoPrint will cancel a current print job just like if the
"Cancel" button had been clicked.
pause
+10 -6
View File
@@ -1768,21 +1768,25 @@ class MachineCom(object):
action_name = action_command
action_params = ""
if action_name == "cancel":
if action_name == "start":
if self._currentFile is not None:
self._log("(Re)Starting current job on request of the printer...")
self.startPrint(tags={"trigger:serial.action_command.start"})
elif action_name == "cancel":
self._log("Cancelling on request of the printer...")
self.cancelPrint()
self.cancelPrint(tags={"trigger:serial.action_command.cancel"})
elif action_name == "pause":
self._log("Pausing on request of the printer...")
self.setPause(True)
self.setPause(True, tags={"trigger:serial.action_command.pause"})
elif action_name == "paused":
self._log("Printer signalled that it paused, switching state...")
self.setPause(True, local_handling=False)
self.setPause(True, local_handling=False, tags={"trigger:serial.action_command.paused"})
elif action_name == "resume":
self._log("Resuming on request of the printer...")
self.setPause(False)
self.setPause(False, tags={"trigger:serial.action_command.resume"})
elif action_name == "resumed":
self._log("Printer signalled that it resumed, switching state...")
self.setPause(False, local_handling=False)
self.setPause(False, local_handling=False, tags={"trigger:serial.action_command.resumed"})
elif action_name == "disconnect":
self._log("Disconnecting on request of the printer...")
self._callback.on_comm_force_disconnect()