diff options
author | Arksine <arksine.code@gmail.com> | 2020-07-29 06:23:38 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2020-08-05 13:46:24 -0400 |
commit | 463194b1a326bbeda1db4b3280e416abe53a8929 (patch) | |
tree | 3cdf6cf7492764ff01307b332d052713a05e517b /klippy/extras/virtual_sdcard.py | |
parent | 963d7c247b7cb9ffc023b3b6700d830f67af9bae (diff) | |
download | kutter-463194b1a326bbeda1db4b3280e416abe53a8929.tar.gz kutter-463194b1a326bbeda1db4b3280e416abe53a8929.tar.xz kutter-463194b1a326bbeda1db4b3280e416abe53a8929.zip |
virtual_sdcard: update get_status method
Do not reset progress to zero while paused. Report 'is_active' and 'file_position'.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras/virtual_sdcard.py')
-rw-r--r-- | klippy/extras/virtual_sdcard.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index 45467906..b2381a06 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -78,9 +78,11 @@ class VirtualSD: raise self.gcode.error("Unable to get file list") def get_status(self, eventtime): progress = 0. - if self.work_timer is not None and self.file_size: + if self.file_size: progress = float(self.file_position) / self.file_size - return {'progress': progress} + is_active = self.is_active() + return {'progress': progress, 'is_active': is_active, + 'file_position': self.file_position} def is_active(self): return self.work_timer is not None def do_pause(self): |