Add control to set the number of extruders in Machine Settings

This commit is contained in:
fieldOfView 2017-03-10 23:17:03 +01:00
parent 0c74b4d108
commit e853d87779
2 changed files with 53 additions and 5 deletions

View file

@ -345,6 +345,35 @@ Cura.MachineAction
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Label
{
text: catalog.i18nc("@label", "Number of Extruders")
}
ComboBox
{
id: extruderCountComboBox
model: ListModel
{
id: extruderCountModel
Component.onCompleted:
{
for(var i = 0; i < manager.definedExtruderCount; i++)
{
extruderCountModel.append({text: String(i + 1), value: i});
}
}
}
currentIndex: machineExtruderCountProvider.properties.value - 1
onActivated:
{
machineExtruderCountProvider.setPropertyValue("value", index + 1);
manager.forceUpdate();
}
}
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Label
{
text: catalog.i18nc("@label", "Nozzle size")
@ -532,6 +561,16 @@ Cura.MachineAction
storeIndex: manager.containerIndex
}
UM.SettingPropertyProvider
{
id: machineExtruderCountProvider
containerStackId: Cura.MachineManager.activeMachineId
key: "machine_extruder_count"
watchedProperties: [ "value" ]
storeIndex: manager.containerIndex
}
UM.SettingPropertyProvider
{
id: gantryHeightProvider