mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:09:00 +08:00
Detect whether the current infill is gradual
And highlight the correct infill button in that case. Contributes to issue CURA-3732.
This commit is contained in:
parent
df0a971326
commit
ad1b1e0455
@ -64,10 +64,11 @@ Item
|
|||||||
id: infillListView
|
id: infillListView
|
||||||
property int activeIndex:
|
property int activeIndex:
|
||||||
{
|
{
|
||||||
var density = parseInt(infillDensity.properties.value)
|
var density = parseInt(infillDensity.properties.value);
|
||||||
|
var steps = parseInt(infillSteps.properties.value);
|
||||||
for(var i = 0; i < infillModel.count; ++i)
|
for(var i = 0; i < infillModel.count; ++i)
|
||||||
{
|
{
|
||||||
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax )
|
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax && steps > infillModel.get(i).stepsMin && steps <= infillModel.get(i).stepsMax)
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -187,6 +188,8 @@ Item
|
|||||||
steps: 0,
|
steps: 0,
|
||||||
percentageMin: -1,
|
percentageMin: -1,
|
||||||
percentageMax: 0,
|
percentageMax: 0,
|
||||||
|
stepsMin: -1,
|
||||||
|
stepsMax: 0,
|
||||||
text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"),
|
text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"),
|
||||||
icon: "hollow"
|
icon: "hollow"
|
||||||
})
|
})
|
||||||
@ -196,6 +199,8 @@ Item
|
|||||||
steps: 0,
|
steps: 0,
|
||||||
percentageMin: 0,
|
percentageMin: 0,
|
||||||
percentageMax: 30,
|
percentageMax: 30,
|
||||||
|
stepsMin: -1,
|
||||||
|
stepsMax: 0,
|
||||||
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
|
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
|
||||||
icon: "sparse"
|
icon: "sparse"
|
||||||
})
|
})
|
||||||
@ -205,6 +210,8 @@ Item
|
|||||||
steps: 0,
|
steps: 0,
|
||||||
percentageMin: 30,
|
percentageMin: 30,
|
||||||
percentageMax: 70,
|
percentageMax: 70,
|
||||||
|
stepsMin: -1,
|
||||||
|
stepsMax: 0,
|
||||||
text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"),
|
text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"),
|
||||||
icon: "dense"
|
icon: "dense"
|
||||||
})
|
})
|
||||||
@ -213,7 +220,9 @@ Item
|
|||||||
percentage: 100,
|
percentage: 100,
|
||||||
steps: 0,
|
steps: 0,
|
||||||
percentageMin: 70,
|
percentageMin: 70,
|
||||||
percentageMax: 100,
|
percentageMax: 9999999999,
|
||||||
|
stepsMin: -1,
|
||||||
|
stepsMax: 0,
|
||||||
text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"),
|
text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"),
|
||||||
icon: "solid"
|
icon: "solid"
|
||||||
})
|
})
|
||||||
@ -221,6 +230,10 @@ Item
|
|||||||
name: catalog.i18nc("@label", "Gradual"),
|
name: catalog.i18nc("@label", "Gradual"),
|
||||||
percentage: 90,
|
percentage: 90,
|
||||||
steps: 5,
|
steps: 5,
|
||||||
|
percentageMin: 0,
|
||||||
|
percentageMax: 9999999999,
|
||||||
|
stepsMin: 0,
|
||||||
|
stepsMax: 9999999999,
|
||||||
infill_layer_height: 1.5,
|
infill_layer_height: 1.5,
|
||||||
text: catalog.i18nc("@label", "This will gradually increase the amount of infill towards the top"),
|
text: catalog.i18nc("@label", "This will gradually increase the amount of infill towards the top"),
|
||||||
icon: "gradual"
|
icon: "gradual"
|
||||||
@ -511,6 +524,16 @@ Item
|
|||||||
storeIndex: 0
|
storeIndex: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UM.SettingPropertyProvider
|
||||||
|
{
|
||||||
|
id: infillSteps
|
||||||
|
|
||||||
|
containerStackId: Cura.MachineManager.activeStackId
|
||||||
|
key: "gradual_infill_steps"
|
||||||
|
watchedProperties: [ "value" ]
|
||||||
|
storeIndex: 0
|
||||||
|
}
|
||||||
|
|
||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
{
|
{
|
||||||
id: platformAdhesionType
|
id: platformAdhesionType
|
||||||
|
Loading…
x
Reference in New Issue
Block a user