Filter materials by the (approximate) material diameter of the printer

If a machine defines material diameter of 2.85mm, there is no use to show the 1.75mm materials and vice-versa
This commit is contained in:
fieldOfView 2017-04-12 23:03:58 +02:00
parent e0b927b53c
commit e92aaca7b6
3 changed files with 22 additions and 2 deletions

View file

@ -18,7 +18,7 @@ UM.ManagementPage
{
filter:
{
var result = { "type": "material" }
var result = { "type": "material", "approximate_diameter": Math.round(materialDiameterProvider.properties.value) }
if(Cura.MachineManager.filterMaterialsByMachine)
{
result.definition = Cura.MachineManager.activeQualityDefinitionId;
@ -327,6 +327,15 @@ UM.ManagementPage
id: messageDialog
}
UM.SettingPropertyProvider
{
id: materialDiameterProvider
containerStackId: Cura.MachineManager.activeMachineId
key: "material_diameter"
watchedProperties: [ "value" ]
}
UM.I18nCatalog { id: catalog; name: "cura"; }
SystemPalette { id: palette }
}