mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 22:03:11 +08:00
Added jobName property
CURA-1036
This commit is contained in:
parent
6d9eb4028e
commit
d0aa33f57f
@ -32,6 +32,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||||||
self._time_elapsed = 0
|
self._time_elapsed = 0
|
||||||
self._time_total = 0
|
self._time_total = 0
|
||||||
self._job_state = ""
|
self._job_state = ""
|
||||||
|
self._job_name = ""
|
||||||
|
|
||||||
def requestWrite(self, node, file_name = None, filter_by_machine = False):
|
def requestWrite(self, node, file_name = None, filter_by_machine = False):
|
||||||
raise NotImplementedError("requestWrite needs to be implemented")
|
raise NotImplementedError("requestWrite needs to be implemented")
|
||||||
@ -66,6 +67,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||||||
|
|
||||||
jobStateChanged = pyqtSignal()
|
jobStateChanged = pyqtSignal()
|
||||||
|
|
||||||
|
jobNameChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty(str, notify = jobStateChanged)
|
@pyqtProperty(str, notify = jobStateChanged)
|
||||||
def jobState(self):
|
def jobState(self):
|
||||||
return self._job_state
|
return self._job_state
|
||||||
@ -82,6 +85,15 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||||||
def _setJobState(self, job_state):
|
def _setJobState(self, job_state):
|
||||||
Logger.log("w", "_setJobState is not implemented by this output device")
|
Logger.log("w", "_setJobState is not implemented by this output device")
|
||||||
|
|
||||||
|
@pyqtProperty(str, notify = jobNameChanged)
|
||||||
|
def jobName(self):
|
||||||
|
return self._job_name
|
||||||
|
|
||||||
|
def setJobName(self, name):
|
||||||
|
if self._job_name != name:
|
||||||
|
self._job_name = name
|
||||||
|
self.jobNameChanged.emit()
|
||||||
|
|
||||||
## Get the bed temperature of the bed (if any)
|
## Get the bed temperature of the bed (if any)
|
||||||
# This function is "final" (do not re-implement)
|
# This function is "final" (do not re-implement)
|
||||||
# /sa _getBedTemperature implementation function
|
# /sa _getBedTemperature implementation function
|
||||||
|
Loading…
x
Reference in New Issue
Block a user