From 463194b1a326bbeda1db4b3280e416abe53a8929 Mon Sep 17 00:00:00 2001 From: Arksine Date: Wed, 29 Jul 2020 06:23:38 -0400 Subject: [PATCH] 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 --- klippy/extras/virtual_sdcard.py | 6 ++++-- 1 file 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):