CURA-4485 Disabling automatic material and variant when connecting to a

printer within a cluster of more than 1 printer.
This commit is contained in:
Diego Prado Gesto 2017-10-24 15:45:20 +02:00
parent 6dfd04928f
commit 0eedfa5c18
2 changed files with 20 additions and 4 deletions

View file

@ -14,6 +14,14 @@ Menu
property int extruderIndex: 0
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool isClusterPrinter:
{
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
// This is a non cluster printer or the cluster it is just one printer
if (typeof clusterSize == "undefined" || clusterSize == 1)
return false
return true
}
UM.SettingPropertyProvider
{
@ -29,14 +37,14 @@ Menu
id: automaticMaterial
text:
{
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex)
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex && !isClusterPrinter)
{
var materialName = Cura.MachineManager.printerOutputDevices[0].materialNames[extruderIndex];
return catalog.i18nc("@title:menuitem %1 is the automatically selected material", "Automatic: %1").arg(materialName);
}
return "";
}
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex && !isClusterPrinter
onTriggered:
{
var materialId = Cura.MachineManager.printerOutputDevices[0].materialIds[extruderIndex];

View file

@ -14,20 +14,28 @@ Menu
property int extruderIndex: 0
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool isClusterPrinter:
{
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
// This is a non cluster printer or the cluster it is just one printer
if (typeof clusterSize == "undefined" || clusterSize == 1)
return false
return true
}
MenuItem
{
id: automaticNozzle
text:
{
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex)
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex && !isClusterPrinter)
{
var nozzleName = Cura.MachineManager.printerOutputDevices[0].hotendIds[extruderIndex];
return catalog.i18nc("@title:menuitem %1 is the nozzle currently loaded in the printer", "Automatic: %1").arg(nozzleName);
}
return "";
}
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex && !isClusterPrinter
onTriggered:
{
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;