From b274f63df01f17985a74195b40abf9e7c8871976 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 4 Aug 2017 13:48:16 +0200 Subject: [PATCH] Use the right stack to retrieve infill values in Recommended mode CURA-3932 --- resources/qml/SidebarSimple.qml | 39 +++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 787bd899cf..f988ae0e8b 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -65,10 +65,10 @@ Item id: infillListView property int activeIndex: { - var density = parseInt(infillDensity.properties.value); - var steps = parseInt(infillSteps.properties.value); for(var i = 0; i < infillModel.count; ++i) { + var density = parseInt(infillDensity.properties.value); + var steps = parseInt(infillSteps.properties.value); if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax && steps > infillModel.get(i).stepsMin && steps <= infillModel.get(i).stepsMax) { return i; @@ -521,6 +521,41 @@ Item } } + UM.SettingPropertyProvider + { + id: infillExtruderNumber + + containerStackId: Cura.MachineManager.activeStackId + key: "infill_extruder_nr" + watchedProperties: [ "value" ] + storeIndex: 0 + } + + Binding + { + target: infillDensity + property: "containerStackId" + value: + { + var activeMachineId = Cura.MachineManager.activeMachineId; + if (machineExtruderCount.properties.value > 1) + { + var infillExtruderNr = parseInt(infillExtruderNumber.properties.value); + if (infillExtruderNr >= 0) + { + activeMachineId = ExtruderManager.extruderIds[infillExtruderNumber.properties.value]; + } + else if (ExtruderManager.activeExtruderStackId) + { + activeMachineId = ExtruderManager.activeExtruderStackId; + } + } + + infillSteps.containerStackId = activeMachineId; + return activeMachineId; + } + } + UM.SettingPropertyProvider { id: infillDensity