Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2016-09-12 14:30:43 +0300
committerJaime van Kessel <nallath@gmail.com>2016-09-12 14:30:43 +0300
commit8dbe67a6bf9bd0ec2196868c4b1c629359fb33d9 (patch)
tree60e4b2f8a91808d1377b55e5306713344cea0fb7 /cura/PrinterOutputDevice.py
parentc1d04ac6004ddafc0c82f118047b9225285fc91e (diff)
Added printer state to output device
CURA-2235
Diffstat (limited to 'cura/PrinterOutputDevice.py')
-rw-r--r--cura/PrinterOutputDevice.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py
index b828e16daf..35ca6b7cbb 100644
--- a/cura/PrinterOutputDevice.py
+++ b/cura/PrinterOutputDevice.py
@@ -44,6 +44,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
self._error_text = ""
self._accepts_commands = True
+ self._printer_state = ""
+
def requestWrite(self, node, file_name = None, filter_by_machine = False):
raise NotImplementedError("requestWrite needs to be implemented")
@@ -91,10 +93,21 @@ class PrinterOutputDevice(QObject, OutputDevice):
acceptsCommandsChanged = pyqtSignal()
+ printerStateChanged = pyqtSignal()
+
+ @pyqtProperty(str, notify=printerStateChanged)
+ def printerState(self):
+ return self._printer_state
+
@pyqtProperty(str, notify = jobStateChanged)
def jobState(self):
return self._job_state
+ def _updatePrinterState(self, printer_state):
+ if self._printer_state != printer_state:
+ self._printer_state = printer_state
+ self.printerStateChanged.emit()
+
def _updateJobState(self, job_state):
if self._job_state != job_state:
self._job_state = job_state