TransferDone and SlicingDone events should also carry the seconds of elapsed time as a float instead of a (rounded) string
This commit is contained in:
parent
620d7de02f
commit
565757580b
3 changed files with 4 additions and 4 deletions
|
|
@ -293,7 +293,7 @@ class GcodeManager:
|
|||
os.remove(stlPath)
|
||||
else:
|
||||
slicingStop = time.time()
|
||||
eventManager().fire(Events.SLICING_DONE, {"stl": self._getBasicFilename(stlPath), "gcode": self._getBasicFilename(gcodePath), "time": "%.2f" % (slicingStop - slicingStart)})
|
||||
eventManager().fire(Events.SLICING_DONE, {"stl": self._getBasicFilename(stlPath), "gcode": self._getBasicFilename(gcodePath), "time": slicingStop - slicingStart})
|
||||
self.processGcode(gcodePath, destination, uploadCallback)
|
||||
|
||||
eventManager().fire(Events.SLICING_STARTED, {"stl": self._getBasicFilename(absolutePath), "gcode": self._getBasicFilename(gcodePath)})
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM
|
|||
gcodeUploadProgress.removeClass("progress-striped").removeClass("active");
|
||||
gcodeUploadProgressBar.css("width", "0%");
|
||||
gcodeUploadProgressBar.text("");
|
||||
$.pnotify({title: "Slicing done", text: "Sliced " + payload.stl + " to " + payload.gcode + ", took " + payload.time + " seconds"});
|
||||
$.pnotify({title: "Slicing done", text: "Sliced " + payload.stl + " to " + payload.gcode + ", took " + _.sprintf("%.2f", payload.time) + " seconds"});
|
||||
gcodeFilesViewModel.requestData(payload.gcode);
|
||||
} else if (type == "SlicingFailed") {
|
||||
gcodeUploadProgress.removeClass("progress-striped").removeClass("active");
|
||||
|
|
@ -142,7 +142,7 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM
|
|||
gcodeUploadProgress.removeClass("progress-striped").removeClass("active");
|
||||
gcodeUploadProgressBar.css("width", "0%");
|
||||
gcodeUploadProgressBar.text("");
|
||||
$.pnotify({title: "Streaming done", text: "Streamed " + payload.local + " to " + payload.remote + " on SD, took " + payload.time + " seconds"});
|
||||
$.pnotify({title: "Streaming done", text: "Streamed " + payload.local + " to " + payload.remote + " on SD, took " + _.sprintf("%.2f", payload.time) + " seconds"});
|
||||
gcodeFilesViewModel.requestData(payload.remote, "sdcard");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -927,7 +927,7 @@ class MachineCom(object):
|
|||
payload = {
|
||||
"local": self._currentFile.getLocalFilename(),
|
||||
"remote": self._currentFile.getRemoteFilename(),
|
||||
"time": "%.2f" % (time.time() - self._currentFile.getStartTime())
|
||||
"time": time.time() - self._currentFile.getStartTime()
|
||||
}
|
||||
|
||||
self._currentFile = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue