mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:39:04 +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
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
@ -187,6 +188,8 @@ Item
|
||||
steps: 0,
|
||||
percentageMin: -1,
|
||||
percentageMax: 0,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"),
|
||||
icon: "hollow"
|
||||
})
|
||||
@ -196,6 +199,8 @@ Item
|
||||
steps: 0,
|
||||
percentageMin: 0,
|
||||
percentageMax: 30,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
|
||||
icon: "sparse"
|
||||
})
|
||||
@ -205,6 +210,8 @@ Item
|
||||
steps: 0,
|
||||
percentageMin: 30,
|
||||
percentageMax: 70,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"),
|
||||
icon: "dense"
|
||||
})
|
||||
@ -213,7 +220,9 @@ Item
|
||||
percentage: 100,
|
||||
steps: 0,
|
||||
percentageMin: 70,
|
||||
percentageMax: 100,
|
||||
percentageMax: 9999999999,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"),
|
||||
icon: "solid"
|
||||
})
|
||||
@ -221,6 +230,10 @@ Item
|
||||
name: catalog.i18nc("@label", "Gradual"),
|
||||
percentage: 90,
|
||||
steps: 5,
|
||||
percentageMin: 0,
|
||||
percentageMax: 9999999999,
|
||||
stepsMin: 0,
|
||||
stepsMax: 9999999999,
|
||||
infill_layer_height: 1.5,
|
||||
text: catalog.i18nc("@label", "This will gradually increase the amount of infill towards the top"),
|
||||
icon: "gradual"
|
||||
@ -511,6 +524,16 @@ Item
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: infillSteps
|
||||
|
||||
containerStackId: Cura.MachineManager.activeStackId
|
||||
key: "gradual_infill_steps"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: platformAdhesionType
|
||||
|
Loading…
x
Reference in New Issue
Block a user