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 committed 2013-09-09 16:55:06 +02:00
1 parent f07305ae4f
commit 51b0df5c1f
2 files changed
+4 -2

No files matched your search

+3 -1
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)})
+1 -1
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;