diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 7c843fcdea..6bda2d94e3 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -281,7 +281,7 @@ class BuildVolume(SceneNode): continue # If the entire node is below the build plate, still mark it as outside. node_bounding_box = node.getBoundingBox() - if node_bounding_box and node_bounding_box.top < 0: + if node_bounding_box and node_bounding_box.top < 0 and not node.getParent().callDecoration("isGroup"): node.setOutsideBuildArea(True) continue # Mark the node as outside build volume if the set extruder is disabled @@ -344,7 +344,12 @@ class BuildVolume(SceneNode): # Mark the node as outside build volume if the set extruder is disabled extruder_position = node.callDecoration("getActiveExtruderPosition") - if not self._global_container_stack.extruderList[int(extruder_position)].isEnabled: + try: + if not self._global_container_stack.extruderList[int(extruder_position)].isEnabled: + node.setOutsideBuildArea(True) + return + except IndexError: + # If the extruder doesn't exist, also mark it as unprintable. node.setOutsideBuildArea(True) return diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 0411343855..f0c69d5a61 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -756,7 +756,7 @@ class CuraApplication(QtApplication): self._plugin_registry.addPluginLocation(os.path.join(QtApplication.getInstallPrefix(), "lib" + suffix, "cura")) if not hasattr(sys, "frozen"): self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "plugins")) - self._plugin_registry.loadPlugin("ConsoleLogger") + self._plugin_registry.preloaded_plugins.append("ConsoleLogger") self._plugin_registry.loadPlugins() diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 8db043f6a6..1c0088dd98 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -636,6 +636,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader): message.show() self.setWorkspaceName("") return [], {} + except zipfile.BadZipFile as e: + message = Message(i18n_catalog.i18nc("@info:error Don't translate the XML tags or !", + "Project file {0} is corrupt: {1}.", file_name, str(e)), + title = i18n_catalog.i18nc("@info:title", "Can't Open Project File")) + message.show() + self.setWorkspaceName("") + return [], {} cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")] diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 685d15308b..1fd20a3534 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2020 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -7,6 +7,7 @@ import QtQuick.Layouts 1.3 import QtQuick.Window 2.2 import UM 1.1 as UM +import Cura 1.1 as Cura UM.Dialog { @@ -110,13 +111,14 @@ UM.Dialog height: visible ? comboboxHeight : 0 visible: base.visible && machineResolveComboBox.model.count > 1 text: catalog.i18nc("@info:tooltip", "How should the conflict in the machine be resolved?") - ComboBox + Cura.ComboBox { id: machineResolveComboBox model: manager.updatableMachinesModel visible: machineResolveStrategyTooltip.visible textRole: "displayName" width: parent.width + height: UM.Theme.getSize("button").height onCurrentIndexChanged: { if (model.getItem(currentIndex).id == "new" @@ -217,12 +219,13 @@ UM.Dialog height: visible ? comboboxHeight : 0 visible: manager.qualityChangesConflict text: catalog.i18nc("@info:tooltip", "How should the conflict in the profile be resolved?") - ComboBox + Cura.ComboBox { model: resolveStrategiesModel textRole: "label" id: qualityChangesResolveComboBox width: parent.width + height: UM.Theme.getSize("button").height onActivated: { manager.setResolveStrategy("quality_changes", resolveStrategiesModel.get(index).key) @@ -323,12 +326,13 @@ UM.Dialog height: visible ? comboboxHeight : 0 visible: manager.materialConflict text: catalog.i18nc("@info:tooltip", "How should the conflict in the material be resolved?") - ComboBox + Cura.ComboBox { model: resolveStrategiesModel textRole: "label" id: materialResolveComboBox width: parent.width + height: UM.Theme.getSize("button").height onActivated: { manager.setResolveStrategy("material", resolveStrategiesModel.get(index).key) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index 41fd4a5805..210199e087 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -66,6 +66,22 @@ class TimeLapse(Script): "type": "float", "default_value": 9000, "enabled": "park_print_head" + }, + "retract": + { + "label": "Retraction Distance", + "description": "Filament retraction distance for camera trigger.", + "unit": "mm", + "type": "int", + "default_value": 0 + }, + "zhop": + { + "label": "Z-Hop Height When Parking", + "description": "Z-hop length before parking", + "unit": "mm", + "type": "float", + "default_value": 0 } } }""" @@ -77,9 +93,12 @@ class TimeLapse(Script): y_park = self.getSettingValueByKey("head_park_y") trigger_command = self.getSettingValueByKey("trigger_command") pause_length = self.getSettingValueByKey("pause_length") + retract = int(self.getSettingValueByKey("retract")) + zhop = self.getSettingValueByKey("zhop") gcode_to_append = ";TimeLapse Begin\n" last_x = 0 last_y = 0 + last_z = 0 if park_print_head: gcode_to_append += self.putValue(G=1, F=feed_rate, @@ -90,16 +109,35 @@ class TimeLapse(Script): for idx, layer in enumerate(data): for line in layer.split("\n"): - if self.getValue(line, "G") in {0, 1}: # Track X,Y location. + if self.getValue(line, "G") in {0, 1}: # Track X,Y,Z location. last_x = self.getValue(line, "X", last_x) last_y = self.getValue(line, "Y", last_y) + last_z = self.getValue(line, "Z", last_z) # Check that a layer is being printed lines = layer.split("\n") for line in lines: if ";LAYER:" in line: + if retract != 0: # Retract the filament so no stringing happens + layer += self.putValue(M=83) + " ;Extrude Relative\n" + layer += self.putValue(G=1, E=-retract, F=3000) + " ;Retract filament\n" + layer += self.putValue(M=82) + " ;Extrude Absolute\n" + layer += self.putValue(M=400) + " ;Wait for moves to finish\n" # Wait to fully retract before hopping + + if zhop != 0: + layer += self.putValue(G=1, Z=last_z+zhop, F=3000) + " ;Z-Hop\n" + layer += gcode_to_append - layer += "G0 X%s Y%s\n" % (last_x, last_y) + if zhop != 0: + layer += self.putValue(G=0, X=last_x, Y=last_y, Z=last_z) + "; Restore position \n" + else: + layer += self.putValue(G=0, X=last_x, Y=last_y) + "; Restore position \n" + + if retract != 0: + layer += self.putValue(M=400) + " ;Wait for moves to finish\n" + layer += self.putValue(M=83) + " ;Extrude Relative\n" + layer += self.putValue(G=1, E=retract, F=3000) + " ;Retract filament\n" + layer += self.putValue(M=82) + " ;Extrude Absolute\n" data[idx] = layer break diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py index 9a8e7f5dfe..04c8ed3a40 100644 --- a/plugins/Toolbox/src/AuthorsModel.py +++ b/plugins/Toolbox/src/AuthorsModel.py @@ -2,7 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. import re -from typing import Dict, List, Optional, Union +from typing import Dict, List, Optional, Union, cast from PyQt5.QtCore import Qt, pyqtProperty @@ -68,7 +68,7 @@ class AuthorsModel(ListModel): # Execute all filters. filtered_items = list(items) - filtered_items.sort(key = lambda k: k["name"]) + filtered_items.sort(key = lambda k: cast(str, k["name"])) self.setItems(filtered_items) def setFilter(self, filter_dict: Dict[str, str]) -> None: diff --git a/resources/definitions/SV01.def.json b/resources/definitions/SV01.def.json index 02347a8e3b..439ced7d38 100644 --- a/resources/definitions/SV01.def.json +++ b/resources/definitions/SV01.def.json @@ -65,6 +65,6 @@ "retraction_speed": { "default_value": 50}, "adhesion_type": { "value": "'skirt'" }, "machine_start_gcode": { "default_value": "M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration\nM203 X500.00 Y500.00 Z10.00 E50.00 ;Setup machine max feedrate\nM204 P500.00 R1000.00 T500.00 ;Setup Print/Retract/Travel acceleration\nM205 X8.00 Y8.00 Z0.40 E5.00 ;Setup Jerk\nM220 S100 ;Reset Feedrate\nM221 S100 ;Reset Flowrate\n\nG28 ;Home\n\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\n" }, - "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X0 Y240 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" } + "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X0 Y240 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" } } -} \ No newline at end of file +} diff --git a/resources/definitions/anycubic_mega_zero.def.json b/resources/definitions/anycubic_mega_zero.def.json index a17fddc4b4..b0c3132858 100644 --- a/resources/definitions/anycubic_mega_zero.def.json +++ b/resources/definitions/anycubic_mega_zero.def.json @@ -59,7 +59,7 @@ }, "machine_end_gcode": { - "default_value": "M117 Cooling down...\nM104 S0 ; turn off extruder\nM84 ; disable motors\nM107 ; Fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;move X to min endstops, so the head is out of the way\nG90 ;Absolute positionning\nG1 Y200 F3000 ;Present print\nM84 ;steppers off\nM300 P300 S4000\nM117 Finished.\n" + "default_value": "M117 Cooling down...\nM104 S0 ; turn off extruder\nM84 ; disable motors\nM107 ; Fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;move X to min endstops, so the head is out of the way\nG90 ;Absolute positioning\nG1 Y200 F3000 ;Present print\nM84 ;steppers off\nM300 P300 S4000\nM117 Finished.\n" }, "machine_max_feedrate_x": { "value": 500 }, "machine_max_feedrate_y": { "value": 500 }, diff --git a/resources/definitions/biqu_base.def.json b/resources/definitions/biqu_base.def.json index 83e50cbe80..4327da886c 100755 --- a/resources/definitions/biqu_base.def.json +++ b/resources/definitions/biqu_base.def.json @@ -25,7 +25,7 @@ "overrides": { "machine_name": { "default_value": "BIQU Base Printer" }, "machine_start_gcode": { "default_value": "M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration\nM203 X500.00 Y500.00 Z10.00 E50.00 ;Setup machine max feedrate\nM204 P500.00 R1000.00 T500.00 ;Setup Print/Retract/Travel acceleration\nM205 X8.00 Y8.00 Z0.40 E5.00 ;Setup Jerk\nM220 S100 ;Reset Feedrate\nM221 S100 ;Reset Flowrate\n\nG28 ;Home\n\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\n" }, - "machine_end_gcode": { "default_value": " ;BIQU Default End Gcode\nG91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract a bit more and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z by 10mm\nG90 ;Return to absolute positionning\n\nG1 X0 Y{machine_depth} ;TaDaaaa\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, + "machine_end_gcode": { "default_value": " ;BIQU Default End Gcode\nG91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract a bit more and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z by 10mm\nG90 ;Return to absolute positioning\n\nG1 X0 Y{machine_depth} ;TaDaaaa\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, "machine_max_feedrate_x": { "value": 500 }, "machine_max_feedrate_y": { "value": 500 }, diff --git a/resources/definitions/creality_base.def.json b/resources/definitions/creality_base.def.json index fb6f8e3eb3..34a02ee86f 100644 --- a/resources/definitions/creality_base.def.json +++ b/resources/definitions/creality_base.def.json @@ -125,7 +125,7 @@ "overrides": { "machine_name": { "default_value": "Creawsome Base Printer" }, "machine_start_gcode": { "default_value": "M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration\nM203 X500.00 Y500.00 Z10.00 E50.00 ;Setup machine max feedrate\nM204 P500.00 R1000.00 T500.00 ;Setup Print/Retract/Travel acceleration\nM205 X8.00 Y8.00 Z0.40 E5.00 ;Setup Jerk\nM220 S100 ;Reset Feedrate\nM221 S100 ;Reset Flowrate\n\nG28 ;Home\n\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\n" }, - "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, + "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, "machine_max_feedrate_x": { "value": 500 }, "machine_max_feedrate_y": { "value": 500 }, diff --git a/resources/definitions/creality_ender5.def.json b/resources/definitions/creality_ender5.def.json index 1b4be4d71f..896f532c81 100644 --- a/resources/definitions/creality_ender5.def.json +++ b/resources/definitions/creality_ender5.def.json @@ -4,7 +4,7 @@ "inherits": "creality_base", "overrides": { "machine_name": { "default_value": "Creality Ender-5" }, - "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG1 X0 Y0 ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, + "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG1 X0 Y0 ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, "machine_width": { "default_value": 220 }, "machine_depth": { "default_value": 220 }, "machine_height": { "default_value": 300 }, @@ -25,4 +25,4 @@ "quality_definition": "creality_base", "visible": true } -} \ No newline at end of file +} diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 037e72181d..071bdf9740 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -873,7 +873,7 @@ "default_value": 0.4, "type": "float", "value": "line_width", - "enabled": "resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim' or resolveOrValue('prime_tower_brim_enable')", + "enabled": "resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim' or resolveOrValue('prime_tower_brim_enable') or resolveOrValue('draft_shield_enabled') or resolveOrValue('ooze_shield_enabled')", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -2120,7 +2120,7 @@ "max_skin_angle_for_expansion": { "label": "Maximum Skin Angle for Expansion", - "description": "Top and/or bottom surfaces of your object with an angle larger than this setting, won't have their top/bottom skin expanded. This avoids expanding the narrow skin areas that are created when the model surface has a near vertical slope. An angle of 0° is horizontal, while an angle of 90° is vertical.", + "description": "Top and/or bottom surfaces of your object with an angle larger than this setting, won't have their top/bottom skin expanded. This avoids expanding the narrow skin areas that are created when the model surface has a near vertical slope. An angle of 0° is horizontal and will cause no skin to be expanded, while an angle of 90° is vertical and will cause all skin to be expanded.", "unit": "°", "type": "float", "minimum_value": "0", @@ -2408,7 +2408,7 @@ "default_value": -4, "enabled": false, "minimum_value_warning": "-switch_extruder_retraction_amount", - "maximum_value_warning": "0", + "maximum_value": "0", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -2434,7 +2434,7 @@ "default_value": -16, "enabled": false, "minimum_value_warning": "-retraction_amount * 4", - "maximum_value_warning": "0", + "maximum_value": "0", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -2475,7 +2475,7 @@ "default_value": -50, "enabled": false, "minimum_value_warning": "-100", - "maximum_value_warning": "0", + "maximum_value": "0", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -2669,7 +2669,7 @@ "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", - "enabled": "resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim'", + "enabled": "resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim' or resolveOrValue('draft_shield_enabled') or resolveOrValue('ooze_shield_enabled')", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -6228,7 +6228,7 @@ "infill_mesh_order": { "label": "Mesh Processing Rank", - "description": "Determines the priority of this mesh when considering multiple overlapping infill meshes. Areas where multiple infill meshes overlap will take on the settings of the mesh with the lowest rank. An infill mesh with a higher order will modify the infill of infill meshes with lower order and normal meshes.", + "description": "Determines the priority of this mesh when considering multiple overlapping infill meshes. Areas where multiple infill meshes overlap will take on the settings of the mesh with the highest rank. An infill mesh with a higher rank will modify the infill of infill meshes with lower rank and normal meshes.", "default_value": 0, "value": "1 if infill_mesh else 0", "minimum_value_warning": "1", diff --git a/resources/definitions/flyingbear_base.def.json b/resources/definitions/flyingbear_base.def.json index 9755bfb78d..84164c42f8 100644 --- a/resources/definitions/flyingbear_base.def.json +++ b/resources/definitions/flyingbear_base.def.json @@ -152,7 +152,7 @@ "machine_start_gcode": { "default_value": "M220 S100 ;Reset Feedrate\nM221 S100 ;Reset Flowrate\n\nG28 ;Home\n\n;Code for nozzle cleaning and flow normalization\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\nG1 X10.4 Y20 Z0.28 F5000.0\nG1 X10.4 Y170.0 Z0.28 F1500.0 E15\nG1 X10.1 Y170.0 Z0.28 F5000.0\nG1 X10.1 Y40 Z0.28 F1500.0 E30\n\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up" }, - "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract the filament\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG28 X0 Y0 ;Home X and Y\n\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z" }, + "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract the filament\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG28 X0 Y0 ;Home X and Y\n\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z" }, "machine_heated_bed": { "default_value": true }, "machine_shape": { "default_value": "rectangular" }, @@ -255,4 +255,4 @@ "adaptive_layer_height_variation": { "value": 0.04 }, "adaptive_layer_height_variation_step": { "value": 0.04 } } -} \ No newline at end of file +} diff --git a/resources/definitions/ideagen3D_sapphire_plus.def.json b/resources/definitions/ideagen3D_sapphire_plus.def.json new file mode 100644 index 0000000000..6a7e7d6bb0 --- /dev/null +++ b/resources/definitions/ideagen3D_sapphire_plus.def.json @@ -0,0 +1,34 @@ +{ + "version": 2, + "name": "ideagen3D Sapphire Plus", + "inherits": "fdmprinter", + "metadata": + { + "visible": true, + "author": "ideagen3D", + "manufacturer": "ideagen3D", + "file_formats": "text/x-gcode", + "platform": "ideagen3D_sapphire_plus.3mf", + "has_materials": true, + "has_machine_quality": false, + "machine_extruder_trains": { "0": "ideagen3D_sapphire_plus_0" } + }, + "overrides": + { + "machine_name": { "default_value": "ideagen3D Sapphire Plus" }, + "machine_heated_bed": { "default_value": true }, + "machine_width": { "default_value": 300 }, + "machine_depth": { "default_value": 300 }, + "machine_height": { "default_value": 350 }, + "machine_head_with_fans_polygon": { "default_value": [ + [-20, -10], + [-20, 10], + [10, -10], + [10, 10] + ] + }, + "machine_start_gcode": { "default_value": ";Start GCode by ideagen3D\n\nG1 Z15.0 F6000 ;Move the platform down 15mm\n\n;Initialize Temperature\nM140 S{material_bed_temperature_layer_0} ;heat bed and continue\nM104 S{material_print_temperature_layer_0} ;heat nozzle and continue\nM190 S{material_bed_temperature_layer_0} ;wait for bed temperature to reach inital layer temperature\nM109 S{material_print_temperature_layer_0} ;wait for hot end temperature to reach inital layer temperature\n\nG28 ;Home\n\n;Prime the extruder\nG92 E0\nG1 X1 Y280 Z0.2 ;Prepare to Purge\nG1 Y20 Z0.2 F1500.0 E15 ;Purge line\nG92 E0" }, + "machine_end_gcode": { "default_value": ";End GCode by ideagen3D\n\nM104 S0 ;Set nozzle temperature to 0\nM140 S0 ;Set Bed temperature to 0\n\nG92 E1 ;Prepare to retract filament\nG1 E-1 F300 ;Retract filament\nG28 X0 Y0 ;Home X and Y\nM84 ;Disable Steppers" }, + "gantry_height": { "value": 350 } + } +} \ No newline at end of file diff --git a/resources/definitions/lotmaxx_sc60.def.json b/resources/definitions/lotmaxx_sc60.def.json index abbf68d75a..a18e197757 100644 --- a/resources/definitions/lotmaxx_sc60.def.json +++ b/resources/definitions/lotmaxx_sc60.def.json @@ -20,7 +20,7 @@ "default_value":"G28 ;Home\nG92 E0 ;Reset Extruder\nG1 Z4.0 F3000 ;Move Z Axis up\nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\n" }, "machine_end_gcode":{ - "default_value":"G91 ;Relative positionning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" + "default_value":"G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, "acceleration_print":{"value":1000}, "acceleration_travel":{"value":1000}, diff --git a/resources/definitions/twotrees_bluer.def.json b/resources/definitions/twotrees_bluer.def.json index a272527e6e..8cf7d804cf 100644 --- a/resources/definitions/twotrees_bluer.def.json +++ b/resources/definitions/twotrees_bluer.def.json @@ -30,7 +30,7 @@ ] }, "machine_start_gcode": { "default_value": "; Two Trees Bluer Custom Start G-code\nG28 ;Home\nG92 E0 ;Reset Extruder\nG1 Z4.0 F3000 ;Move Z Axis up\nG1 E10 F1500 ;Purge a bit\nG1 X10.1 Y20 Z0.2 F5000.0 ;Move to start position\nG1 X10.1 Y200.0 Z0.2 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.2 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.2 F1500.0 E20 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z3.0 X20 Y20 F3000 ;Move Z Axis up\nG1 E3 F2700 ;Purge a bit" }, - "machine_end_gcode": { "default_value": "; Two Trees Bluer Custom End G-code\nG91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\nM84 X Y E ;Disable all steppers but Z" }, + "machine_end_gcode": { "default_value": "; Two Trees Bluer Custom End G-code\nG91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\nG1 X0 Y{machine_depth} ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\nM84 X Y E ;Disable all steppers but Z" }, "gantry_height": { "value": 25 } } } diff --git a/resources/extruders/ideagen3D_sapphire_plus_0.def.json b/resources/extruders/ideagen3D_sapphire_plus_0.def.json new file mode 100644 index 0000000000..ab14b131b6 --- /dev/null +++ b/resources/extruders/ideagen3D_sapphire_plus_0.def.json @@ -0,0 +1,15 @@ +{ + "version": 2, + "name": "Extruder 1", + "inherits": "fdmextruder", + "metadata": { + "machine": "ideagen3D_sapphire_plus", + "position": "0" + }, + + "overrides": { + "extruder_nr": { "default_value": 0 }, + "machine_nozzle_size": { "default_value": 0.4 }, + "material_diameter": { "default_value": 1.75 } + } +} \ No newline at end of file diff --git a/resources/meshes/ideagen3D_sapphire_plus.3mf b/resources/meshes/ideagen3D_sapphire_plus.3mf new file mode 100644 index 0000000000..3b5c41a3f3 Binary files /dev/null and b/resources/meshes/ideagen3D_sapphire_plus.3mf differ diff --git a/resources/qml/Widgets/CheckBox.qml b/resources/qml/Widgets/CheckBox.qml index 1de0e4addd..f79dc1620e 100644 --- a/resources/qml/Widgets/CheckBox.qml +++ b/resources/qml/Widgets/CheckBox.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2020 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -9,7 +9,7 @@ import Cura 1.1 as Cura // -// ComboBox with Cura styling. +// Checkbox with Cura styling. // CheckBox { diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 5a1ff16b95..d4c526e265 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -124,6 +124,7 @@ ComboBox contentItem: Label { + id: delegateLabel // FIXME: Somehow the top/bottom anchoring is not correct on Linux and it results in invisible texts. anchors.fill: parent anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width @@ -138,10 +139,15 @@ ComboBox verticalAlignment: Text.AlignVCenter } - background: Rectangle + background: UM.TooltipArea { - color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" + Rectangle + { + color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" + border.color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" + anchors.fill: parent + } + text: delegateLabel.truncated ? delegateItem.text : "" } } } diff --git a/resources/quality/anycubic_i3_mega/anycubic_i3_mega_draft.inst.cfg b/resources/quality/anycubic_i3_mega/anycubic_i3_mega_draft.inst.cfg index 27bf2ce7dd..60c4210209 100644 --- a/resources/quality/anycubic_i3_mega/anycubic_i3_mega_draft.inst.cfg +++ b/resources/quality/anycubic_i3_mega/anycubic_i3_mega_draft.inst.cfg @@ -17,8 +17,7 @@ acceleration_travel = 3000 adhesion_type = skirt brim_width = 4.0 cool_fan_full_at_height = 0.5 -cool_fan_speed = 100 -cool_fan_speed_0 = 100 +cool_fan_speed_max = 100 infill_overlap = 15 infill_pattern = zigzag infill_sparse_density = 25 @@ -28,10 +27,7 @@ jerk_print = 8 jerk_travel = 10 layer_height = 0.3 layer_height_0 = 0.3 -material_bed_temperature = 60 material_diameter = 1.75 -material_print_temperature = 200 -material_print_temperature_layer_0 = 0 retract_at_layer_change = False retraction_amount = 6 retraction_hop = 0.075 diff --git a/resources/quality/anycubic_i3_mega/anycubic_i3_mega_high.inst.cfg b/resources/quality/anycubic_i3_mega/anycubic_i3_mega_high.inst.cfg index 6005152107..209e2008d1 100644 --- a/resources/quality/anycubic_i3_mega/anycubic_i3_mega_high.inst.cfg +++ b/resources/quality/anycubic_i3_mega/anycubic_i3_mega_high.inst.cfg @@ -17,8 +17,7 @@ acceleration_travel = 3000 adhesion_type = skirt brim_width = 4.0 cool_fan_full_at_height = 0.5 -cool_fan_speed = 100 -cool_fan_speed_0 = 100 +cool_fan_speed_max = 100 infill_overlap = 15 infill_pattern = zigzag infill_sparse_density = 25 @@ -28,10 +27,7 @@ jerk_print = 8 jerk_travel = 10 layer_height = 0.1 layer_height_0 = 0.1 -material_bed_temperature = 60 material_diameter = 1.75 -material_print_temperature = 200 -material_print_temperature_layer_0 = 0 retract_at_layer_change = False retraction_amount = 6 retraction_hop = 0.075 diff --git a/resources/quality/anycubic_i3_mega/anycubic_i3_mega_normal.inst.cfg b/resources/quality/anycubic_i3_mega/anycubic_i3_mega_normal.inst.cfg index b2c0309dc9..e0e4d0743b 100644 --- a/resources/quality/anycubic_i3_mega/anycubic_i3_mega_normal.inst.cfg +++ b/resources/quality/anycubic_i3_mega/anycubic_i3_mega_normal.inst.cfg @@ -17,8 +17,7 @@ acceleration_travel = 3000 adhesion_type = skirt brim_width = 4.0 cool_fan_full_at_height = 0.5 -cool_fan_speed = 100 -cool_fan_speed_0 = 100 +cool_fan_speed_max = 100 infill_overlap = 15 infill_pattern = zigzag infill_sparse_density = 25 @@ -28,10 +27,7 @@ jerk_print = 8 jerk_travel = 10 layer_height = 0.2 layer_height_0 = 0.2 -material_bed_temperature = 60 material_diameter = 1.75 -material_print_temperature = 200 -material_print_temperature_layer_0 = 0 retract_at_layer_change = False retraction_amount = 6 retraction_hop = 0.075 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.25_Nylon_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.25_Nylon_Normal_Quality.inst.cfg index 08a27aa3b4..0cef0f11da 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.25_Nylon_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.25_Nylon_Normal_Quality.inst.cfg @@ -19,7 +19,7 @@ machine_nozzle_cool_down_speed = 0.9 machine_nozzle_heat_up_speed = 1.4 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 3) raft_jerk = =jerk_layer_0 raft_margin = 10 @@ -33,6 +33,5 @@ switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 wall_line_width_x = =wall_line_width -raft_airgap = 0.4 raft_surface_speed = 45 speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Draft_Print.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Draft_Print.inst.cfg index 9a8ed386c0..3ed16d3420 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Draft_Print.inst.cfg @@ -20,7 +20,7 @@ material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False skin_overlap = 20 speed_print = 60 -speed_layer_0 = =math.ceil(speed_print * 20 / 60) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 35 / 60) speed_wall = =math.ceil(speed_print * 45 / 60) speed_wall_0 = =math.ceil(speed_wall * 35 / 45) @@ -30,4 +30,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 50 / 60) raft_airgap = 0.15 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Fast_Print.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Fast_Print.inst.cfg index 615e8cc487..75619973a8 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Fast_Print.inst.cfg @@ -20,7 +20,7 @@ material_initial_print_temperature = =material_print_temperature - 15 material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False speed_print = 60 -speed_layer_0 = =math.ceil(speed_print * 20 / 60) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 30 / 60) speed_wall = =math.ceil(speed_print * 40 / 60) speed_wall_0 = =math.ceil(speed_wall * 30 / 40) @@ -29,4 +29,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 45 / 60) raft_airgap = 0.15 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_High_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_High_Quality.inst.cfg index 10149781cb..5edfda7541 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_High_Quality.inst.cfg @@ -20,7 +20,7 @@ material_initial_print_temperature = =material_print_temperature - 15 material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False speed_print = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 50) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 30 / 50) speed_wall = =math.ceil(speed_print * 30 / 50) @@ -28,4 +28,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 40 / 50) raft_airgap = 0.15 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Normal_Quality.inst.cfg index 137a316f14..6aba500231 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_ABS_Normal_Quality.inst.cfg @@ -19,7 +19,7 @@ material_initial_print_temperature = =material_print_temperature - 15 material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False speed_print = 55 -speed_layer_0 = =math.ceil(speed_print * 20 / 55) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 30 / 55) speed_wall = =math.ceil(speed_print * 30 / 55) @@ -27,4 +27,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 40 / 55) raft_airgap = 0.15 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Draft_Print.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Draft_Print.inst.cfg index f98d5c5d70..4949817547 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Draft_Print.inst.cfg @@ -23,13 +23,13 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 @@ -37,6 +37,4 @@ wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Fast_Print.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Fast_Print.inst.cfg index 9e4d40bcf3..026783cf17 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Fast_Print.inst.cfg @@ -23,13 +23,13 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 @@ -37,6 +37,4 @@ wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_High_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_High_Quality.inst.cfg index 755127b66f..f23ad38956 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_High_Quality.inst.cfg @@ -22,13 +22,13 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 @@ -36,6 +36,4 @@ wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Normal_Quality.inst.cfg index 26f0b52f91..b97c0b9ffe 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_Nylon_Normal_Quality.inst.cfg @@ -22,13 +22,13 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 @@ -36,6 +36,4 @@ wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Draft_Print.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Draft_Print.inst.cfg index c5613e0f49..81be2ebb6d 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Draft_Print.inst.cfg @@ -20,7 +20,7 @@ material_print_temperature = =default_material_print_temperature + 5 material_standby_temperature = 100 prime_tower_enable = False skin_overlap = 20 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 40 / 70) speed_wall = =math.ceil(speed_print * 55 / 70) speed_wall_0 = =math.ceil(speed_wall * 45 / 50) @@ -35,4 +35,3 @@ acceleration_wall = 2000 acceleration_wall_0 = 2000 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Fast_Print.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Fast_Print.inst.cfg index 17967f923c..e57fc51db1 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Fast_Print.inst.cfg @@ -19,7 +19,7 @@ machine_nozzle_heat_up_speed = 1.6 material_standby_temperature = 100 prime_tower_enable = False speed_print = 70 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 35 / 70) speed_wall = =math.ceil(speed_print * 45 / 70) speed_wall_0 = =math.ceil(speed_wall * 35 / 70) @@ -31,4 +31,3 @@ infill_line_width = =round(line_width * 0.42 / 0.35, 2) layer_height_0 = 0.2 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_High_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_High_Quality.inst.cfg index 1c271f6af1..5abeff6589 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_High_Quality.inst.cfg @@ -22,7 +22,7 @@ material_standby_temperature = 100 prime_tower_enable = False skin_overlap = 10 speed_print = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 50) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 35 / 50) speed_wall = =math.ceil(speed_print * 35 / 50) top_bottom_thickness = 1 @@ -33,4 +33,3 @@ infill_line_width = =round(line_width * 0.42 / 0.35, 2) layer_height_0 = 0.2 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Normal_Quality.inst.cfg index 0aae33c115..56ab049b3b 100644 --- a/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s3/um_s3_aa0.4_PLA_Normal_Quality.inst.cfg @@ -20,7 +20,7 @@ machine_nozzle_heat_up_speed = 1.6 material_standby_temperature = 100 prime_tower_enable = False skin_overlap = 10 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 top_bottom_thickness = 1 wall_thickness = 1 @@ -29,4 +29,3 @@ infill_line_width = =round(line_width * 0.42 / 0.35, 2) layer_height_0 = 0.2 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Draft_Print.inst.cfg index 193e6de18b..5689aaff8b 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Draft_Print.inst.cfg @@ -20,7 +20,7 @@ material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False skin_overlap = 20 speed_print = 60 -speed_layer_0 = =math.ceil(speed_print * 20 / 60) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 35 / 60) speed_wall = =math.ceil(speed_print * 45 / 60) speed_wall_0 = =math.ceil(speed_wall * 35 / 45) @@ -30,4 +30,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 50 / 60) raft_airgap = 0.15 -speed_layer_0 = 10 \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Fast_Print.inst.cfg index 1aae14fe6b..854858ee5b 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Fast_Print.inst.cfg @@ -20,7 +20,7 @@ material_initial_print_temperature = =material_print_temperature - 15 material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False speed_print = 60 -speed_layer_0 = =math.ceil(speed_print * 20 / 60) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 30 / 60) speed_wall = =math.ceil(speed_print * 40 / 60) speed_wall_0 = =math.ceil(speed_wall * 30 / 40) @@ -29,4 +29,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 45 / 60) raft_airgap = 0.15 -speed_layer_0 = 10 \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_High_Quality.inst.cfg index 1c57587309..bb75703f87 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_High_Quality.inst.cfg @@ -20,7 +20,7 @@ material_initial_print_temperature = =material_print_temperature - 15 material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False speed_print = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 50) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 30 / 50) speed_wall = =math.ceil(speed_print * 30 / 50) @@ -28,4 +28,3 @@ infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 40 / 50) raft_airgap = 0.15 -speed_layer_0 = 10 \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Normal_Quality.inst.cfg index ec2819cf93..4c850c4904 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_ABS_Normal_Quality.inst.cfg @@ -19,11 +19,10 @@ material_initial_print_temperature = =material_print_temperature - 15 material_final_print_temperature = =material_print_temperature - 20 prime_tower_enable = False speed_print = 55 -speed_layer_0 = =math.ceil(speed_print * 20 / 55) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 30 / 55) speed_wall = =math.ceil(speed_print * 30 / 55) infill_line_width = =round(line_width * 0.4 / 0.35, 2) speed_infill = =math.ceil(speed_print * 40 / 55) raft_airgap = 0.15 -speed_layer_0 = 10 \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Draft_Print.inst.cfg index 0f1f2c872b..bd42d349c5 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Draft_Print.inst.cfg @@ -23,19 +23,17 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Fast_Print.inst.cfg index d3e3e43830..9fe2328c88 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Fast_Print.inst.cfg @@ -23,19 +23,17 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_High_Quality.inst.cfg index 4a838d3b02..6bfd398d12 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_High_Quality.inst.cfg @@ -22,19 +22,17 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Normal_Quality.inst.cfg index 8c86a63b0b..7832217f95 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_Nylon_Normal_Quality.inst.cfg @@ -22,19 +22,17 @@ material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 ooze_shield_angle = 40 raft_acceleration = =acceleration_layer_0 -raft_airgap = =round(layer_height_0 * 0.85, 2) +raft_airgap = 0.4 raft_interface_thickness = =round(machine_nozzle_size * 0.3 / 0.4, 2) raft_jerk = =jerk_layer_0 raft_margin = 10 raft_surface_thickness = =round(machine_nozzle_size * 0.2 / 0.4, 2) skin_overlap = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 switch_extruder_prime_speed = 30 switch_extruder_retraction_amount = 30 switch_extruder_retraction_speeds = 40 wall_line_width_x = =wall_line_width jerk_travel = 50 -raft_airgap = 0.4 raft_surface_speed = 45 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Draft_Print.inst.cfg index 25235ba336..dd674e9a6b 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Draft_Print.inst.cfg @@ -21,7 +21,7 @@ material_standby_temperature = 100 prime_tower_enable = False skin_edge_support_thickness = =0.8 if infill_sparse_density < 30 else 0 skin_overlap = 20 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 40 / 70) speed_wall = =math.ceil(speed_print * 55 / 70) speed_wall_0 = =math.ceil(speed_wall * 45 / 50) @@ -35,4 +35,3 @@ layer_height_0 = 0.2 acceleration_wall = 2000 acceleration_wall_0 = 2000 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Fast_Print.inst.cfg index f9ed0bc62a..d743e3fc31 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Fast_Print.inst.cfg @@ -19,7 +19,7 @@ machine_nozzle_heat_up_speed = 1.6 material_standby_temperature = 100 prime_tower_enable = False speed_print = 70 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 35 / 70) speed_wall = =math.ceil(speed_print * 45 / 70) speed_wall_0 = =math.ceil(speed_wall * 35 / 70) @@ -30,4 +30,3 @@ jerk_travel = 50 infill_line_width = =round(line_width * 0.42 / 0.35, 2) layer_height_0 = 0.2 raft_airgap = 0.25 -speed_layer_0 = 10 \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_High_Quality.inst.cfg index 23042d0f23..4c69195362 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_High_Quality.inst.cfg @@ -22,7 +22,7 @@ material_standby_temperature = 100 prime_tower_enable = False skin_overlap = 10 speed_print = 50 -speed_layer_0 = =math.ceil(speed_print * 20 / 50) +speed_layer_0 = 10 speed_topbottom = =math.ceil(speed_print * 35 / 50) speed_wall = =math.ceil(speed_print * 35 / 50) top_bottom_thickness = 1 @@ -32,4 +32,3 @@ jerk_travel = 50 infill_line_width = =round(line_width * 0.42 / 0.35, 2) layer_height_0 = 0.2 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Normal_Quality.inst.cfg index c0414898af..462e2b37bd 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_PLA_Normal_Quality.inst.cfg @@ -20,7 +20,7 @@ machine_nozzle_heat_up_speed = 1.6 material_standby_temperature = 100 prime_tower_enable = False skin_overlap = 10 -speed_layer_0 = =math.ceil(speed_print * 20 / 70) +speed_layer_0 = 10 top_bottom_thickness = 1 wall_thickness = 1 @@ -28,4 +28,3 @@ jerk_travel = 50 infill_line_width = =round(line_width * 0.42 / 0.35, 2) layer_height_0 = 0.2 raft_airgap = 0.25 -speed_layer_0 = 10 diff --git a/tests/TestMachineManager.py b/tests/TestMachineManager.py index 788b8eee41..973a2d3d96 100644 --- a/tests/TestMachineManager.py +++ b/tests/TestMachineManager.py @@ -1,3 +1,4 @@ +import functools from unittest.mock import MagicMock, patch, PropertyMock import pytest @@ -10,6 +11,23 @@ def createMockedStack(stack_id: str, name: str): return stack +def getPropertyMocked(setting_key, setting_property, settings_dict): + """ + Mocks the getProperty function of containers so that it returns the setting values needed for a test. + + Use this function as follows: + container.getProperty = functools.partial(getPropertyMocked, settings_dict = {"print_sequence": "one_at_a_time"}) + + :param setting_key: The key of the setting to be returned (e.g. "print_sequence", "infill_sparse_density" etc) + :param setting_property: The setting property (usually "value") + :param settings_dict: All the settings and their values expected to be returned by this mocked function + :return: The mocked setting value specified by the settings_dict + """ + if setting_property == "value": + return settings_dict.get(setting_key) + return None + + @pytest.fixture() def global_stack(): return createMockedStack("GlobalStack", "Global Stack") @@ -255,3 +273,115 @@ def test_isActiveQualityNotSupported(machine_manager): def test_isActiveQualityNotSupported_noQualityGroup(machine_manager): machine_manager.activeQualityGroup = MagicMock(return_value=None) assert not machine_manager.isActiveQualitySupported + + +def test_correctPrintSequence_globalStackHasAllAtOnce(machine_manager, application): + + # Global container stack already has all_at_once + mocked_stack = application.getGlobalContainerStack() + mocked_global_settings = {"print_sequence": "all_at_once"} + mocked_stack.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_global_settings) + + mocked_user_changes_container = MagicMock(name="UserChangesContainer") + mocked_stack.userChanges = mocked_user_changes_container + + machine_manager.correctPrintSequence() + + # After the function is called, the user changes container should not have tried to change any properties + assert not mocked_user_changes_container.setProperty.called, "The Print Sequence should not be attempted to be changed when it is already 'all-at-once'" + + +def test_correctPrintSequence_OneEnabledExtruder(machine_manager, application): + # Global container stack reports print sequence as one_at_a_time + mocked_stack = application.getGlobalContainerStack() + mocked_global_settings = {"print_sequence": "one_at_a_time"} + mocked_stack.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_global_settings) + + # The definition changes container reports 1 enabled extruders, so the correctPrintSequence should not attempt to + # change the print sequence + mocked_definition_changes_container = MagicMock(name = "DefinitionChangesContainer") + mocked_definition_changes_settings = {"extruders_enabled_count": 1} + mocked_definition_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_definition_changes_settings) + mocked_stack.definitionChanges = mocked_definition_changes_container + + mocked_user_changes_container = MagicMock(name = "UserChangesContainer") + mocked_stack.userChanges = mocked_user_changes_container + + machine_manager.correctPrintSequence() + + # After the function is called, the user changes container should not have tried to change any properties + assert not mocked_user_changes_container.setProperty.called, "The Print Sequence should not be attempted to be changed when there is only one enabled extruder." + + +def test_correctPrintSequence_TwoExtrudersEnabled_printSequenceIsOneAtATimeInUserSettings(machine_manager, application): + # Global container stack reports print sequence as one_at_a_time + mocked_stack = application.getGlobalContainerStack() + mocked_global_settings = {"print_sequence": "one_at_a_time"} + mocked_stack.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_global_settings) + + # The definition changes container reports 2 enabled extruders. Also the print sequence change is not saved in the + # quality changes container. + mocked_definition_changes_container = MagicMock(name = "DefinitionChangesContainer") + mocked_definition_changes_settings = {"extruders_enabled_count": 2, "print_sequence": None} + mocked_definition_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_definition_changes_settings) + mocked_stack.definitionChanges = mocked_definition_changes_container + + # The user changes container reports print sequence as "one-at-a-time" + mocked_user_changes_container = MagicMock(name = "UserChangesContainer") + mocked_user_changes_settings = {"print_sequence": "one_at_a_time"} + mocked_user_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_user_changes_settings) + mocked_stack.userChanges = mocked_user_changes_container + + machine_manager.correctPrintSequence() + + # After the function is called, the user changes container should have tried to remove the print sequence from the + # user changes container + mocked_user_changes_container.removeInstance.assert_called_once_with("print_sequence") + + +def test_correctPrintSequence_TwoExtrudersEnabled_printSequenceIsOneAtATimeInDefinitionChangesSettings(machine_manager, application): + # Global container stack reports print sequence as one_at_a_time + mocked_stack = application.getGlobalContainerStack() + mocked_global_settings = {"print_sequence": "one_at_a_time"} + mocked_stack.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_global_settings) + + # The definition changes container reports 2 enabled extruders and contains the print_sequence change to "one-at-a-time" + mocked_definition_changes_container = MagicMock(name = "DefinitionChangesContainer") + mocked_definition_changes_settings = {"extruders_enabled_count": 2, "print_sequence": "one_at_a_time"} + mocked_definition_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_definition_changes_settings) + mocked_stack.definitionChanges = mocked_definition_changes_container + + # The user changes container doesn't contain print_sequence + mocked_user_changes_container = MagicMock(name = "UserChangesContainer") + mocked_user_changes_settings = {"print_sequence": None} + mocked_user_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_user_changes_settings) + mocked_stack.userChanges = mocked_user_changes_container + + machine_manager.correctPrintSequence() + + # After the function is called, the print sequence should be set to "all-at-once" in the user changes container + mocked_user_changes_container.setProperty.assert_called_once_with("print_sequence", "value", "all_at_once") + + +def test_correctPrintSequence_TwoExtrudersEnabled_printSequenceInUserAndDefinitionChangesSettingsIsNone(machine_manager, application): + # Global container stack reports print sequence as one_at_a_time + mocked_stack = application.getGlobalContainerStack() + mocked_global_settings = {"print_sequence": "one_at_a_time"} + mocked_stack.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_global_settings) + + # The definition changes container reports 2 enabled extruders but doesn't contain the print_sequence changes + mocked_definition_changes_container = MagicMock(name = "DefinitionChangesContainer") + mocked_definition_changes_settings = {"extruders_enabled_count": 2, "print_sequence": None} + mocked_definition_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_definition_changes_settings) + mocked_stack.definitionChanges = mocked_definition_changes_container + + # The user changes container doesn't contain the print_sequence changes + mocked_user_changes_container = MagicMock(name = "UserChangesContainer") + mocked_user_changes_settings = {"print_sequence": None} + mocked_user_changes_container.getProperty = functools.partial(getPropertyMocked, settings_dict=mocked_user_changes_settings) + mocked_stack.userChanges = mocked_user_changes_container + + machine_manager.correctPrintSequence() + + # After the function is called, the print sequence should be set to "all-at-once" in the user changes container + mocked_user_changes_container.setProperty.assert_called_once_with("print_sequence", "value", "all_at_once")