aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/virtual_sdcard.py
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2019-01-21 12:41:42 -0500
committerKevinOConnor <kevin@koconnor.net>2019-01-28 11:23:52 -0500
commite69742df8f6967645fd4063bd4f440cbabd3606d (patch)
tree8ec61ee8e2048f8df4665d8f6e9b9a40eb6bd7df /klippy/extras/virtual_sdcard.py
parent0d4544e72a1ec0e51408141304a57058b585eb00 (diff)
downloadkutter-e69742df8f6967645fd4063bd4f440cbabd3606d.tar.gz
kutter-e69742df8f6967645fd4063bd4f440cbabd3606d.tar.xz
kutter-e69742df8f6967645fd4063bd4f440cbabd3606d.zip
virtual_sdcard: prepare for pause_resume implementation
- Add is_active() member function to return the active printing status of the virtual sdcard - M27 now reports current file position when file has been opened. See http://marlinfw.org/docs/gcode/M027.html Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras/virtual_sdcard.py')
-rw-r--r--klippy/extras/virtual_sdcard.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py
index e99e7cf4..84e80e9f 100644
--- a/klippy/extras/virtual_sdcard.py
+++ b/klippy/extras/virtual_sdcard.py
@@ -57,6 +57,8 @@ class VirtualSD:
if self.work_timer is not None and self.file_size:
progress = float(self.file_position) / self.file_size
return {'progress': progress}
+ def is_active(self):
+ return self.work_timer is not None
# G-Code commands
def cmd_error(self, params):
raise self.gcode.error("SD write not supported")
@@ -123,7 +125,7 @@ class VirtualSD:
self.file_position = pos
def cmd_M27(self, params):
# Report SD print status
- if self.current_file is None or self.work_timer is None:
+ if self.current_file is None:
self.gcode.respond("Not SD printing.")
return
self.gcode.respond("SD printing byte %d/%d" % (