mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 05:53:59 -06:00
Merge branch 'master' into cura-2007
This commit is contained in:
commit
4ea9276682
46 changed files with 11348 additions and 383 deletions
|
@ -183,13 +183,17 @@ UM.Dialog
|
|||
text: catalog.i18nc("@action:button", "Add Printer")
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
onClicked:
|
||||
{
|
||||
base.visible = false
|
||||
var item = machineList.model.getItem(machineList.currentIndex);
|
||||
Cura.MachineManager.addMachine(machineName.text, item.id)
|
||||
base.machineAdded(item.id) // Emit signal that the user added a machine.
|
||||
}
|
||||
onClicked: addMachine()
|
||||
}
|
||||
|
||||
onAccepted: addMachine()
|
||||
|
||||
function addMachine()
|
||||
{
|
||||
base.visible = false
|
||||
var item = machineList.model.getItem(machineList.currentIndex);
|
||||
Cura.MachineManager.addMachine(machineName.text, item.id)
|
||||
base.machineAdded(item.id) // Emit signal that the user added a machine.
|
||||
}
|
||||
|
||||
Item
|
||||
|
|
|
@ -209,7 +209,7 @@ Rectangle {
|
|||
lengths = ["0.00"];
|
||||
weights = ["0"];
|
||||
}
|
||||
return catalog.i18nc("@label", "%1 m / %2 g").arg(lengths.join(" + ")).arg(weights.join(" + "));
|
||||
return catalog.i18nc("@label", "%1 m / ~ %2 g").arg(lengths.join(" + ")).arg(weights.join(" + "));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,25 +15,57 @@ Rectangle
|
|||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0;
|
||||
property int backendState: UM.Backend.state;
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
|
||||
property int backendState: UM.Backend.state
|
||||
|
||||
|
||||
property bool showProgress: {
|
||||
// determine if we need to show the progress bar + percentage
|
||||
if(!printerConnected || !printerAcceptsCommands) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
case "pre_print": // heating, etc.
|
||||
case "paused":
|
||||
return true;
|
||||
case "wait_cleanup":
|
||||
case "ready": // nut sure if this occurs, "" seems to be the ready state.
|
||||
case "offline":
|
||||
case "abort": // note sure if this jobState actually occurs in the wild
|
||||
case "error": // after clicking abort you apparently get "error"
|
||||
case "": // ready to print or getting ready
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
property variant statusColor:
|
||||
{
|
||||
if(!printerConnected)
|
||||
return UM.Theme.getColor("status_offline")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print" || Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup" )
|
||||
return UM.Theme.getColor("status_busy")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "")
|
||||
return UM.Theme.getColor("status_ready")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||
return UM.Theme.getColor("status_paused")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error")
|
||||
return UM.Theme.getColor("status_stopped")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
|
||||
return UM.Theme.getColor("status_offline")
|
||||
else
|
||||
return UM.Theme.getColor("text")
|
||||
if(!printerConnected || !printerAcceptsCommands)
|
||||
return UM.Theme.getColor("text");
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
case "pre_print":
|
||||
case "wait_cleanup":
|
||||
return UM.Theme.getColor("status_busy");
|
||||
case "ready":
|
||||
case "":
|
||||
return UM.Theme.getColor("status_ready");
|
||||
case "paused":
|
||||
return UM.Theme.getColor("status_paused");
|
||||
case "error":
|
||||
return UM.Theme.getColor("status_stopped");
|
||||
case "offline":
|
||||
return UM.Theme.getColor("status_offline");
|
||||
default:
|
||||
return UM.Theme.getColor("text");
|
||||
}
|
||||
}
|
||||
|
||||
property bool activity: Printer.getPlatformActivity;
|
||||
|
@ -42,31 +74,28 @@ Rectangle
|
|||
property string statusText:
|
||||
{
|
||||
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")
|
||||
}
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Preparing...")
|
||||
}
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Waiting for cleanup...")
|
||||
}
|
||||
else
|
||||
{
|
||||
return " "
|
||||
}
|
||||
return catalog.i18nc("@label:MonitorStatus", "Not connected to a printer");
|
||||
if(!printerAcceptsCommands)
|
||||
return catalog.i18nc("@label:MonitorStatus", "Printer does not accept commands");
|
||||
|
||||
var printerOutputDevice = Cura.MachineManager.printerOutputDevices[0]
|
||||
switch(printerOutputDevice.jobState)
|
||||
{
|
||||
case "offline":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer");
|
||||
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", "Please remove the print");
|
||||
case "error":
|
||||
return printerOutputDevice.errorText;
|
||||
default:
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
|
@ -79,7 +108,7 @@ Rectangle
|
|||
|
||||
color: base.statusColor
|
||||
font: UM.Theme.getFont("large")
|
||||
text: statusText;
|
||||
text: statusText
|
||||
}
|
||||
|
||||
Label
|
||||
|
@ -90,8 +119,8 @@ Rectangle
|
|||
|
||||
color: base.statusColor
|
||||
font: UM.Theme.getFont("large")
|
||||
text: Math.round(progress) + "%";
|
||||
visible: printerConnected
|
||||
text: Math.round(progress) + "%"
|
||||
visible: showProgress
|
||||
}
|
||||
|
||||
Rectangle
|
||||
|
@ -105,6 +134,7 @@ Rectangle
|
|||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
radius: UM.Theme.getSize("progressbar_radius").width
|
||||
color: UM.Theme.getColor("progressbar_background")
|
||||
visible: showProgress
|
||||
|
||||
Rectangle
|
||||
{
|
||||
|
@ -120,7 +150,8 @@ Rectangle
|
|||
id: abortButton
|
||||
|
||||
visible: printerConnected
|
||||
enabled: printerConnected && (Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||
(["paused", "printing", "pre_print"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0)
|
||||
|
||||
height: UM.Theme.getSize("save_button_save_to_button").height
|
||||
anchors.top: progressBar.bottom
|
||||
|
@ -129,20 +160,35 @@ Rectangle
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: catalog.i18nc("@label:", "Abort Print")
|
||||
onClicked: { Cura.MachineManager.printerOutputDevices[0].setJobState("abort") }
|
||||
|
||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort")
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
else if(control.pressed)
|
||||
return UM.Theme.getColor("action_button_active_border");
|
||||
else if(control.hovered)
|
||||
return UM.Theme.getColor("action_button_hovered_border");
|
||||
else
|
||||
return UM.Theme.getColor("action_button_border");
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
else if(control.pressed)
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
else if(control.hovered)
|
||||
return UM.Theme.getColor("action_button_hovered");
|
||||
else
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||
|
@ -151,9 +197,17 @@ Rectangle
|
|||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
else if(control.pressed)
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
else if(control.hovered)
|
||||
return UM.Theme.getColor("action_button_hovered_text");
|
||||
else
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: control.text;
|
||||
}
|
||||
|
@ -164,10 +218,7 @@ Rectangle
|
|||
|
||||
Button
|
||||
{
|
||||
id: pauseButton
|
||||
|
||||
visible: printerConnected
|
||||
enabled: printerConnected && (Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||
id: pauseResumeButton
|
||||
|
||||
height: UM.Theme.getSize("save_button_save_to_button").height
|
||||
anchors.top: progressBar.bottom
|
||||
|
@ -175,20 +226,77 @@ Rectangle
|
|||
anchors.right: abortButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? catalog.i18nc("@label:", "Resume") : catalog.i18nc("@label:", "Pause") : ""
|
||||
onClicked: { Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? Cura.MachineManager.printerOutputDevices[0].setJobState("print") : Cura.MachineManager.printerOutputDevices[0].setJobState("pause") }
|
||||
property bool userClicked: false
|
||||
property string lastJobState: ""
|
||||
|
||||
visible: printerConnected
|
||||
enabled: (!userClicked) && printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||
(["paused", "printing"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0)
|
||||
|
||||
text: {
|
||||
var result = "";
|
||||
var jobState = Cura.MachineManager.printerOutputDevices[0].jobState;
|
||||
if (!printerConnected) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (lastJobState !== jobState) {
|
||||
// the userClicked message must disappear when an "automated" jobState comes by
|
||||
userClicked = false;
|
||||
lastJobState = jobState;
|
||||
}
|
||||
|
||||
if (jobState == "paused")
|
||||
{
|
||||
if (userClicked) {
|
||||
// User feedback for pretending we're already in "printing" mode.
|
||||
result = catalog.i18nc("@label:", "Pause");
|
||||
} else {
|
||||
result = catalog.i18nc("@label:", "Resume");
|
||||
}
|
||||
} else {
|
||||
if (userClicked) {
|
||||
// User feedback for pretending we're already in "pause" mode.
|
||||
result = catalog.i18nc("@label:", "Resume");
|
||||
} else {
|
||||
result = catalog.i18nc("@label:", "Pause");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
onClicked: {
|
||||
var newJobState = Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause";
|
||||
Cura.MachineManager.printerOutputDevices[0].setJobState(newJobState);
|
||||
userClicked = true;
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
else if(control.pressed)
|
||||
return UM.Theme.getColor("action_button_active_border");
|
||||
else if(control.hovered)
|
||||
return UM.Theme.getColor("action_button_hovered_border");
|
||||
else
|
||||
return UM.Theme.getColor("action_button_border");
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
else if(control.pressed)
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
else if(control.hovered)
|
||||
return UM.Theme.getColor("action_button_hovered");
|
||||
else
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||
|
@ -197,11 +305,19 @@ Rectangle
|
|||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
else if(control.pressed)
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
else if(control.hovered)
|
||||
return UM.Theme.getColor("action_button_hovered_text");
|
||||
else
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: control.text;
|
||||
text: control.text
|
||||
}
|
||||
}
|
||||
label: Item { }
|
||||
|
|
|
@ -12,6 +12,16 @@ import Cura 1.0 as Cura
|
|||
Column
|
||||
{
|
||||
id: printMonitor
|
||||
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
|
||||
Label
|
||||
{
|
||||
text: printerConnected ? connectedPrinter.connectionText : catalog.i18nc("@label", "The printer is not connected.")
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
width: base.width
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
|
@ -25,7 +35,7 @@ Column
|
|||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: machineExtruderCount.properties.value > 1 ? catalog.i18nc("@label", "Hotend Temperature %1").arg(index + 1) : catalog.i18nc("@label", "Hotend Temperature")
|
||||
property string value: printerConnected ? Math.round(Cura.MachineManager.printerOutputDevices[0].hotendTemperatures[index]) + "°C" : ""
|
||||
property string value: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
||||
}
|
||||
}
|
||||
Repeater
|
||||
|
@ -35,7 +45,7 @@ Column
|
|||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Bed Temperature")
|
||||
property string value: printerConnected ? Math.round(Cura.MachineManager.printerOutputDevices[0].bedTemperature) + "°C" : ""
|
||||
property string value: printerConnected ? Math.round(connectedPrinter.bedTemperature) + "°C" : ""
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,19 +58,19 @@ Column
|
|||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Job Name")
|
||||
property string value: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobName : ""
|
||||
property string value: printerConnected ? connectedPrinter.jobName : ""
|
||||
}
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Printing Time")
|
||||
property string value: printerConnected ? getPrettyTime(Cura.MachineManager.printerOutputDevices[0].timeTotal) : ""
|
||||
property string value: printerConnected ? getPrettyTime(connectedPrinter.timeTotal) : ""
|
||||
}
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Estimated time left")
|
||||
property string value: printerConnected ? getPrettyTime(Cura.MachineManager.printerOutputDevices[0].timeTotal - Cura.MachineManager.printerOutputDevices[0].timeElapsed) : ""
|
||||
property string value: printerConnected ? getPrettyTime(connectedPrinter.timeTotal - connectedPrinter.timeElapsed) : ""
|
||||
}
|
||||
|
||||
Component
|
||||
|
@ -73,7 +83,7 @@ Column
|
|||
Label
|
||||
{
|
||||
text: label
|
||||
color: printerConnected ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
width: base.width * 0.4
|
||||
elide: Text.ElideRight
|
||||
|
@ -82,7 +92,7 @@ Column
|
|||
Label
|
||||
{
|
||||
text: value
|
||||
color: printerConnected ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
|
|
@ -19,7 +19,10 @@ SettingItem
|
|||
model: Cura.ExtrudersModel
|
||||
{
|
||||
id: extruders_model
|
||||
onModelChanged: control.color = extruders_model.getItem(control.currentIndex).color
|
||||
}
|
||||
property string color: extruders_model.getItem(control.currentIndex).color
|
||||
|
||||
textRole: "name"
|
||||
|
||||
anchors.fill: parent
|
||||
|
@ -64,7 +67,7 @@ SettingItem
|
|||
anchors.leftMargin: UM.Theme.getSize("default_lining").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
color: extruders_model.getItem(control.currentIndex).colour
|
||||
color: control.color
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
|
@ -105,7 +108,8 @@ SettingItem
|
|||
onActivated:
|
||||
{
|
||||
forceActiveFocus();
|
||||
propertyProvider.setPropertyValue("value", extruders_model.getItem(index).index)
|
||||
propertyProvider.setPropertyValue("value", extruders_model.getItem(index).index);
|
||||
control.color = extruders_model.getItem(index).color;
|
||||
}
|
||||
onModelChanged: updateCurrentIndex();
|
||||
|
||||
|
@ -121,7 +125,8 @@ SettingItem
|
|||
{
|
||||
if(extruders_model.getItem(i).index == propertyProvider.properties.value)
|
||||
{
|
||||
currentIndex = i;
|
||||
control.currentIndex = i;
|
||||
control.color = extruders_model.getItem(i).color;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ SettingItem
|
|||
|
||||
maximumLength: 10;
|
||||
|
||||
validator: RegExpValidator { regExp: /[0-9.,-]{0,10}/ }
|
||||
validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}/ : /^-?[0-9.,]{0,10}/ } // definition.type property from parent loader used to disallow fractional number entry
|
||||
|
||||
Binding
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@ Rectangle
|
|||
|
||||
// Is there an output device for this printer?
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
|
||||
color: UM.Theme.getColor("sidebar");
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
@ -107,19 +108,28 @@ Rectangle
|
|||
onClicked: monitoringPrint = true
|
||||
iconSource: {
|
||||
if(!printerConnected)
|
||||
return UM.Theme.getIcon("tab_monitor")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print" || Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup" )
|
||||
return UM.Theme.getIcon("tab_monitor_busy")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "")
|
||||
return UM.Theme.getIcon("tab_monitor_connected")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||
return UM.Theme.getIcon("tab_monitor_paused")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error")
|
||||
return UM.Theme.getIcon("tab_monitor_stopped")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
|
||||
return UM.Theme.getIcon("tab_monitor_offline")
|
||||
else
|
||||
return UM.Theme.getIcon("tab_monitor")
|
||||
return UM.Theme.getIcon("tab_monitor");
|
||||
else if(!printerAcceptsCommands)
|
||||
return UM.Theme.getIcon("tab_monitor_unknown");
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
case "pre_print":
|
||||
case "wait_cleanup":
|
||||
return UM.Theme.getIcon("tab_monitor_busy");
|
||||
case "ready":
|
||||
case "":
|
||||
return UM.Theme.getIcon("tab_monitor_connected")
|
||||
case "paused":
|
||||
return UM.Theme.getIcon("tab_monitor_paused")
|
||||
case "error":
|
||||
return UM.Theme.getIcon("tab_monitor_stopped")
|
||||
case "offline":
|
||||
return UM.Theme.getIcon("tab_monitor_offline")
|
||||
default:
|
||||
return UM.Theme.getIcon("tab_monitor")
|
||||
}
|
||||
}
|
||||
checkable: true
|
||||
checked: monitoringPrint
|
||||
|
|
|
@ -138,7 +138,7 @@ Column
|
|||
anchors.leftMargin: (parent.height - height) / 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
color: model.colour
|
||||
color: model.color
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("toggle_checked")
|
||||
}
|
||||
|
|
|
@ -327,7 +327,8 @@ Item
|
|||
supportEnabled.setPropertyValue("value", false);
|
||||
} else {
|
||||
supportEnabled.setPropertyValue("value", true);
|
||||
supportExtruderNr.setPropertyValue("value", index - 1);
|
||||
// Send the extruder nr as a string.
|
||||
supportExtruderNr.setPropertyValue("value", String(index - 1));
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
|
@ -372,7 +373,7 @@ Item
|
|||
for(var extruderNumber = 0; extruderNumber < extruders.model.rowCount() ; extruderNumber++) {
|
||||
extruderModel.append({
|
||||
text: catalog.i18nc("@label", "Print using %1").arg(extruders.model.getItem(extruderNumber).name),
|
||||
color: extruders.model.getItem(extruderNumber).colour
|
||||
color: extruders.model.getItem(extruderNumber).color
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue