Skip to content

Commit

Permalink
Add "cancel" command in order to cancel print on Prusa Printers (#1414)
Browse files Browse the repository at this point in the history
The Prusa / Marlin based printers are sending the "action:cancel" (see [1] and [2]) command via serial port. This commit adds the "action:cancel" command support.

[1]: https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/b3ee47aa573f4d9b4af82d7a6963f43ab37ccc08/src/common/serial_printing.cpp#L13
[2]: https://github.com/MarlinFirmware/Marlin/blob/9e879a5b1f801e7572e7948be38a6dad16ad35d8/Marlin/src/feature/host_actions.cpp#L64
  • Loading branch information
bkerler committed Feb 26, 2024
1 parent 2b8f174 commit d378321
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion printrun/pronsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ def recvcb_actions(self, l):
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = command[1]
if command == "pause":
if command in ["pause", "cancel"]:
self.do_pause(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
Expand Down
2 changes: 1 addition & 1 deletion printrun/pronterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ def recvcb_actions(self, l):
if len(command) == 2 and command[0] == "action":
command = command[1]
self.log(_("Received command %s") % command)
if command == "pause":
if command in ["pause", "cancel"]:
if not self.paused:
wx.CallAfter(self.pause)
return True
Expand Down

0 comments on commit d378321

Please sign in to comment.