mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Add handling for cluster print jobs that are in error state
CL-896
This commit is contained in:
parent
be4357c635
commit
a0302684d6
3 changed files with 35 additions and 4 deletions
|
@ -352,7 +352,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
|
||||
@pyqtProperty("QVariantList", notify = printJobsChanged)
|
||||
def queuedPrintJobs(self) -> List[PrintJobOutputModel]:
|
||||
return [print_job for print_job in self._print_jobs if print_job.state == "queued"]
|
||||
return [print_job for print_job in self._print_jobs if print_job.state == "queued" or print_job.state == "error"]
|
||||
|
||||
@pyqtProperty("QVariantList", notify = printJobsChanged)
|
||||
def activePrintJobs(self) -> List[PrintJobOutputModel]:
|
||||
|
@ -474,7 +474,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
|
||||
self._updatePrintJob(print_job, print_job_data)
|
||||
|
||||
if print_job.state != "queued": # Print job should be assigned to a printer.
|
||||
if print_job.state != "queued" and print_job.state != "error": # Print job should be assigned to a printer.
|
||||
if print_job.state in ["failed", "finished", "aborted", "none"]:
|
||||
# Print job was already completed, so don't attach it to a printer.
|
||||
printer = None
|
||||
|
@ -559,9 +559,20 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
def _updatePrintJob(self, print_job: PrintJobOutputModel, data: Dict[str, Any]) -> None:
|
||||
print_job.updateTimeTotal(data["time_total"])
|
||||
print_job.updateTimeElapsed(data["time_elapsed"])
|
||||
print_job.updateState(data["status"])
|
||||
impediments_to_printing = data.get("impediments_to_printing", [])
|
||||
print_job.updateOwner(data["owner"])
|
||||
|
||||
status_set_by_impediment = False
|
||||
for impediment in impediments_to_printing:
|
||||
if impediment["severity"] == "UNFIXABLE":
|
||||
status_set_by_impediment = True
|
||||
print_job.updateState("error")
|
||||
break
|
||||
|
||||
if not status_set_by_impediment:
|
||||
print_job.updateState(data["status"])
|
||||
|
||||
|
||||
def _createMaterialOutputModel(self, material_data) -> MaterialOutputModel:
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type="material", GUID=material_data["guid"])
|
||||
if containers:
|
||||
|
|
|
@ -80,11 +80,26 @@ Item
|
|||
|
||||
Image
|
||||
{
|
||||
id: printJobPreview
|
||||
source: printJob.previewImageUrl
|
||||
anchors.top: ownerName.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: totalTimeLabel.bottom
|
||||
width: height
|
||||
opacity: printJob.state == "error" ? 0.5 : 1.0
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: statusImage
|
||||
anchors.centerIn: printJobPreview
|
||||
source: printJob.state == "error" ? "aborted-icon.svg" : ""
|
||||
visible: source != ""
|
||||
width: 0.5 * printJobPreview.width
|
||||
height: 0.5 * printJobPreview.height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: "black"
|
||||
}
|
||||
|
||||
Label
|
||||
|
@ -121,7 +136,11 @@ Item
|
|||
{
|
||||
if(printJob.assignedPrinter == null)
|
||||
{
|
||||
return catalog.i18nc("@label", "Waiting for: first available")
|
||||
if(printJob.state == "error")
|
||||
{
|
||||
return catalog.i18nc("@label", "Waiting for: Unavailable printer")
|
||||
}
|
||||
return catalog.i18nc("@label", "Waiting for: First available")
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
1
plugins/UM3NetworkPrinting/warning-icon.svg
Normal file
1
plugins/UM3NetworkPrinting/warning-icon.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>warning-icon</title><path d="M18.09,1.31A2.35,2.35,0,0,0,16,0a2.31,2.31,0,0,0-2.09,1.31L.27,28.44A2.49,2.49,0,0,0,.11,30.3a2.38,2.38,0,0,0,1.16,1.42A2.33,2.33,0,0,0,2.36,32H29.64A2.4,2.4,0,0,0,32,29.57a2.55,2.55,0,0,0-.27-1.14ZM3.34,29,16,3.83,28.66,29Z"/><polygon points="13.94 25.19 13.94 25.19 13.94 25.19 13.94 25.19"/><polygon points="14.39 21.68 17.61 21.68 18.11 11.85 13.89 11.85 14.39 21.68"/><path d="M16.06,23.08a2.19,2.19,0,0,0-1.56,3.66,2.14,2.14,0,0,0,1.56.55,2.06,2.06,0,0,0,1.54-.55,2.1,2.1,0,0,0,.55-1.55,2.17,2.17,0,0,0-.53-1.55A2.05,2.05,0,0,0,16.06,23.08Z"/></svg>
|
After Width: | Height: | Size: 684 B |
Loading…
Add table
Add a link
Reference in a new issue