mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
Show printer state on Printers preference pane
CURA-2276
This commit is contained in:
parent
411a7bdb84
commit
a90ed439f0
1 changed files with 56 additions and 2 deletions
|
@ -123,7 +123,7 @@ UM.ManagementPage
|
|||
}
|
||||
}
|
||||
|
||||
Row
|
||||
Grid
|
||||
{
|
||||
id: machineInfo
|
||||
|
||||
|
@ -132,17 +132,71 @@ UM.ManagementPage
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
rowSpacing: UM.Theme.getSize("default_lining").height
|
||||
columns: 2
|
||||
|
||||
visible: base.currentItem
|
||||
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Type")
|
||||
text: catalog.i18nc("@label", "Printer type:")
|
||||
visible: base.currentItem && "definition_name" in base.currentItem.metadata
|
||||
}
|
||||
Label {
|
||||
text: (base.currentItem && "definition_name" in base.currentItem.metadata) ? base.currentItem.metadata.definition_name : ""
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Connection:")
|
||||
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId
|
||||
}
|
||||
Label {
|
||||
width: parent.width * 0.7
|
||||
text: machineInfo.printerConnected ? machineInfo.connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
|
||||
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "State:")
|
||||
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands
|
||||
}
|
||||
Label {
|
||||
width: parent.width * 0.7
|
||||
text:
|
||||
{
|
||||
if(!machineInfo.printerConnected || !machineInfo.printerAcceptsCommands) {
|
||||
return "";
|
||||
}
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Printing...");
|
||||
case "paused":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Paused");
|
||||
case "pre_print":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Preparing...");
|
||||
case "wait_cleanup":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Waiting for someone to clear the build plate");
|
||||
case "error":
|
||||
return printerOutputDevice.errorText;
|
||||
case "maintenance": // note sure if this jobState actually occurs in the wild
|
||||
return catalog.i18nc("@label:MonitorStatus", "Busy; please check the printer");
|
||||
case "abort": // note sure if this jobState actually occurs in the wild
|
||||
return catalog.i18nc("@label:MonitorStatus", "Aborting print...");
|
||||
case "ready": // ready to print or getting ready
|
||||
case "": // ready to print or getting ready
|
||||
return catalog.i18nc("@label:MonitorStatus", "Waiting for a printjob");
|
||||
}
|
||||
}
|
||||
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue