Also measure time needed for slicing and include it in event payload, display that in the UI too

This commit is contained in:
Gina Häußge 2013-09-09 16:55:06 +02:00
parent f07305ae4f
commit 51b0df5c1f
2 changed files with 4 additions and 2 deletions

View file

@ -166,8 +166,10 @@ class GcodeManager:
gcodePath = util.genGcodeFileName(absolutePath)
config = self._settings.get(["cura", "config"])
slicingStart = time.time()
def stlProcessed(stlPath, gcodePath):
eventManager().fire("SlicingDone", {"stl": self._getBasicFilename(stlPath), "gcode": self._getBasicFilename(gcodePath)})
slicingStop = time.time()
eventManager().fire("SlicingDone", {"stl": self._getBasicFilename(stlPath), "gcode": self._getBasicFilename(gcodePath), "time": "%.2f" % (slicingStop - slicingStart)})
self.processGcode(gcodePath)
eventManager().fire("SlicingStarted", {"stl": self._getBasicFilename(absolutePath), "gcode": self._getBasicFilename(gcodePath)})

View file

@ -109,7 +109,7 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM
} else if (type == "slicingStarted") {
$.pnotify({title: "Slicing started", text: "Slicing " + payload.stl + " to " + payload.gcode});
} else if (type == "slicingDone") {
$.pnotify({title: "Slicing done", text: "Sliced " + payload.stl + " to " + payload.gcode});
$.pnotify({title: "Slicing done", text: "Sliced " + payload.stl + " to " + payload.gcode + ", took " + payload.time + " seconds"});
gcodeFilesViewModel.requestData(payload.gcode);
}
break;