mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
Merge pull request #3137 from Ultimaker/feature_multiple_BP
Feature: Printers with different build plates
This commit is contained in:
commit
cb0ac9b0c8
12 changed files with 420 additions and 23 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 {
|
||||
|
|
|
@ -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