diff options
author | Clifford Roche <clifford.roche@gmail.com> | 2021-03-26 11:21:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 11:21:10 -0400 |
commit | e2a321728900a16555b10e683013bf7c90bf64c8 (patch) | |
tree | b5d27eca19229909e107aa5e4beb495b4ca2498f /klippy/extras/pause_resume.py | |
parent | a0307c0e1c8d9ee473ebf018dc9c92100b45f9f9 (diff) | |
download | kutter-e2a321728900a16555b10e683013bf7c90bf64c8.tar.gz kutter-e2a321728900a16555b10e683013bf7c90bf64c8.tar.xz kutter-e2a321728900a16555b10e683013bf7c90bf64c8.zip |
palette2: Add support for P2 devices (#4057)
Module which bring support for P2 devices running in connected mode. This enables using a Palette2 directly with Klippy without Octoprint, or without Palette2 plugins for Octoprint which are not functional out of the box with Klipper.
Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
Diffstat (limited to 'klippy/extras/pause_resume.py')
-rw-r--r-- | klippy/extras/pause_resume.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/klippy/extras/pause_resume.py b/klippy/extras/pause_resume.py index 65d0408c..891f8665 100644 --- a/klippy/extras/pause_resume.py +++ b/klippy/extras/pause_resume.py @@ -57,6 +57,14 @@ class PauseResume: self.send_pause_command() self.gcode.run_script_from_command("SAVE_GCODE_STATE STATE=PAUSE_STATE") self.is_paused = True + def send_resume_command(self): + if self.sd_paused: + # Printing from virtual sd, run pause command + self.v_sd.do_resume() + self.sd_paused = False + else: + self.gcode.respond_info("action:resumed") + self.pause_command_sent = False def cmd_RESUME(self, gcmd): if not self.is_paused: gcmd.respond_info("Print is not paused, resume aborted") @@ -65,13 +73,8 @@ class PauseResume: self.gcode.run_script_from_command( "RESTORE_GCODE_STATE STATE=PAUSE_STATE MOVE=1 MOVE_SPEED=%.4f" % (velocity)) + self.send_resume_command() self.is_paused = False - self.pause_command_sent = False - if self.sd_paused: - # Printing from virtual sd, run pause command - self.v_sd.cmd_M24(gcmd) - else: - gcmd.respond_info("action:resumed") def cmd_CLEAR_PAUSE(self, gcmd): self.is_paused = self.pause_command_sent = False def cmd_CANCEL_PRINT(self, gcmd): |