|
@@ -36,6 +36,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|
|
self._job_state = ""
|
|
|
self._job_name = ""
|
|
|
self._error_text = ""
|
|
|
+ self._accepts_commands = True
|
|
|
|
|
|
def requestWrite(self, node, file_name = None, filter_by_machine = False):
|
|
|
raise NotImplementedError("requestWrite needs to be implemented")
|
|
@@ -80,6 +81,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|
|
|
|
|
errorTextChanged = pyqtSignal()
|
|
|
|
|
|
+ acceptsCommandsChanged = pyqtSignal()
|
|
|
+
|
|
|
@pyqtProperty(str, notify = jobStateChanged)
|
|
|
def jobState(self):
|
|
|
return self._job_state
|
|
@@ -115,6 +118,16 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|
|
self._error_text = error_text
|
|
|
self.errorTextChanged.emit()
|
|
|
|
|
|
+ @pyqtProperty(str, notify = acceptsCommandsChanged)
|
|
|
+ def acceptsCommands(self):
|
|
|
+ return self._accepts_commands
|
|
|
+
|
|
|
+ ## Set a flag to signal the UI that the printer is not (yet) ready to receive commands
|
|
|
+ def setAcceptsCommands(self, accepts_commands):
|
|
|
+ if self._accepts_commands != accepts_commands:
|
|
|
+ self._accepts_commands = accepts_commands
|
|
|
+ self.acceptsCommandsChanged.emit()
|
|
|
+
|
|
|
## Get the bed temperature of the bed (if any)
|
|
|
# This function is "final" (do not re-implement)
|
|
|
# /sa _getBedTemperature implementation function
|