Merge pull request #3866 from Ultimaker/fix_retraction_amount

Fix retraction amount
This commit is contained in:
jack 2018-06-04 15:59:36 +02:00 committed by GitHub
commit f9df0a542a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 2 deletions

View File

@ -655,6 +655,15 @@ class MachineManager(QObject):
return "" return ""
@pyqtProperty(str, notify = activeVariantChanged)
def activeVariantId(self) -> str:
if self._active_container_stack:
variant = self._active_container_stack.variant
if variant:
return variant.getId()
return ""
@pyqtProperty(str, notify = activeVariantChanged) @pyqtProperty(str, notify = activeVariantChanged)
def activeVariantBuildplateName(self) -> str: def activeVariantBuildplateName(self) -> str:
if self._global_container_stack: if self._global_container_stack:

View File

@ -122,7 +122,7 @@
"raft_jerk": { "value": "jerk_layer_0" }, "raft_jerk": { "value": "jerk_layer_0" },
"raft_margin": { "value": "10" }, "raft_margin": { "value": "10" },
"raft_surface_layers": { "value": "1" }, "raft_surface_layers": { "value": "1" },
"retraction_amount": { "value": "2" }, "retraction_amount": { "value": "6.5" },
"retraction_count_max": { "value": "10" }, "retraction_count_max": { "value": "10" },
"retraction_extrusion_window": { "value": "1" }, "retraction_extrusion_window": { "value": "1" },
"retraction_hop": { "value": "2" }, "retraction_hop": { "value": "2" },

View File

@ -119,7 +119,7 @@
"raft_margin": { "value": "10" }, "raft_margin": { "value": "10" },
"raft_speed": { "value": "25" }, "raft_speed": { "value": "25" },
"raft_surface_layers": { "value": "1" }, "raft_surface_layers": { "value": "1" },
"retraction_amount": { "value": "2" }, "retraction_amount": { "value": "6.5" },
"retraction_count_max": { "value": "10" }, "retraction_count_max": { "value": "10" },
"retraction_extrusion_window": { "value": "1" }, "retraction_extrusion_window": { "value": "1" },
"retraction_hop": { "value": "2" }, "retraction_hop": { "value": "2" },

View File

@ -404,10 +404,17 @@ TabView
id: spinBox id: spinBox
anchors.left: label.right anchors.left: label.right
value: { value: {
// In case the setting is not in the material...
if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) if (!isNaN(parseFloat(materialPropertyProvider.properties.value)))
{ {
return parseFloat(materialPropertyProvider.properties.value); return parseFloat(materialPropertyProvider.properties.value);
} }
// ... we search in the variant, and if it is not there...
if (!isNaN(parseFloat(variantPropertyProvider.properties.value)))
{
return parseFloat(variantPropertyProvider.properties.value);
}
// ... then look in the definition container.
if (!isNaN(parseFloat(machinePropertyProvider.properties.value))) if (!isNaN(parseFloat(machinePropertyProvider.properties.value)))
{ {
return parseFloat(machinePropertyProvider.properties.value); return parseFloat(machinePropertyProvider.properties.value);
@ -431,6 +438,13 @@ TabView
key: model.key key: model.key
} }
UM.ContainerPropertyProvider UM.ContainerPropertyProvider
{
id: variantPropertyProvider
containerId: Cura.MachineManager.activeVariantId
watchedProperties: [ "value" ]
key: model.key
}
UM.ContainerPropertyProvider
{ {
id: machinePropertyProvider id: machinePropertyProvider
containerId: Cura.MachineManager.activeDefinitionId containerId: Cura.MachineManager.activeDefinitionId