mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06:00
Merge branch 'master' of https://github.com/Ultimaker/PluggableCura
Conflicts: plugins/CuraEngineBackend/CuraEngineBackend.py
This commit is contained in:
commit
7d88d800b2
4 changed files with 240 additions and 27 deletions
|
@ -19,9 +19,8 @@ Button {
|
|||
property bool defaultOverride: false;
|
||||
property bool defaultAmbiguous: false;
|
||||
|
||||
property real printDurationHours: Math.floor(Printer.printDuration / 3600);
|
||||
property real printDurationMinutes: Math.round(((Printer.printDuration / 3600) - printDurationHours) * 60);
|
||||
property real printMaterialAmount: Printer.printMaterialAmount < 0 ? -1 : Math.round(Printer.printMaterialAmount / 10) / 100;
|
||||
property variant printDuration: PrintInformation.currentPrintTime;
|
||||
property real printMaterialAmount: PrintInformation.materialAmount < 0 ? -1 : PrintInformation.materialAmount;
|
||||
|
||||
iconSource: UM.Theme.icons[Printer.outputDevices[base.currentDevice].icon];
|
||||
tooltip: Printer.outputDevices[base.currentDevice].description;
|
||||
|
@ -138,23 +137,31 @@ Button {
|
|||
font: UM.Theme.fonts.default;
|
||||
|
||||
text: {
|
||||
if(control.printDurationHours < 0 || control.printDurationMinutes < 0)
|
||||
if(!control.printDuration)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if(control.printDurationHours > 1)
|
||||
var days = ""
|
||||
var day_count = control.printDuration.getDate() - 1;
|
||||
if(day_count > 0)
|
||||
{
|
||||
return qsTr("%1 hours %2 minutes").arg(control.printDurationHours).arg(control.printDurationMinutes);
|
||||
days = Qt.formatDateTime(control.printDuration, qsTr("d 'day(s)'", "", day_count));
|
||||
}
|
||||
else if(control.printDurationHours > 0)
|
||||
|
||||
var hours = ""
|
||||
if(control.printDuration.getHours() > 0)
|
||||
{
|
||||
return qsTr("1 hour %1 minutes").arg(control.printDurationMinutes);
|
||||
hours = Qt.formatDateTime(control.printDuration, qsTr("h 'hour(s)'", "", control.printDuration.getHours()));
|
||||
}
|
||||
else
|
||||
|
||||
var minutes = ""
|
||||
if(control.printDuration.getMinutes() > 0)
|
||||
{
|
||||
return qsTr("%2 minutes").arg(control.printDurationMinutes);
|
||||
minutes = Qt.formatDateTime(control.printDuration, qsTr("m 'minute(s)'", "", control.printDuration.getMinutes()));
|
||||
}
|
||||
|
||||
return [days, hours, minutes].join(" ");
|
||||
}
|
||||
}
|
||||
Label {
|
||||
|
|
|
@ -6,12 +6,17 @@ import QtQuick.Layouts 1.1
|
|||
import UM 1.0 as UM
|
||||
|
||||
Item {
|
||||
id: base;
|
||||
|
||||
anchors.fill: parent;
|
||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
|
||||
|
||||
property Action configureSettings;
|
||||
|
||||
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
|
||||
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent;
|
||||
|
||||
|
@ -22,15 +27,33 @@ Item {
|
|||
Label {
|
||||
anchors.left: parent.left;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
text: "00:00";
|
||||
text:Qt.formatTime(base.minimumPrintTime, "hh:mm");
|
||||
font: UM.Theme.fonts.timeslider_time;
|
||||
color: UM.Theme.colors.primary;
|
||||
}
|
||||
Label { anchors.centerIn: parent; text: "Estimated Print Time"; color: UM.Theme.colors.text; font: UM.Theme.fonts.default; }
|
||||
Label {
|
||||
anchors.centerIn: parent;
|
||||
text: {
|
||||
if (UM.Backend.progress < 0)
|
||||
{
|
||||
return qsTr("No Model Loaded");
|
||||
}
|
||||
else if (base.minimumPrintTime == null || base.maximumPrintTime == null)
|
||||
{
|
||||
return qsTr("Calculating...")
|
||||
}
|
||||
else
|
||||
{
|
||||
return qsTr("Estimated Print Time");
|
||||
}
|
||||
}
|
||||
color: UM.Theme.colors.text;
|
||||
font: UM.Theme.fonts.default;
|
||||
}
|
||||
Label {
|
||||
anchors.right: parent.right;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
text: "21:00";
|
||||
text: Qt.formatTime(base.maximumPrintTime, "hh:mm");
|
||||
font: UM.Theme.fonts.timeslider_time;
|
||||
color: UM.Theme.colors.primary;
|
||||
}
|
||||
|
@ -43,6 +66,9 @@ Item {
|
|||
minimumValue: 0;
|
||||
maximumValue: 100;
|
||||
|
||||
value: PrintInformation.timeQualityValue;
|
||||
onValueChanged: PrintInformation.setTimeQualityValue(value);
|
||||
|
||||
style: UM.Theme.styles.slider;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue