From 583069010788a456b3a0db633180925505d4213c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 13 Apr 2016 14:11:18 +0200 Subject: [PATCH] Added setter for progress CURA-1339 --- cura/PrinterOutputDevice.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index d09986020c..6d86cd8a91 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -20,6 +20,7 @@ class PrinterOutputDevice(OutputDevice, QObject): self._bed_temperature = 0 self._hotend_temperatures = {} self._target_hotend_temperatures = {} + self._progress = -1 self._head_x = 0 self._head_y = 0 self._head_z = 0 @@ -194,13 +195,12 @@ class PrinterOutputDevice(OutputDevice, QObject): ## Get the progress of any currently active process. # This function is "final" (do not re-implement) # /sa _getProgress - # /returns float progess of the process. -1 indicates that there is no process. + # /returns float progress of the process. -1 indicates that there is no process. @pyqtProperty(float, notify = progressChanged) def progress(self): - try: - return float(self._getProgress()) - except ValueError: - return -1 + return self._progress - def _getProgress(self): - raise NotImplementedError("_getProgress needs to be implemented") \ No newline at end of file + ## Set the progress of any currently active process + def setProgress(self, progress): + self._progress = progress + self.progressChanged.emit() \ No newline at end of file