mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:49:02 +08:00
Show error text in print monitor
CURA-1990
This commit is contained in:
parent
aba027373b
commit
a74d5dd8cb
@ -35,6 +35,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||
self._time_total = 0
|
||||
self._job_state = ""
|
||||
self._job_name = ""
|
||||
self._error_text = ""
|
||||
|
||||
def requestWrite(self, node, file_name = None, filter_by_machine = False):
|
||||
raise NotImplementedError("requestWrite needs to be implemented")
|
||||
@ -77,6 +78,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||
|
||||
jobNameChanged = pyqtSignal()
|
||||
|
||||
errorTextChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(str, notify = jobStateChanged)
|
||||
def jobState(self):
|
||||
return self._job_state
|
||||
@ -102,6 +105,16 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||
self._job_name = name
|
||||
self.jobNameChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify = errorTextChanged)
|
||||
def errorText(self):
|
||||
return self._error_text
|
||||
|
||||
## Set the error-text that is shown in the print monitor in case of an error
|
||||
def setErrorText(self, error_text):
|
||||
if self._error_text != error_text:
|
||||
self._error_text = error_text
|
||||
self.errorTextChanged.emit()
|
||||
|
||||
## Get the bed temperature of the bed (if any)
|
||||
# This function is "final" (do not re-implement)
|
||||
# /sa _getBedTemperature implementation function
|
||||
|
@ -43,24 +43,30 @@ Rectangle
|
||||
{
|
||||
if(!printerConnected)
|
||||
{
|
||||
return catalog.i18nc("@label:", "Not connected to a printer")
|
||||
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Lost connection with the printer")
|
||||
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Printing...")
|
||||
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Paused")
|
||||
return catalog.i18nc("@label:MonitorStatus", "Not connected to a printer")
|
||||
}
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print")
|
||||
var printerOutputDevice = Cura.MachineManager.printerOutputDevices[0]
|
||||
if(printerOutputDevice.jobState == "offline")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Preparing...")
|
||||
return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer")
|
||||
} else if(printerOutputDevice.jobState == "printing")
|
||||
{
|
||||
return catalog.i18nc("@label:MonitorStatus", "Printing...")
|
||||
} else if(printerOutputDevice.jobState == "paused")
|
||||
{
|
||||
return catalog.i18nc("@label:MonitorStatus", "Paused")
|
||||
}
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup")
|
||||
else if(printerOutputDevice.jobState == "pre_print")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Waiting for cleanup...")
|
||||
return catalog.i18nc("@label:MonitorStatus", "Preparing...")
|
||||
}
|
||||
else if(printerOutputDevice.jobState == "wait_cleanup")
|
||||
{
|
||||
return catalog.i18nc("@label:MonitorStatus", "Please remove the print")
|
||||
}
|
||||
else if(printerOutputDevice.jobState == "error")
|
||||
{
|
||||
return printerOutputDevice.errorText
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user