Просмотр исходного кода

Added job_state property

CURA-1036
Jaime van Kessel 8 лет назад
Родитель
Сommit
2d78f0a610
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      cura/PrinterOutputDevice.py

+ 12 - 0
cura/PrinterOutputDevice.py

@@ -31,6 +31,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
         self._connection_state = ConnectionState.closed
         self._time_elapsed = 0
         self._time_total = 0
+        self._job_state = ""
 
     def requestWrite(self, node, file_name = None, filter_by_machine = False):
         raise NotImplementedError("requestWrite needs to be implemented")
@@ -63,6 +64,17 @@ class PrinterOutputDevice(QObject, OutputDevice):
 
     timeTotalChanged = pyqtSignal()
 
+    jobStateChanged = pyqtSignal()
+
+    @pyqtProperty(str, notify = jobStateChanged)
+    def jobState(self):
+        return self._job_state
+
+    def setJobState(self, job_state):
+        if self._job_state != job_state:
+            self._job_state = job_state
+            self.jobStateChanged.emit()
+
     ##  Get the bed temperature of the bed (if any)
     #   This function is "final" (do not re-implement)
     #   /sa _getBedTemperature implementation function