Use the right stack to retrieve infill values in Recommended mode

CURA-3932
This commit is contained in:
Lipu Fei 2017-08-04 13:48:16 +02:00
parent cf1309c650
commit 3bc7e9012d

View file

@ -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