From 620d7de02f1eea75bc344534157285522a8da974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 9 Jan 2014 20:59:40 +0100 Subject: [PATCH] Added time needed for printing file to PrintDone event's payload Fixes #333 --- src/octoprint/util/comm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index efa4b5f2..afd81496 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -664,7 +664,8 @@ class MachineCom(object): self._changeState(self.STATE_OPERATIONAL) eventManager().fire(Events.PRINT_DONE, { "file": self._currentFile.getFilename(), - "origin": self._currentFile.getFileLocation() + "origin": self._currentFile.getFileLocation(), + "time": time.time() - self._currentFile.getStartTime() }) elif 'Done saving file' in line: self.refreshSdFiles() @@ -937,7 +938,8 @@ class MachineCom(object): else: payload = { "file": self._currentFile.getFilename(), - "origin": self._currentFile.getFileLocation() + "origin": self._currentFile.getFileLocation(), + "time": time.time() - self._currentFile.getStartTime() } self._callback.mcPrintjobDone() self._changeState(self.STATE_OPERATIONAL)