mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Mismatched configuration is now shown correctly again
CL-541
This commit is contained in:
parent
3d3b140526
commit
f30f0a7194
3 changed files with 23 additions and 18 deletions
|
@ -2,6 +2,7 @@
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot
|
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot
|
||||||
|
from typing import Optional
|
||||||
MYPY = False
|
MYPY = False
|
||||||
if MYPY:
|
if MYPY:
|
||||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||||
|
@ -15,6 +16,7 @@ class PrintJobOutputModel(QObject):
|
||||||
nameChanged = pyqtSignal()
|
nameChanged = pyqtSignal()
|
||||||
keyChanged = pyqtSignal()
|
keyChanged = pyqtSignal()
|
||||||
assignedPrinterChanged = pyqtSignal()
|
assignedPrinterChanged = pyqtSignal()
|
||||||
|
ownerChanged = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, output_controller: "PrinterOutputController", key: str = "", name: str = "", parent=None):
|
def __init__(self, output_controller: "PrinterOutputController", key: str = "", name: str = "", parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
@ -24,7 +26,17 @@ class PrintJobOutputModel(QObject):
|
||||||
self._time_elapsed = 0
|
self._time_elapsed = 0
|
||||||
self._name = name # Human readable name
|
self._name = name # Human readable name
|
||||||
self._key = key # Unique identifier
|
self._key = key # Unique identifier
|
||||||
self._assigned_printer = None
|
self._assigned_printer = None # type: Optional[PrinterOutputModel]
|
||||||
|
self._owner = "" # Who started/owns the print job?
|
||||||
|
|
||||||
|
@pyqtProperty(str, notify=ownerChanged)
|
||||||
|
def owner(self):
|
||||||
|
return self._owner
|
||||||
|
|
||||||
|
def updateOwner(self, owner):
|
||||||
|
if self._owner != owner:
|
||||||
|
self._owner = owner
|
||||||
|
self.ownerChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(QObject, notify=assignedPrinterChanged)
|
@pyqtProperty(QObject, notify=assignedPrinterChanged)
|
||||||
def assignedPrinter(self):
|
def assignedPrinter(self):
|
||||||
|
|
|
@ -198,11 +198,17 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
print_job.updateTimeTotal(print_job_data["time_total"])
|
print_job.updateTimeTotal(print_job_data["time_total"])
|
||||||
print_job.updateTimeElapsed(print_job_data["time_elapsed"])
|
print_job.updateTimeElapsed(print_job_data["time_elapsed"])
|
||||||
print_job.updateState(print_job_data["status"])
|
print_job.updateState(print_job_data["status"])
|
||||||
|
print_job.updateOwner(print_job_data["owner"])
|
||||||
|
printer = None
|
||||||
if print_job.state != "queued":
|
if print_job.state != "queued":
|
||||||
# Print job should be assigned to a printer.
|
# Print job should be assigned to a printer.
|
||||||
printer = self._getPrinterByKey(print_job_data["printer_uuid"])
|
printer = self._getPrinterByKey(print_job_data["printer_uuid"])
|
||||||
if printer:
|
else: # Status is queued
|
||||||
printer.updateActivePrintJob(print_job)
|
# The job can "reserve" a printer if some changes are required.
|
||||||
|
printer = self._getPrinterByKey(print_job_data["assigned_to"])
|
||||||
|
|
||||||
|
if printer:
|
||||||
|
printer.updateActivePrintJob(print_job)
|
||||||
|
|
||||||
print_jobs_seen.append(print_job)
|
print_jobs_seen.append(print_job)
|
||||||
for old_job in self._print_jobs:
|
for old_job in self._print_jobs:
|
||||||
|
|
|
@ -269,14 +269,7 @@ Rectangle
|
||||||
case "sent_to_printer":
|
case "sent_to_printer":
|
||||||
return catalog.i18nc("@label", "Preparing to print")
|
return catalog.i18nc("@label", "Preparing to print")
|
||||||
case "queued":
|
case "queued":
|
||||||
if (printJob.configuration_changes_required != null && printJob.configuration_changes_required.length !== 0)
|
|
||||||
{
|
|
||||||
return catalog.i18nc("@label:status", "Action required");
|
return catalog.i18nc("@label:status", "Action required");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
case "pausing":
|
case "pausing":
|
||||||
case "paused":
|
case "paused":
|
||||||
return catalog.i18nc("@label:status", "Paused");
|
return catalog.i18nc("@label:status", "Paused");
|
||||||
|
@ -334,10 +327,7 @@ Rectangle
|
||||||
{
|
{
|
||||||
if(printJob.state === "queued")
|
if(printJob.state === "queued")
|
||||||
{
|
{
|
||||||
if (printJob.configuration_changes_required != null && printJob.configuration_changes_required.length !== 0)
|
return "action-required-icon.svg";
|
||||||
{
|
|
||||||
return "action-required-icon.svg";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (printJob.state === "wait_cleanup")
|
else if (printJob.state === "wait_cleanup")
|
||||||
{
|
{
|
||||||
|
@ -401,10 +391,7 @@ Rectangle
|
||||||
case "wait_for_configuration":
|
case "wait_for_configuration":
|
||||||
return catalog.i18nc("@label", "Not accepting print jobs")
|
return catalog.i18nc("@label", "Not accepting print jobs")
|
||||||
case "queued":
|
case "queued":
|
||||||
if (printJob.configuration_changes_required != undefined)
|
return catalog.i18nc("@label", "Waiting for configuration change");
|
||||||
{
|
|
||||||
return catalog.i18nc("@label", "Waiting for configuration change");
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue