From 5a14c5e5bac30b356039c1ea306221ad6fdfbdb2 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 4 Oct 2016 12:54:52 +0200 Subject: [PATCH 1/3] Replace manual function calls to updateCurrentIndex with an explicit binding This is mostly in support of Uranium PR #165 . That changes SettingPropertyProvider so that the "properties" property does not always change. However, in general this is the more correct approach. Relates to CURA-2232 --- resources/qml/Settings/SettingComboBox.qml | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 0f6bab438d..c4ca637506 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -87,34 +87,32 @@ SettingItem } onActivated: { forceActiveFocus(); propertyProvider.setPropertyValue("value", definition.options[index].key) } - onModelChanged: updateCurrentIndex(); - Connections + Binding { - target: propertyProvider - onPropertiesChanged: control.updateCurrentIndex() - } - - function updateCurrentIndex() { - // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. - var value; - if ((propertyProvider.properties.resolve != "None") && (stackLevel != 0) && (stackLevel != 1)) { - // We have a resolve function. Indicates that the setting is not settable per extruder and that - // we have to choose between the resolved value (default) and the global value - // (if user has explicitly set this). - value = propertyProvider.properties.resolve; - } else { - value = propertyProvider.properties.value; - } - - for(var i = 0; i < definition.options.length; ++i) { - if(definition.options[i].key == value) { - currentIndex = i; - return; + target: control + property: "currentIndex" + value: + { + // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. + var value; + if ((propertyProvider.properties.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) { + // We have a resolve function. Indicates that the setting is not settable per extruder and that + // we have to choose between the resolved value (default) and the global value + // (if user has explicitly set this). + value = propertyProvider.properties.resolve; + } else { + value = propertyProvider.properties.value; } - } - currentIndex = -1; + for(var i = 0; i < control.model.length; ++i) { + if(control.model[i].key == value) { + return i; + } + } + + return -1; + } } } } From bac0ea94a17b0b6597cbaebd2efa03638d3af6e0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Oct 2016 13:26:16 +0200 Subject: [PATCH 2/3] Removed nozzle offset from prime area CURA-2520 --- cura/BuildVolume.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 4e5c3a7d03..ce9967a5a2 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -378,10 +378,6 @@ class BuildVolume(SceneNode): for extruder in extruders: prime_x = extruder.getProperty("extruder_prime_pos_x", "value") - machine_width / 2 prime_y = machine_depth / 2 - extruder.getProperty("extruder_prime_pos_y", "value") - offset_x = extruder.getProperty("machine_nozzle_offset_x", "value") - offset_y = extruder.getProperty("machine_nozzle_offset_y", "value") - prime_x -= offset_x - prime_y -= offset_y prime_polygon = Polygon([ [prime_x - PRIME_CLEARANCE, prime_y - PRIME_CLEARANCE], From 93186dedd009327905dba1837403a937cc8f049f Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Tue, 4 Oct 2016 14:02:34 +0200 Subject: [PATCH 3/3] JSON fix: disable prime position by default for each machine (CURA-2521) --- resources/definitions/fdmextruder.def.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmextruder.def.json b/resources/definitions/fdmextruder.def.json index 16f18d3b2e..7c594e3eda 100644 --- a/resources/definitions/fdmextruder.def.json +++ b/resources/definitions/fdmextruder.def.json @@ -177,7 +177,8 @@ "minimum_value_warning": "machine_nozzle_offset_x", "maximum_value": "machine_width", "settable_per_mesh": false, - "settable_per_extruder": true + "settable_per_extruder": true, + "enabled": false }, "extruder_prime_pos_y": { @@ -189,7 +190,8 @@ "minimum_value_warning": "machine_nozzle_offset_y", "maximum_value_warning": "machine_depth", "settable_per_mesh": false, - "settable_per_extruder": true + "settable_per_extruder": true, + "enabled": false } } }