mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Merge branch 'master' into feature_preheat_extruder
This commit is contained in:
commit
6e0717a967
58 changed files with 806 additions and 328 deletions
|
@ -204,6 +204,7 @@ UM.MainWindow
|
|||
onObjectRemoved: settingsMenu.removeItem(object)
|
||||
}
|
||||
|
||||
BuildplateMenu { title: catalog.i18nc("@title:menu", "&Build plate"); visible: Cura.MachineManager.hasVariantBuildplates }
|
||||
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: machineExtruderCount.properties.value <= 1 && Cura.MachineManager.hasVariants }
|
||||
MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: machineExtruderCount.properties.value <= 1 && Cura.MachineManager.hasMaterials }
|
||||
ProfileMenu { title: catalog.i18nc("@title:menu", "&Profile"); visible: machineExtruderCount.properties.value <= 1 }
|
||||
|
|
87
resources/qml/Menus/BuildplateMenu.qml
Normal file
87
resources/qml/Menus/BuildplateMenu.qml
Normal file
|
@ -0,0 +1,87 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
{
|
||||
id: menu
|
||||
title: "Build plate"
|
||||
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool isClusterPrinter:
|
||||
{
|
||||
if(Cura.MachineManager.printerOutputDevices.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
|
||||
// This is not a cluster printer or the cluster it is just one printer
|
||||
if(clusterSize == undefined || clusterSize == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
id: automaticBuildplate
|
||||
text:
|
||||
{
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].buildplateId != "" && !isClusterPrinter)
|
||||
{
|
||||
var buildplateName = Cura.MachineManager.printerOutputDevices[0].buildplateId
|
||||
return catalog.i18nc("@title:menuitem %1 is the buildplate currently loaded in the printer", "Automatic: %1").arg(buildplateName)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].buildplateId != "" && !isClusterPrinter
|
||||
onTriggered:
|
||||
{
|
||||
var buildplateId = Cura.MachineManager.printerOutputDevices[0].buildplateId
|
||||
var itemIndex = buildplateInstantiator.model.find("name", buildplateId)
|
||||
if(itemIndex > -1)
|
||||
{
|
||||
Cura.MachineManager.setActiveVariantBuildplate(buildplateInstantiator.model.getItem(itemIndex).id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
{
|
||||
visible: automaticBuildplate.visible
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
id: buildplateInstantiator
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter:
|
||||
{
|
||||
"type": "variant",
|
||||
"hardware_type": "buildplate",
|
||||
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.globalVariantId
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
Cura.MachineManager.setActiveVariantBuildplate(model.id);
|
||||
}
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: group }
|
||||
}
|
|
@ -68,8 +68,17 @@ Menu
|
|||
{
|
||||
filter:
|
||||
{
|
||||
"type": "variant",
|
||||
"definition": Cura.MachineManager.activeQualityDefinitionId //Only show variants of this machine
|
||||
var filter_dict =
|
||||
{
|
||||
"type": "variant",
|
||||
"definition": Cura.MachineManager.activeQualityDefinitionId //Only show variants of this machine
|
||||
}
|
||||
if (Cura.MachineManager.hasVariantBuildplates)
|
||||
{
|
||||
filter_dict["hardware_type"] = "nozzle"
|
||||
}
|
||||
|
||||
return filter_dict
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
|
|
|
@ -143,7 +143,7 @@ UM.ManagementPage
|
|||
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
|
||||
|
||||
property var printJob: connectedPrinter != null ? connectedPrinter.activePrintJob: null
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Printer type:")
|
||||
|
@ -178,7 +178,12 @@ UM.ManagementPage
|
|||
return "";
|
||||
}
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
if (machineInfo.printJob == null)
|
||||
{
|
||||
return catalog.i18nc("@label:MonitorStatus", "Waiting for a printjob");
|
||||
}
|
||||
|
||||
switch(machineInfo.printJob.state)
|
||||
{
|
||||
case "printing":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Printing...");
|
||||
|
@ -194,10 +199,9 @@ UM.ManagementPage
|
|||
return catalog.i18nc("@label:MonitorStatus", "In maintenance. 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");
|
||||
|
||||
}
|
||||
return ""
|
||||
}
|
||||
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands
|
||||
wrapMode: Text.WordWrap
|
||||
|
|
|
@ -72,7 +72,7 @@ TabView
|
|||
width: scrollView.columnWidth;
|
||||
text: properties.name;
|
||||
readOnly: !base.editingEnabled;
|
||||
onEditingFinished: base.setName(properties.name, text)
|
||||
onEditingFinished: base.updateMaterialDisplayName(properties.name, text)
|
||||
}
|
||||
|
||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
||||
|
@ -82,11 +82,7 @@ TabView
|
|||
width: scrollView.columnWidth;
|
||||
text: properties.supplier;
|
||||
readOnly: !base.editingEnabled;
|
||||
onEditingFinished:
|
||||
{
|
||||
base.setMetaDataEntry("brand", properties.supplier, text);
|
||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId);
|
||||
}
|
||||
onEditingFinished: base.updateMaterialSupplier(properties.supplier, text)
|
||||
}
|
||||
|
||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
||||
|
@ -95,15 +91,10 @@ TabView
|
|||
width: scrollView.columnWidth;
|
||||
text: properties.material_type;
|
||||
readOnly: !base.editingEnabled;
|
||||
onEditingFinished:
|
||||
{
|
||||
base.setMetaDataEntry("material", properties.material_type, text);
|
||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
||||
}
|
||||
onEditingFinished: base.updateMaterialType(properties.material_type, text)
|
||||
}
|
||||
|
||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
||||
|
||||
Row {
|
||||
width: scrollView.columnWidth
|
||||
height: parent.rowHeight
|
||||
|
@ -128,13 +119,6 @@ TabView
|
|||
}
|
||||
}
|
||||
|
||||
// make sure the color stays connected after changing the color
|
||||
Binding {
|
||||
target: colorSelector
|
||||
property: "color"
|
||||
value: properties.color_code
|
||||
}
|
||||
|
||||
// pretty color name text field
|
||||
ReadOnlyTextField {
|
||||
id: colorLabel;
|
||||
|
@ -453,14 +437,28 @@ TabView
|
|||
return 0;
|
||||
}
|
||||
|
||||
function setName(old_value, new_value)
|
||||
{
|
||||
if(old_value != new_value)
|
||||
{
|
||||
Cura.ContainerManager.setContainerName(base.containerId, new_value);
|
||||
// update material name label. not so pretty, but it works
|
||||
materialProperties.name = new_value;
|
||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
||||
// update the display name of the material
|
||||
function updateMaterialDisplayName (old_name, new_name) {
|
||||
|
||||
// don't change when new name is the same
|
||||
if (old_name == new_name) {
|
||||
return
|
||||
}
|
||||
|
||||
// update the values
|
||||
Cura.ContainerManager.setContainerName(base.containerId, new_name)
|
||||
materialProperties.name = new_name
|
||||
}
|
||||
|
||||
// update the type of the material
|
||||
function updateMaterialType (old_type, new_type) {
|
||||
base.setMetaDataEntry("material", old_type, new_type)
|
||||
materialProperties.material_type = new_type
|
||||
}
|
||||
|
||||
// update the supplier of the material
|
||||
function updateMaterialSupplier (old_supplier, new_supplier) {
|
||||
base.setMetaDataEntry("brand", old_supplier, new_supplier)
|
||||
materialProperties.supplier = new_supplier
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,15 +153,6 @@ UM.ManagementPage
|
|||
forceActiveFocus()
|
||||
Cura.ContainerManager.createMaterial()
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: base.objectList.model
|
||||
onItemsChanged:
|
||||
{
|
||||
base.objectList.currentIndex = base.getIndexById(Cura.MachineManager.activeMaterialId);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Duplicate button
|
||||
|
|
|
@ -213,8 +213,8 @@ UM.ManagementPage
|
|||
ProfileTab
|
||||
{
|
||||
title: catalog.i18nc("@title:tab", "Global Settings");
|
||||
quality: base.currentItem != null ? base.currentItem.id : "";
|
||||
material: Cura.MachineManager.allActiveMaterialIds[Cura.MachineManager.activeMachineId]
|
||||
quality: Cura.MachineManager.activeMachine.qualityChanges.id
|
||||
material: Cura.MachineManager.activeMachine.material.id
|
||||
}
|
||||
|
||||
Repeater
|
||||
|
|
|
@ -170,8 +170,8 @@ Item {
|
|||
|
||||
tooltip: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
|
||||
// 1 = not started, 2 = Processing
|
||||
enabled: base.backendState != "undefined" && (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
||||
visible: base.backendState != "undefined" && !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
||||
enabled: base.backendState != "undefined" && ([1, 2].indexOf(base.backendState) != -1) && base.activity
|
||||
visible: base.backendState != "undefined" && !autoSlice && ([1, 2, 4].indexOf(base.backendState) != -1) && base.activity
|
||||
property bool autoSlice
|
||||
height: UM.Theme.getSize("save_button_save_to_button").height
|
||||
|
||||
|
@ -179,8 +179,8 @@ Item {
|
|||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
|
||||
// 1 = not started, 5 = disabled
|
||||
text: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
||||
// 1 = not started, 4 = error, 5 = disabled
|
||||
text: [1, 4, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
||||
onClicked:
|
||||
{
|
||||
sliceOrStopSlicing();
|
||||
|
|
|
@ -135,14 +135,6 @@ SettingItem
|
|||
}
|
||||
}
|
||||
|
||||
onEditingFinished:
|
||||
{
|
||||
if (textHasChanged)
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
if(activeFocus)
|
||||
|
|
|
@ -63,11 +63,9 @@ Item
|
|||
menu: ProfileMenu { }
|
||||
|
||||
function generateActiveQualityText () {
|
||||
var result = catalog.i18nc("@", "No Profile Available") // default text
|
||||
|
||||
if (Cura.MachineManager.isActiveQualitySupported ) {
|
||||
result = Cura.MachineManager.activeQualityName
|
||||
var result = Cura.MachineManager.activeQualityName;
|
||||
|
||||
if (Cura.MachineManager.isActiveQualitySupported) {
|
||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
||||
result += " - "
|
||||
|
|
|
@ -96,7 +96,7 @@ Rectangle
|
|||
SidebarHeader {
|
||||
id: header
|
||||
width: parent.width
|
||||
visible: (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) && !monitoringPrint
|
||||
visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) && !monitoringPrint
|
||||
anchors.top: machineSelection.bottom
|
||||
|
||||
onShowTooltip: base.showTooltip(item, location, text)
|
||||
|
@ -128,7 +128,7 @@ Rectangle
|
|||
text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox", "Print Setup disabled\nG-code files cannot be modified")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.top: headerSeparator.bottom
|
||||
anchors.top: hideSettings ? machineSelection.bottom : headerSeparator.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
|
||||
width: Math.floor(parent.width * 0.45)
|
||||
font: UM.Theme.getFont("large")
|
||||
|
|
|
@ -242,7 +242,7 @@ Column
|
|||
Label
|
||||
{
|
||||
id: materialLabel
|
||||
text: catalog.i18nc("@label","Material");
|
||||
text: catalog.i18nc("@label", "Material");
|
||||
width: Math.floor(parent.width * 0.45 - UM.Theme.getSize("default_margin").width)
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
|
@ -314,6 +314,62 @@ Column
|
|||
}
|
||||
}
|
||||
|
||||
//Buildplate row separator
|
||||
Rectangle {
|
||||
id: separator
|
||||
|
||||
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: buildplateRow.visible
|
||||
width: parent.width - UM.Theme.getSize("sidebar_margin").width * 2
|
||||
height: visible ? UM.Theme.getSize("sidebar_lining_thin").height / 2 : 0
|
||||
color: UM.Theme.getColor("sidebar_lining_thin")
|
||||
}
|
||||
|
||||
//Buildplate row
|
||||
Item
|
||||
{
|
||||
id: buildplateRow
|
||||
height: UM.Theme.getSize("sidebar_setup").height
|
||||
visible: Cura.MachineManager.hasVariantBuildplates && !sidebar.monitoringPrint && !sidebar.hideSettings
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: bulidplateLabel
|
||||
text: catalog.i18nc("@label", "Build plate");
|
||||
width: Math.floor(parent.width * 0.45 - UM.Theme.getSize("default_margin").width)
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: buildplateSelection
|
||||
text: Cura.MachineManager.activeVariantBuildplateName
|
||||
tooltip: Cura.MachineManager.activeVariantBuildplateName
|
||||
visible: Cura.MachineManager.hasVariantBuildplates
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: Math.floor(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width)
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
activeFocusOnPress: true;
|
||||
|
||||
menu: BuildplateMenu {}
|
||||
|
||||
property var valueError: !Cura.MachineManager.variantBuildplateCompatible && !Cura.MachineManager.variantBuildplateUsable
|
||||
property var valueWarning: Cura.MachineManager.variantBuildplateUsable
|
||||
}
|
||||
}
|
||||
|
||||
// Material info row
|
||||
Item
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue