From 5975fa1b0dd2ec35e82f351bdaa18d5015dea608 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 26 May 2016 13:29:56 +0200 Subject: [PATCH 1/8] Fix enabled state of setting items Contributes to CURA-1278 --- resources/qml/Settings/SettingView.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 0e99ecc4b7..51f854b519 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -34,11 +34,11 @@ ScrollView id: delegate width: UM.Theme.getSize("sidebar").width; - height: provider.properties.enabled ? UM.Theme.getSize("section").height : 0 + height: provider.properties.enabled == "True" ? UM.Theme.getSize("section").height : 0 Behavior on height { NumberAnimation { duration: 100 } } - opacity: provider.properties.enabled ? 1 : 0 + opacity: provider.properties.enabled == "True" ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } - enabled: provider.properties.enabled + enabled: provider.properties.enabled == "True" property var definition: model property var settingDefinitionsModel: definitionsModel From d5fa6d884f4cc8d2ed8aed462000c4e3ccb34270 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 26 May 2016 13:32:14 +0200 Subject: [PATCH 2/8] Fix XML material profiles so the global properties are properly set Contributes to CURA-339 --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 50c39238fd..d73beec193 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -69,13 +69,15 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): self.addMetaDataEntry("properties", property_values) + self.setDefinition(UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = "fdmprinter")[0]) + global_setting_values = {} settings = data.iterfind("./um:settings/um:setting", self.__namespaces) for entry in settings: key = entry.get("key") if key in self.__material_property_setting_map: self.setProperty(self.__material_property_setting_map[key], "value", entry.text, self._definition) - global_setting_values[key] = entry.text + global_setting_values[self.__material_property_setting_map[key]] = entry.text machines = data.iterfind("./um:settings/um:machine", self.__namespaces) for machine in machines: From 8804c2837f67664b0585fb14f044f202f3a80d46 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 26 May 2016 15:28:57 +0200 Subject: [PATCH 3/8] Make reset and restore default buttons work properly again Contributes to CURA-1278 --- resources/qml/Settings/SettingItem.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index ebbf93af84..013dcd1680 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -89,7 +89,7 @@ Item { { id: revertButton; - visible: propertyProvider.properties.state == "InstanceState.User" + visible: propertyProvider.stackLevel == 0 height: parent.height; width: height; @@ -102,8 +102,8 @@ Item { iconSource: UM.Theme.getIcon("reset") onClicked: { - base.resetRequested() - controlContainer.notifyReset(); + revertButton.focus = true + propertyProvider.removeFromContainer(0) } onEntered: base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile.")) @@ -116,14 +116,14 @@ Item { id: inheritButton; //visible: has_profile_value && base.has_inherit_function && base.is_enabled - visible: propertyProvider.properties.state == "InstanceState.User" + visible: propertyProvider.properties.state == "InstanceState.User" && propertyProvider.stackLevel > 0 height: parent.height; width: height; onClicked: { - base.resetToDefaultRequested(); - controlContainer.notifyReset(); + focus = true; + propertyProvider.removeFromContainer(propertyProvider.stackLevel) } backgroundColor: UM.Theme.getColor("setting_control"); From 43ec037c554142b4cf72ef4b49850347cb9ad9f6 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 26 May 2016 15:29:56 +0200 Subject: [PATCH 4/8] Do not load ComboBox items asynchronously Since there is a bug with Qt 5.5 that will do strange reordering. Contributes to CURA-1278 --- resources/qml/Settings/SettingView.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 51f854b519..34b07ce780 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -45,7 +45,9 @@ ScrollView property var propertyProvider: provider //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 - asynchronous: QT_VERSION_STR.split(".")[1] >= 5 + //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, + //causing nasty issues when selecting differnt options. So disable asynchronous loading of enum type completely. + asynchronous: model.type != "enum" source: { From 4fc1407c00b3fb709ca59a074565532388520ffd Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 26 May 2016 15:32:08 +0200 Subject: [PATCH 5/8] Update variant profiles to use the right syntax for formulas Contributes to CURA-1278 --- resources/variants/ultimaker2_extended_plus_0.25.inst.cfg | 6 +++--- resources/variants/ultimaker2_extended_plus_0.4.inst.cfg | 6 +++--- resources/variants/ultimaker2_extended_plus_0.6.inst.cfg | 6 +++--- resources/variants/ultimaker2_extended_plus_0.8.inst.cfg | 6 +++--- resources/variants/ultimaker2_plus_0.25.inst.cfg | 6 +++--- resources/variants/ultimaker2_plus_0.4.inst.cfg | 6 +++--- resources/variants/ultimaker2_plus_0.6.inst.cfg | 6 +++--- resources/variants/ultimaker2_plus_0.8.inst.cfg | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/resources/variants/ultimaker2_extended_plus_0.25.inst.cfg b/resources/variants/ultimaker2_extended_plus_0.25.inst.cfg index 0c0154c03b..b499db6163 100644 --- a/resources/variants/ultimaker2_extended_plus_0.25.inst.cfg +++ b/resources/variants/ultimaker2_extended_plus_0.25.inst.cfg @@ -12,6 +12,6 @@ machine_nozzle_size = 0.25 machine_nozzle_tip_outer_diameter = 0.8 coasting_volume = 0.1 coasting_min_volume = 0.17 -speed_wall = round(speed_print / 1.2, 1) -speed_wall_0 = 1 if speed_wall < 5 else (speed_wall - 5) -speed_topbottom = round(speed_print / 1.5, 1) +speed_wall = =round(speed_print / 1.2, 1) +speed_wall_0 = =1 if speed_wall < 5 else (speed_wall - 5) +speed_topbottom = =round(speed_print / 1.5, 1) diff --git a/resources/variants/ultimaker2_extended_plus_0.4.inst.cfg b/resources/variants/ultimaker2_extended_plus_0.4.inst.cfg index 87b74b2572..d2fb6f76b1 100644 --- a/resources/variants/ultimaker2_extended_plus_0.4.inst.cfg +++ b/resources/variants/ultimaker2_extended_plus_0.4.inst.cfg @@ -10,6 +10,6 @@ type = variant [values] machine_nozzle_size = 0.4 machine_nozzle_tip_outer_diameter = 1.05 -speed_wall = round(speed_print / 1.25, 1) -speed_wall_0 = 1 if speed_wall < 10 else (speed_wall - 10) -speed_topbottom = round(speed_print / 2.25, 1) +speed_wall = =round(speed_print / 1.25, 1) +speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_topbottom = =round(speed_print / 2.25, 1) diff --git a/resources/variants/ultimaker2_extended_plus_0.6.inst.cfg b/resources/variants/ultimaker2_extended_plus_0.6.inst.cfg index 343b2d85e5..e4f9f0ce45 100644 --- a/resources/variants/ultimaker2_extended_plus_0.6.inst.cfg +++ b/resources/variants/ultimaker2_extended_plus_0.6.inst.cfg @@ -11,6 +11,6 @@ type = variant machine_nozzle_size = 0.6 machine_nozzle_tip_outer_diameter = 1.25 coasting_volume = 1.36 -speed_wall = round(speed_print * 4 / 3, 1) -speed_wall_0 = 1 if speed_wall < 10 else (speed_wall - 10) -speed_topbottom = round(speed_print / 2, 1) +speed_wall = =round(speed_print * 4 / 3, 1) +speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_topbottom = =round(speed_print / 2, 1) diff --git a/resources/variants/ultimaker2_extended_plus_0.8.inst.cfg b/resources/variants/ultimaker2_extended_plus_0.8.inst.cfg index c1bb4555c1..18570ea75d 100644 --- a/resources/variants/ultimaker2_extended_plus_0.8.inst.cfg +++ b/resources/variants/ultimaker2_extended_plus_0.8.inst.cfg @@ -11,6 +11,6 @@ type = variant machine_nozzle_size = 0.8 machine_nozzle_tip_outer_diameter = 1.35 coasting_volume = 3.22 -speed_wall = round(speed_print * 4 / 3, 1) -speed_wall_0 = 1 if speed_wall < 10 else (speed_wall - 10) -speed_topbottom = round(speed_print / 2, 1) +speed_wall = =round(speed_print * 4 / 3, 1) +speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_topbottom = =round(speed_print / 2, 1) diff --git a/resources/variants/ultimaker2_plus_0.25.inst.cfg b/resources/variants/ultimaker2_plus_0.25.inst.cfg index 51a4b44a4a..7cab771101 100644 --- a/resources/variants/ultimaker2_plus_0.25.inst.cfg +++ b/resources/variants/ultimaker2_plus_0.25.inst.cfg @@ -12,6 +12,6 @@ machine_nozzle_size = 0.25 machine_nozzle_tip_outer_diameter = 0.8 coasting_volume = 0.1 coasting_min_volume = 0.17 -speed_wall = round(speed_print / 1.2, 1) -speed_wall_0 = 1 if speed_wall < 5 else (speed_wall - 5) -speed_topbottom = round(speed_print / 1.5, 1) +speed_wall = =round(speed_print / 1.2, 1) +speed_wall_0 = =1 if speed_wall < 5 else (speed_wall - 5) +speed_topbottom = =round(speed_print / 1.5, 1) diff --git a/resources/variants/ultimaker2_plus_0.4.inst.cfg b/resources/variants/ultimaker2_plus_0.4.inst.cfg index aaea23a8df..748f367250 100644 --- a/resources/variants/ultimaker2_plus_0.4.inst.cfg +++ b/resources/variants/ultimaker2_plus_0.4.inst.cfg @@ -10,6 +10,6 @@ type = variant [values] machine_nozzle_size = 0.4 machine_nozzle_tip_outer_diameter = 1.05 -speed_wall = round(speed_print / 1.25, 1) -speed_wall_0 = 1 if speed_wall < 10 else (speed_wall - 10) -speed_topbottom = round(speed_print / 2.25, 1) +speed_wall = =round(speed_print / 1.25, 1) +speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_topbottom = =round(speed_print / 2.25, 1) diff --git a/resources/variants/ultimaker2_plus_0.6.inst.cfg b/resources/variants/ultimaker2_plus_0.6.inst.cfg index c416b2ec3c..34d0f7a5cf 100644 --- a/resources/variants/ultimaker2_plus_0.6.inst.cfg +++ b/resources/variants/ultimaker2_plus_0.6.inst.cfg @@ -11,6 +11,6 @@ type = variant machine_nozzle_size = 0.6 machine_nozzle_tip_outer_diameter = 1.25 coasting_volume = 1.36 -speed_wall = round(speed_print * 4 / 3, 1) -speed_wall_0 = 1 if speed_wall < 10 else (speed_wall - 10) -speed_topbottom = round(speed_print / 2, 1) +speed_wall = =round(speed_print * 4 / 3, 1) +speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_topbottom = =round(speed_print / 2, 1) diff --git a/resources/variants/ultimaker2_plus_0.8.inst.cfg b/resources/variants/ultimaker2_plus_0.8.inst.cfg index 3b577384ec..e719409060 100644 --- a/resources/variants/ultimaker2_plus_0.8.inst.cfg +++ b/resources/variants/ultimaker2_plus_0.8.inst.cfg @@ -11,6 +11,6 @@ type = variant machine_nozzle_size = 0.8 machine_nozzle_tip_outer_diameter = 1.35 coasting_volume = 3.22 -speed_wall = round(speed_print * 4 / 3, 1) -speed_wall_0 = 1 if speed_wall < 10 else (speed_wall - 10) -speed_topbottom = round(speed_print / 2, 1) +speed_wall = =round(speed_print * 4 / 3, 1) +speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_topbottom = =round(speed_print / 2, 1) From c814e47b0e1b61b6a8237bb5847067dca325f13a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 26 May 2016 15:35:28 +0200 Subject: [PATCH 6/8] SettingView now works with PreferenceVisibility handler CURA-1278 --- resources/qml/Settings/SettingView.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 0e99ecc4b7..1069774563 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -27,7 +27,11 @@ ScrollView id: contents spacing: UM.Theme.getSize("default_lining").height; - model: UM.SettingDefinitionsModel { id: definitionsModel; containerId: Cura.MachineManager.activeDefinitionId } + model: UM.SettingDefinitionsModel { + id: definitionsModel; + containerId: Cura.MachineManager.activeDefinitionId + visibilityHandler: UM.SettingPreferenceVisibilityHandler {} + } delegate: Loader { From 7ce4e236772380b306c04067b72c0476b3951638 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 26 May 2016 15:52:36 +0200 Subject: [PATCH 7/8] Add all categories to default visible list Since otherwise none of the children will be visible Contributes to CURA-1278 Fixes CURA-1614 --- cura/CuraApplication.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 9691b638a1..23e40e66b3 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -149,6 +149,7 @@ class CuraApplication(QtApplication): Preferences.getInstance().setDefault("local_file/last_used_type", "text/x-gcode") Preferences.getInstance().setDefault("general/visible_settings", """ + machine_settings resolution layer_height shell @@ -165,6 +166,7 @@ class CuraApplication(QtApplication): speed speed_print speed_travel + travel cooling cool_fan_enabled support @@ -177,8 +179,11 @@ class CuraApplication(QtApplication): raft_airgap layer_0_z_overlap raft_surface_layers + meshfix blackmagic print_sequence + dual + experimental """) JobQueue.getInstance().jobFinished.connect(self._onJobFinished) From 214d385dae06952d5e6af212f453effe70636c58 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 26 May 2016 17:11:41 +0200 Subject: [PATCH 8/8] fix: moved extruder definition settings to a new file fdmextruder.def.json (CURA-1616) --- resources/definitions/fdmextruder.def.json | 119 +++++++++++++++++++++ resources/definitions/fdmprinter.def.json | 100 +---------------- 2 files changed, 124 insertions(+), 95 deletions(-) create mode 100644 resources/definitions/fdmextruder.def.json diff --git a/resources/definitions/fdmextruder.def.json b/resources/definitions/fdmextruder.def.json new file mode 100644 index 0000000000..6533d211c5 --- /dev/null +++ b/resources/definitions/fdmextruder.def.json @@ -0,0 +1,119 @@ +{ + "id": "fdmextruder", + "name": "Extruder", + "version": 2, + "metadata": + { + "type": "extruder", + "author": "Ultimaker B.V.", + "manufacturer": "Ultimaker", + "visible": false + }, + "settings": + { + "machine_settings": + { + "label": "Machine", + "type": "category", + "description": "Machine specific settings", + "children": + { + "extruder_nr": + { + "label": "Extruder", + "description": "The extruder train used for printing. This is used in multi-extrusion.", + "type": "int", + "default_value": 0, + "minimum_value": "0", + "maximum_value": "machine_extruder_count - 1" + }, + "machine_nozzle_offset_x": + { + "label": "Nozzle X Offset", + "description": "The x-coordinate of the offset of the nozzle.", + "type": "float", + "unit": "mm", + "default_value": 0, + "global_only": "True" + }, + "machine_nozzle_offset_y": + { + "label": "Nozzle Y Offset", + "description": "The y-coordinate of the offset of the nozzle.", + "type": "float", + "unit": "mm", + "default_value": 0, + "global_only": "True" + }, + "machine_extruder_start_code": + { + "label": "Extruder Start G-Code", + "description": "Start g-code to execute whenever turning the extruder on.", + "type": "str", + "default_value": "", + "global_only": "True" + }, + "machine_extruder_start_pos_abs": + { + "label": "Extruder Start Position Absolute", + "description": "Make the extruder starting position absolute rather than relative to the last-known location of the head.", + "type": "bool", + "default_value": false, + "global_only": "True" + }, + "machine_extruder_start_pos_x": + { + "label": "Extruder Start Position X", + "description": "The x-coordinate of the starting position when turning the extruder on.", + "type": "float", + "unit": "mm", + "default_value": 0, + "global_only": "True" + }, + "machine_extruder_start_pos_y": + { + "label": "Extruder Start Position Y", + "description": "The y-coordinate of the starting position when turning the extruder on.", + "type": "float", + "unit": "mm", + "default_value": 0, + "global_only": "True" + }, + "machine_extruder_end_code": + { + "label": "Extruder End G-Code", + "description": "End g-code to execute whenever turning the extruder off.", + "type": "str", + "default_value": "", + "global_only": "True" + }, + "machine_extruder_end_pos_abs": + { + "label": "Extruder End Position Absolute", + "description": "Make the extruder ending position absolute rather than relative to the last-known location of the head.", + "type": "bool", + "default_value": false, + "global_only": "True" + }, + "machine_extruder_end_pos_x": + { + "label": "Extruder End Position X", + "description": "The x-coordinate of the ending position when turning the extruder off.", + "type": "float", + "unit": "mm", + "default_value": 0, + "global_only": "True" + }, + "machine_extruder_end_pos_y": + { + "label": "Extruder End Position Y", + "description": "The y-coordinate of the ending position when turning the extruder off.", + "type": "float", + "unit": "mm", + "default_value": 0, + "global_only": "True" + }, + } + } + } +} diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 150fbbdffc..f8400d6d62 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4,6 +4,7 @@ "version": 2, "metadata": { + "type": "machine", "author": "Ultimaker B.V.", "category": "Ultimaker", "manufacturer": "Ultimaker", @@ -12,6 +13,10 @@ "preferred_material": "pla", "preferred_quality": "normal" }, + "machine_extruder_trains": + { + "0": "fdmextruder" + }, "settings": { "machine_settings": @@ -242,92 +247,6 @@ "minimum_value": "0.001", "maximum_value_warning": "10" }, - "machine_nozzle_offset_x": - { - "label": "Nozzle X Offset", - "description": "The x-coordinate of the offset of the nozzle.", - "type": "float", - "unit": "mm", - "default_value": 0, - "global_only": "True" - }, - "machine_nozzle_offset_y": - { - "label": "Nozzle Y Offset", - "description": "The y-coordinate of the offset of the nozzle.", - "type": "float", - "unit": "mm", - "default_value": 0, - "global_only": "True" - }, - "machine_extruder_start_code": - { - "label": "Extruder Start G-Code", - "description": "Start g-code to execute whenever turning the extruder on.", - "type": "str", - "default_value": "", - "global_only": "True" - }, - "machine_extruder_start_pos_abs": - { - "label": "Extruder Start Position Absolute", - "description": "Make the extruder starting position absolute rather than relative to the last-known location of the head.", - "type": "bool", - "default_value": false, - "global_only": "True" - }, - "machine_extruder_start_pos_x": - { - "label": "Extruder Start Position X", - "description": "The x-coordinate of the starting position when turning the extruder on.", - "type": "float", - "unit": "mm", - "default_value": 0, - "global_only": "True" - }, - "machine_extruder_start_pos_y": - { - "label": "Extruder Start Position Y", - "description": "The y-coordinate of the starting position when turning the extruder on.", - "type": "float", - "unit": "mm", - "default_value": 0, - "global_only": "True" - }, - "machine_extruder_end_code": - { - "label": "Extruder End G-Code", - "description": "End g-code to execute whenever turning the extruder off.", - "type": "str", - "default_value": "", - "global_only": "True" - }, - "machine_extruder_end_pos_abs": - { - "label": "Extruder End Position Absolute", - "description": "Make the extruder ending position absolute rather than relative to the last-known location of the head.", - "type": "bool", - "default_value": false, - "global_only": "True" - }, - "machine_extruder_end_pos_x": - { - "label": "Extruder End Position X", - "description": "The x-coordinate of the ending position when turning the extruder off.", - "type": "float", - "unit": "mm", - "default_value": 0, - "global_only": "True" - }, - "machine_extruder_end_pos_y": - { - "label": "Extruder End Position Y", - "description": "The y-coordinate of the ending position when turning the extruder off.", - "type": "float", - "unit": "mm", - "default_value": 0, - "global_only": "True" - }, "machine_use_extruder_offset_to_offset_coords": { "label": "Offset With Extruder", @@ -2201,15 +2120,6 @@ "description": "Settings used for printing with multiple extruders.", "children": { - "extruder_nr": - { - "label": "Extruder", - "description": "The extruder train used for printing. This is used in multi-extrusion.", - "type": "int", - "default_value": 0, - "minimum_value": "0", - "maximum_value": "machine_extruder_count - 1" - }, "adhesion_extruder_nr": { "label": "Platform Adhesion Extruder",