mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-24 11:21:14 -07:00
Disable print monitor if the printer is not (yet) ready to receive commands
CURA-1851
This commit is contained in:
parent
f3a119f9bb
commit
ed669925ad
4 changed files with 20 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue