diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 48f283f7f1..0e7f3b4b42 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) 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: 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", 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"); diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 0e99ecc4b7..560e7b0803 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -27,25 +27,31 @@ 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 { 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 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: { 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)