From 946bf033066e561827da4d00afbc3b680cd7e552 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 13 Aug 2024 15:56:01 +0200 Subject: [PATCH 01/37] Revert "Merge branch 'main' into 5.8" This reverts commit fec7637615fd05fb052848bb1cd569840d650ebd, reversing changes made to 081b9b543b564ac6c2a840916162a06b289c5d94. --- .github/ISSUE_TEMPLATE/SlicingCrash.yaml | 6 +- conandata.yml | 14 +-- cura/API/Interface/Settings.py | 62 +--------- cura/PrinterOutput/FormatMaps.py | 106 ------------------ .../Models/ExtruderConfigurationModel.py | 15 ++- .../Models/MaterialOutputModel.py | 30 ++++- .../NetworkedPrinterOutputDevice.py | 13 ++- plugins/3MFWriter/ThreeMFWriter.py | 16 ++- plugins/CuraEngineBackend/StartSliceJob.py | 7 +- plugins/MakerbotWriter/MakerbotWriter.py | 27 +---- plugins/UFPWriter/UFPWriter.py | 58 +++++++++- .../XmlMaterialProfile/XmlMaterialProfile.py | 30 ++++- .../XmlMaterialProfile}/product_to_id.json | 0 .../definitions/Mark2_for_Ultimaker2.def.json | 1 + resources/definitions/atom3.def.json | 1 + resources/definitions/creality_crm4.def.json | 18 --- resources/definitions/diy220.def.json | 1 + resources/definitions/dxu.def.json | 1 + resources/definitions/erzay3d.def.json | 1 + resources/definitions/fdmextruder.def.json | 11 -- resources/definitions/fdmprinter.def.json | 54 ++------- resources/definitions/maker_starter.def.json | 1 + resources/definitions/mendel90.def.json | 1 + ...tur3d_discov3ry1_complete_um2plus.def.json | 1 + resources/definitions/tam.def.json | 1 + resources/definitions/ultimaker2.def.json | 1 + .../definitions/ultimaker2_plus.def.json | 1 + .../ultimaker2_plus_connect.def.json | 1 + resources/extruders/Mark2_extruder1.def.json | 1 - resources/extruders/Mark2_extruder2.def.json | 1 - resources/extruders/atom3_extruder_0.def.json | 1 - .../extruders/diy220_extruder_0.def.json | 1 - resources/extruders/dxu_extruder1.def.json | 1 - resources/extruders/dxu_extruder2.def.json | 1 - .../extruders/erzay3d_extruder_0.def.json | 1 - .../maker_starter_extruder_0.def.json | 1 - .../extruders/mendel90_extruder_0.def.json | 1 - ...v3ry1_complete_um2plus_extruder_0.def.json | 1 - resources/extruders/tam_extruder_0.def.json | 1 - .../extruders/ultimaker2_extruder_0.def.json | 1 - ...ltimaker2_plus_connect_extruder_0.def.json | 1 - .../ultimaker2_plus_extruder_0.def.json | 1 - resources/i18n/cura.pot | 4 +- 43 files changed, 171 insertions(+), 326 deletions(-) delete mode 100644 cura/PrinterOutput/FormatMaps.py rename {resources/texts => plugins/XmlMaterialProfile}/product_to_id.json (100%) delete mode 100644 resources/definitions/creality_crm4.def.json diff --git a/.github/ISSUE_TEMPLATE/SlicingCrash.yaml b/.github/ISSUE_TEMPLATE/SlicingCrash.yaml index 06025886a2..0d93977627 100644 --- a/.github/ISSUE_TEMPLATE/SlicingCrash.yaml +++ b/.github/ISSUE_TEMPLATE/SlicingCrash.yaml @@ -6,9 +6,9 @@ body: attributes: value: | ### ✨Try our improved Cura 5.7✨ - Before filling out the report below, we want you to try the latest Cura 5.7. + Before filling out the report below, we want you to try the latest Cura 5.7 Beta. This version of Cura has become significantly more reliable and has an updated slicing engine that will automatically send a report to the Cura Team for analysis. - #### [You can find the downloads here](https://github.com/Ultimaker/Cura/releases/latest) #### + #### [You can find the downloads here](https://github.com/Ultimaker/Cura/releases/tag/5.7.0-beta.1) #### If you still encounter a crash you are still welcome to report the issue so we can use your model as a test case, you can find instructions on how to do that below. ### Project File @@ -35,7 +35,7 @@ body: - type: markdown attributes: value: | - We work hard on improving our slicing crashes. Our most recent release is 5.7.1. + We work hard on improving our slicing crashes. Our most recent release is 5.6.0. If you are not on the latest version of Cura, [you can download it here](https://github.com/Ultimaker/Cura/releases/latest) - type: input attributes: diff --git a/conandata.yml b/conandata.yml index 0640813146..83bfd935a0 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,17 +1,17 @@ -version: "5.9.0-alpha.0" +version: "5.8.0" requirements: - - "cura_resources/(latest)@ultimaker/testing" - - "uranium/(latest)@ultimaker/testing" - - "curaengine/(latest)@ultimaker/testing" - - "cura_binary_data/(latest)@ultimaker/testing" - - "fdm_materials/(latest)@ultimaker/testing" + - "cura_resources/5.8.0" + - "uranium/5.8.0" + - "curaengine/5.8.0" + - "cura_binary_data/5.8.0" + - "fdm_materials/5.8.0" - "curaengine_plugin_gradual_flow/0.1.0-beta.4" - "dulcificum/0.2.1" - "pysavitar/5.3.0" - "pynest2d/5.3.0" - "native_cad_plugin/2.0.0" requirements_internal: - - "fdm_materials/(latest)@internal/testing" + - "fdm_materials/5.8.0" - "cura_private_data/(latest)@internal/testing" urls: default: diff --git a/cura/API/Interface/Settings.py b/cura/API/Interface/Settings.py index 084023b9bd..706a6d8c74 100644 --- a/cura/API/Interface/Settings.py +++ b/cura/API/Interface/Settings.py @@ -1,13 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from dataclasses import asdict - -from typing import cast, Dict, TYPE_CHECKING - -from UM.Settings.InstanceContainer import InstanceContainer -from UM.Settings.SettingFunction import SettingFunction -from cura.Settings.GlobalStack import GlobalStack +from typing import TYPE_CHECKING if TYPE_CHECKING: from cura.CuraApplication import CuraApplication @@ -53,57 +47,3 @@ class Settings: """ return self.application.getSidebarCustomMenuItems() - - def getSliceMetadata(self) -> Dict[str, Dict[str, Dict[str, str]]]: - """Get all changed settings and all settings. For each extruder and the global stack""" - print_information = self.application.getPrintInformation() - machine_manager = self.application.getMachineManager() - settings = { - "material": { - "length": print_information.materialLengths, - "weight": print_information.materialWeights, - "cost": print_information.materialCosts, - }, - "global": { - "changes": {}, - "all_settings": {}, - }, - "quality": asdict(machine_manager.activeQualityDisplayNameMap()), - } - - def _retrieveValue(container: InstanceContainer, setting_: str): - value_ = container.getProperty(setting_, "value") - for _ in range(0, 1024): # Prevent possibly endless loop by not using a limit. - if not isinstance(value_, SettingFunction): - return value_ # Success! - value_ = value_(container) - return 0 # Fallback value after breaking possibly endless loop. - - global_stack = cast(GlobalStack, self.application.getGlobalContainerStack()) - - # Add global user or quality changes - global_flattened_changes = InstanceContainer.createMergedInstanceContainer(global_stack.userChanges, global_stack.qualityChanges) - for setting in global_flattened_changes.getAllKeys(): - settings["global"]["changes"][setting] = _retrieveValue(global_flattened_changes, setting) - - # Get global all settings values without user or quality changes - for setting in global_stack.getAllKeys(): - settings["global"]["all_settings"][setting] = _retrieveValue(global_stack, setting) - - for i, extruder in enumerate(global_stack.extruderList): - # Add extruder fields to settings dictionary - settings[f"extruder_{i}"] = { - "changes": {}, - "all_settings": {}, - } - - # Add extruder user or quality changes - extruder_flattened_changes = InstanceContainer.createMergedInstanceContainer(extruder.userChanges, extruder.qualityChanges) - for setting in extruder_flattened_changes.getAllKeys(): - settings[f"extruder_{i}"]["changes"][setting] = _retrieveValue(extruder_flattened_changes, setting) - - # Get extruder all settings values without user or quality changes - for setting in extruder.getAllKeys(): - settings[f"extruder_{i}"]["all_settings"][setting] = _retrieveValue(extruder, setting) - - return settings diff --git a/cura/PrinterOutput/FormatMaps.py b/cura/PrinterOutput/FormatMaps.py deleted file mode 100644 index b8ad4df2a2..0000000000 --- a/cura/PrinterOutput/FormatMaps.py +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright (c) 2024 UltiMaker -# Cura is released under the terms of the LGPLv3 or higher. - -from UM.Resources import Resources - -import json -from typing import Dict, List, Optional - -class FormatMaps: - - # A map from the printer-type in their native file-formats to the internal name we use. - PRINTER_TYPE_NAME = { - "fire_e": "ultimaker_method", - "lava_f": "ultimaker_methodx", - "magma_10": "ultimaker_methodxl", - "sketch": "ultimaker_sketch" - } - - # A map from the extruder-name in their native file-formats to the internal name we use. - EXTRUDER_NAME_MAP = { - "mk14_hot": "1XA", - "mk14_hot_s": "2XA", - "mk14_c": "1C", - "mk14": "1A", - "mk14_s": "2A", - "mk14_e": "LABS" - } - - # A map from the material-name in their native file-formats to some info, including the internal name we use. - MATERIAL_MAP = { - "abs": {"name": "ABS", "guid": "2780b345-577b-4a24-a2c5-12e6aad3e690"}, - "abs-cf10": {"name": "ABS-CF", "guid": "495a0ce5-9daf-4a16-b7b2-06856d82394d"}, - "abs-wss1": {"name": "ABS-R", "guid": "88c8919c-6a09-471a-b7b6-e801263d862d"}, - "asa": {"name": "ASA", "guid": "f79bc612-21eb-482e-ad6c-87d75bdde066"}, - "nylon12-cf": {"name": "Nylon 12 CF", "guid": "3c6f2877-71cc-4760-84e6-4b89ab243e3b"}, - "nylon": {"name": "Nylon", "guid": "283d439a-3490-4481-920c-c51d8cdecf9c"}, - "pc": {"name": "PC", "guid": "62414577-94d1-490d-b1e4-7ef3ec40db02"}, - "petg": {"name": "PETG", "guid": "69386c85-5b6c-421a-bec5-aeb1fb33f060"}, - "pla": {"name": "PLA", "guid": "abb9c58e-1f56-48d1-bd8f-055fde3a5b56"}, - "pva": {"name": "PVA", "guid": "add51ef2-86eb-4c39-afd5-5586564f0715"}, - "wss1": {"name": "RapidRinse", "guid": "a140ef8f-4f26-4e73-abe0-cfc29d6d1024"}, - "sr30": {"name": "SR-30", "guid": "77873465-83a9-4283-bc44-4e542b8eb3eb"}, - "bvoh": {"name": "BVOH", "guid": "923e604c-8432-4b09-96aa-9bbbd42207f4"}, - "cpe": {"name": "CPE", "guid": "da1872c1-b991-4795-80ad-bdac0f131726"}, - "hips": {"name": "HIPS", "guid": "a468d86a-220c-47eb-99a5-bbb47e514eb0"}, - "tpu": {"name": "TPU 95A", "guid": "19baa6a9-94ff-478b-b4a1-8157b74358d2"}, - "im-pla": {"name": "Tough", "guid": "de031137-a8ca-4a72-bd1b-17bb964033ad"} - } - - __inverse_printer_name: Optional[Dict[str, str]] = None - __inverse_extruder_type: Optional[Dict[str, str]] = None - __inverse_material_map: Optional[Dict[str, str]] = None - __product_to_id_map: Optional[Dict[str, List[str]]] = None - - @classmethod - def getInversePrinterNameMap(cls) -> Dict[str, str]: - """Returns the inverse of the printer name map, that is, from the internal name to the name used in output.""" - if cls.__inverse_printer_name is not None: - return cls.__inverse_printer_name - cls.__inverse_printer_name = {} - for key, value in cls.PRINTER_TYPE_NAME.items(): - cls.__inverse_printer_name[value] = key - return cls.__inverse_printer_name - - @classmethod - def getInverseExtruderTypeMap(cls) -> Dict[str, str]: - """Returns the inverse of the extruder type map, that is, from the internal name to the name used in output.""" - if cls.__inverse_extruder_type is not None: - return cls.__inverse_extruder_type - cls.__inverse_extruder_type = {} - for key, value in cls.EXTRUDER_NAME_MAP.items(): - cls.__inverse_extruder_type[value] = key - return cls.__inverse_extruder_type - - @classmethod - def getInverseMaterialMap(cls) -> Dict[str, str]: - """Returns the inverse of the material map, that is, from the internal name to the name used in output. - - Note that this drops the extra info saved in the non-inverse material map, use that if you need it. - """ - if cls.__inverse_material_map is not None: - return cls.__inverse_material_map - cls.__inverse_material_map = {} - for key, value in cls.MATERIAL_MAP.items(): - cls.__inverse_material_map[value["name"]] = key - return cls.__inverse_material_map - - @classmethod - def getProductIdMap(cls) -> Dict[str, List[str]]: - """Gets a mapping from product names (for example, in the XML files) to their definition IDs. - - This loads the mapping from a file. - """ - if cls.__product_to_id_map is not None: - return cls.__product_to_id_map - - product_to_id_file = Resources.getPath(Resources.Texts, "product_to_id.json") - with open(product_to_id_file, encoding = "utf-8") as f: - contents = "" - for line in f: - contents += line if "#" not in line else "".join([line.replace("#", str(n)) for n in range(1, 12)]) - cls.__product_to_id_map = json.loads(contents) - cls.__product_to_id_map = {key: [value] for key, value in cls.__product_to_id_map.items()} - #This also loads "Ultimaker S5" -> "ultimaker_s5" even though that is not strictly necessary with the default to change spaces into underscores. - #However it is not always loaded with that default; this mapping is also used in serialize() without that default. - return cls.__product_to_id_map diff --git a/cura/PrinterOutput/Models/ExtruderConfigurationModel.py b/cura/PrinterOutput/Models/ExtruderConfigurationModel.py index c5c480e224..ac924c684e 100644 --- a/cura/PrinterOutput/Models/ExtruderConfigurationModel.py +++ b/cura/PrinterOutput/Models/ExtruderConfigurationModel.py @@ -1,10 +1,9 @@ -# Copyright (c) 2024 UltiMaker +# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from PyQt6.QtCore import pyqtProperty, QObject, pyqtSignal -from cura.PrinterOutput.FormatMaps import FormatMaps from .MaterialOutputModel import MaterialOutputModel @@ -46,8 +45,16 @@ class ExtruderConfigurationModel(QObject): @staticmethod def applyNameMappingHotend(hotendId) -> str: - if hotendId in FormatMaps.EXTRUDER_NAME_MAP: - return FormatMaps.EXTRUDER_NAME_MAP[hotendId] + _EXTRUDER_NAME_MAP = { + "mk14_hot":"1XA", + "mk14_hot_s":"2XA", + "mk14_c":"1C", + "mk14":"1A", + "mk14_s":"2A", + "mk14_e": "LABS" + } + if hotendId in _EXTRUDER_NAME_MAP: + return _EXTRUDER_NAME_MAP[hotendId] return hotendId @pyqtProperty(str, fset = setHotendID, notify = extruderConfigurationChanged) diff --git a/cura/PrinterOutput/Models/MaterialOutputModel.py b/cura/PrinterOutput/Models/MaterialOutputModel.py index 8790d1626e..854226c6d4 100644 --- a/cura/PrinterOutput/Models/MaterialOutputModel.py +++ b/cura/PrinterOutput/Models/MaterialOutputModel.py @@ -1,10 +1,9 @@ -# Copyright (c) 2024 UltiMaker +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from PyQt6.QtCore import pyqtProperty, QObject -from cura.PrinterOutput.FormatMaps import FormatMaps class MaterialOutputModel(QObject): @@ -24,9 +23,30 @@ class MaterialOutputModel(QObject): @staticmethod def getMaterialFromDefinition(guid, type, brand, name): - if guid is None and brand != "empty" and type in FormatMaps.MATERIAL_MAP: - name = FormatMaps.MATERIAL_MAP[type]["name"] - guid = FormatMaps.MATERIAL_MAP[type]["guid"] + + _MATERIAL_MAP = { "abs" :{"name" :"ABS" ,"guid": "2780b345-577b-4a24-a2c5-12e6aad3e690"}, + "abs-cf10" :{"name": "ABS-CF" ,"guid": "495a0ce5-9daf-4a16-b7b2-06856d82394d"}, + "abs-wss1" :{"name" :"ABS-R" ,"guid": "88c8919c-6a09-471a-b7b6-e801263d862d"}, + "asa" :{"name" :"ASA" ,"guid": "f79bc612-21eb-482e-ad6c-87d75bdde066"}, + "nylon12-cf":{"name": "Nylon 12 CF" ,"guid": "3c6f2877-71cc-4760-84e6-4b89ab243e3b"}, + "nylon" :{"name" :"Nylon" ,"guid": "283d439a-3490-4481-920c-c51d8cdecf9c"}, + "pc" :{"name" :"PC" ,"guid": "62414577-94d1-490d-b1e4-7ef3ec40db02"}, + "petg" :{"name" :"PETG" ,"guid": "69386c85-5b6c-421a-bec5-aeb1fb33f060"}, + "pla" :{"name" :"PLA" ,"guid": "abb9c58e-1f56-48d1-bd8f-055fde3a5b56"}, + "pva" :{"name" :"PVA" ,"guid": "add51ef2-86eb-4c39-afd5-5586564f0715"}, + "wss1" :{"name" :"RapidRinse" ,"guid": "a140ef8f-4f26-4e73-abe0-cfc29d6d1024"}, + "sr30" :{"name" :"SR-30" ,"guid": "77873465-83a9-4283-bc44-4e542b8eb3eb"}, + "bvoh" :{"name" :"BVOH" ,"guid": "923e604c-8432-4b09-96aa-9bbbd42207f4"}, + "cpe" :{"name" :"CPE" ,"guid": "da1872c1-b991-4795-80ad-bdac0f131726"}, + "hips" :{"name" :"HIPS" ,"guid": "a468d86a-220c-47eb-99a5-bbb47e514eb0"}, + "tpu" :{"name" :"TPU 95A" ,"guid": "19baa6a9-94ff-478b-b4a1-8157b74358d2"}, + "im-pla" :{"name": "Tough" ,"guid": "de031137-a8ca-4a72-bd1b-17bb964033ad"} + } + + + if guid is None and brand != "empty" and type in _MATERIAL_MAP: + name = _MATERIAL_MAP[type]["name"] + guid = _MATERIAL_MAP[type]["guid"] return name, guid diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index 3dc245d468..2a683966db 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 UltiMaker +# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from UM.FileHandler.FileHandler import FileHandler #For typing. @@ -6,7 +6,6 @@ from UM.Logger import Logger from UM.Scene.SceneNode import SceneNode #For typing. from cura.API import Account from cura.CuraApplication import CuraApplication -from cura.PrinterOutput.FormatMaps import FormatMaps from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState, ConnectionType @@ -420,8 +419,14 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): @staticmethod def applyPrinterTypeMapping(printer_type): - if printer_type in FormatMaps.PRINTER_TYPE_NAME: - return FormatMaps.PRINTER_TYPE_NAME[printer_type] + _PRINTER_TYPE_NAME = { + "fire_e": "ultimaker_method", + "lava_f": "ultimaker_methodx", + "magma_10": "ultimaker_methodxl", + "sketch": "ultimaker_sketch" + } + if printer_type in _PRINTER_TYPE_NAME: + return _PRINTER_TYPE_NAME[printer_type] return printer_type @pyqtProperty(str, constant = True) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index a3eb43ca32..5a9fa487fc 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -114,24 +114,22 @@ class ThreeMFWriter(MeshWriter): mesh_data = um_node.getMeshData() - node_matrix = um_node.getLocalTransformation() - node_matrix.preMultiply(transformation) - if center_mesh: - center_matrix = Matrix() + node_matrix = Matrix() # compensate for original center position, if object(s) is/are not around its zero position if mesh_data is not None: extents = mesh_data.getExtents() if extents is not None: # We use a different coordinate space while writing, so flip Z and Y - center_vector = Vector(-extents.center.x, -extents.center.y, -extents.center.z) - center_matrix.setByTranslation(center_vector) - node_matrix.preMultiply(center_matrix) + center_vector = Vector(extents.center.x, extents.center.y, extents.center.z) + node_matrix.setByTranslation(center_vector) + node_matrix.multiply(um_node.getLocalTransformation()) + else: + node_matrix = um_node.getLocalTransformation() - matrix_string = ThreeMFWriter._convertMatrixToString(node_matrix) + matrix_string = ThreeMFWriter._convertMatrixToString(node_matrix.preMultiply(transformation)) savitar_node.setTransformation(matrix_string) - if mesh_data is not None: savitar_node.getMeshData().setVerticesFromBytes(mesh_data.getVerticesAsByteArray()) indices_array = mesh_data.getIndicesAsByteArray() diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 6da0edb2a7..3da0a68c95 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -366,12 +366,7 @@ class StartSliceJob(Job): for extruder_stack in global_stack.extruderList: self._buildExtruderMessage(extruder_stack) - backend_plugins = CuraApplication.getInstance().getBackendPlugins() - - # Sort backend plugins by name. Not a very good strategy, but at least it is repeatable. This will be improved later. - backend_plugins = sorted(backend_plugins, key=lambda backend_plugin: backend_plugin.getId()) - - for plugin in backend_plugins: + for plugin in CuraApplication.getInstance().getBackendPlugins(): if not plugin.usePlugin(): continue for slot in plugin.getSupportedSlots(): diff --git a/plugins/MakerbotWriter/MakerbotWriter.py b/plugins/MakerbotWriter/MakerbotWriter.py index 34ef562fd3..43595bbf24 100644 --- a/plugins/MakerbotWriter/MakerbotWriter.py +++ b/plugins/MakerbotWriter/MakerbotWriter.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 UltiMaker +# Copyright (c) 2023 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. from io import StringIO, BufferedIOBase import json @@ -18,7 +18,6 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.i18n import i18nCatalog from cura.CuraApplication import CuraApplication -from cura.PrinterOutput.FormatMaps import FormatMaps from cura.Snapshot import Snapshot from cura.Utils.Threading import call_on_qt_thread from cura.CuraVersion import ConanInstalls @@ -138,30 +137,6 @@ class MakerbotWriter(MeshWriter): for png_file in png_files: file, data = png_file["file"], png_file["data"] zip_stream.writestr(file, data) - api = CuraApplication.getInstance().getCuraAPI() - metadata_json = api.interface.settings.getSliceMetadata() - - # All the mapping stuff we have to do: - product_to_id_map = FormatMaps.getProductIdMap() - printer_name_map = FormatMaps.getInversePrinterNameMap() - extruder_type_map = FormatMaps.getInverseExtruderTypeMap() - material_map = FormatMaps.getInverseMaterialMap() - for key, value in metadata_json.items(): - if "all_settings" in value: - if "machine_name" in value["all_settings"]: - machine_name = value["all_settings"]["machine_name"] - if machine_name in product_to_id_map: - machine_name = product_to_id_map[machine_name][0] - value["all_settings"]["machine_name"] = printer_name_map.get(machine_name, machine_name) - if "machine_nozzle_id" in value["all_settings"]: - extruder_type = value["all_settings"]["machine_nozzle_id"] - value["all_settings"]["machine_nozzle_id"] = extruder_type_map.get(extruder_type, extruder_type) - if "material_type" in value["all_settings"]: - material_type = value["all_settings"]["material_type"] - value["all_settings"]["material_type"] = material_map.get(material_type, material_type) - - slice_metadata = json.dumps(metadata_json, separators=(", ", ": "), indent=4) - zip_stream.writestr("slicemetadata.json", slice_metadata) except (IOError, OSError, BadZipFile) as ex: Logger.log("e", f"Could not write to (.makerbot) file because: '{ex}'.") self.setInformation(catalog.i18nc("@error", "MakerbotWriter could not save to the designated path.")) diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py index 0cf756b6a4..475e5fc01a 100644 --- a/plugins/UFPWriter/UFPWriter.py +++ b/plugins/UFPWriter/UFPWriter.py @@ -24,7 +24,6 @@ from UM.Settings.InstanceContainer import InstanceContainer from cura.CuraApplication import CuraApplication from cura.Settings.GlobalStack import GlobalStack from cura.Utils.Threading import call_on_qt_thread -from cura.API import CuraAPI from UM.i18n import i18nCatalog @@ -86,8 +85,7 @@ class UFPWriter(MeshWriter): try: archive.addContentType(extension="json", mime_type="application/json") setting_textio = StringIO() - api = CuraApplication.getInstance().getCuraAPI() - json.dump(api.interface.settings.getSliceMetadata(), setting_textio, separators=(", ", ": "), indent=4) + json.dump(self._getSliceMetadata(), setting_textio, separators=(", ", ": "), indent=4) steam = archive.getStream(SLICE_METADATA_PATH) steam.write(setting_textio.getvalue().encode("UTF-8")) except EnvironmentError as e: @@ -212,3 +210,57 @@ class UFPWriter(MeshWriter): return [{"name": item.getName()} for item in DepthFirstIterator(node) if item.getMeshData() is not None and not item.callDecoration("isNonPrintingMesh")] + + def _getSliceMetadata(self) -> Dict[str, Dict[str, Dict[str, str]]]: + """Get all changed settings and all settings. For each extruder and the global stack""" + print_information = CuraApplication.getInstance().getPrintInformation() + machine_manager = CuraApplication.getInstance().getMachineManager() + settings = { + "material": { + "length": print_information.materialLengths, + "weight": print_information.materialWeights, + "cost": print_information.materialCosts, + }, + "global": { + "changes": {}, + "all_settings": {}, + }, + "quality": asdict(machine_manager.activeQualityDisplayNameMap()), + } + + def _retrieveValue(container: InstanceContainer, setting_: str): + value_ = container.getProperty(setting_, "value") + for _ in range(0, 1024): # Prevent possibly endless loop by not using a limit. + if not isinstance(value_, SettingFunction): + return value_ # Success! + value_ = value_(container) + return 0 # Fallback value after breaking possibly endless loop. + + global_stack = cast(GlobalStack, Application.getInstance().getGlobalContainerStack()) + + # Add global user or quality changes + global_flattened_changes = InstanceContainer.createMergedInstanceContainer(global_stack.userChanges, global_stack.qualityChanges) + for setting in global_flattened_changes.getAllKeys(): + settings["global"]["changes"][setting] = _retrieveValue(global_flattened_changes, setting) + + # Get global all settings values without user or quality changes + for setting in global_stack.getAllKeys(): + settings["global"]["all_settings"][setting] = _retrieveValue(global_stack, setting) + + for i, extruder in enumerate(global_stack.extruderList): + # Add extruder fields to settings dictionary + settings[f"extruder_{i}"] = { + "changes": {}, + "all_settings": {}, + } + + # Add extruder user or quality changes + extruder_flattened_changes = InstanceContainer.createMergedInstanceContainer(extruder.userChanges, extruder.qualityChanges) + for setting in extruder_flattened_changes.getAllKeys(): + settings[f"extruder_{i}"]["changes"][setting] = _retrieveValue(extruder_flattened_changes, setting) + + # Get extruder all settings values without user or quality changes + for setting in extruder.getAllKeys(): + settings[f"extruder_{i}"]["all_settings"][setting] = _retrieveValue(extruder, setting) + + return settings diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 49b5e7661d..980288e3c9 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -17,7 +17,6 @@ from UM.Settings.ContainerRegistry import ContainerRegistry from UM.ConfigurationErrorMessage import ConfigurationErrorMessage from cura.CuraApplication import CuraApplication -from cura.PrinterOutput.FormatMaps import FormatMaps from cura.Machines.VariantType import VariantType try: @@ -250,7 +249,7 @@ class XmlMaterialProfile(InstanceContainer): machine_variant_map[definition_id][variant_name] = variant_dict # Map machine human-readable names to IDs - product_id_map = FormatMaps.getProductIdMap() + product_id_map = self.getProductIdMap() for definition_id, container in machine_container_map.items(): definition_id = container.getMetaDataEntry("definition") @@ -648,7 +647,7 @@ class XmlMaterialProfile(InstanceContainer): self._dirty = False # Map machine human-readable names to IDs - product_id_map = FormatMaps.getProductIdMap() + product_id_map = self.getProductIdMap() machines = data.iterfind("./um:settings/um:machine", self.__namespaces) for machine in machines: @@ -924,7 +923,7 @@ class XmlMaterialProfile(InstanceContainer): result_metadata.append(base_metadata) # Map machine human-readable names to IDs - product_id_map = FormatMaps.getProductIdMap() + product_id_map = cls.getProductIdMap() for machine in data.iterfind("./um:settings/um:machine", cls.__namespaces): machine_compatibility = common_compatibility @@ -1129,6 +1128,29 @@ class XmlMaterialProfile(InstanceContainer): id_list = list(id_list) return id_list + __product_to_id_map: Optional[Dict[str, List[str]]] = None + + @classmethod + def getProductIdMap(cls) -> Dict[str, List[str]]: + """Gets a mapping from product names in the XML files to their definition IDs. + + This loads the mapping from a file. + """ + if cls.__product_to_id_map is not None: + return cls.__product_to_id_map + + plugin_path = cast(str, PluginRegistry.getInstance().getPluginPath("XmlMaterialProfile")) + product_to_id_file = os.path.join(plugin_path, "product_to_id.json") + with open(product_to_id_file, encoding = "utf-8") as f: + contents = "" + for line in f: + contents += line if "#" not in line else "".join([line.replace("#", str(n)) for n in range(1, 12)]) + cls.__product_to_id_map = json.loads(contents) + cls.__product_to_id_map = {key: [value] for key, value in cls.__product_to_id_map.items()} + #This also loads "Ultimaker S5" -> "ultimaker_s5" even though that is not strictly necessary with the default to change spaces into underscores. + #However it is not always loaded with that default; this mapping is also used in serialize() without that default. + return cls.__product_to_id_map + @staticmethod def _parseCompatibleValue(value: str): """Parse the value of the "material compatible" property.""" diff --git a/resources/texts/product_to_id.json b/plugins/XmlMaterialProfile/product_to_id.json similarity index 100% rename from resources/texts/product_to_id.json rename to plugins/XmlMaterialProfile/product_to_id.json diff --git a/resources/definitions/Mark2_for_Ultimaker2.def.json b/resources/definitions/Mark2_for_Ultimaker2.def.json index dab45dd80c..789d5d42ec 100644 --- a/resources/definitions/Mark2_for_Ultimaker2.def.json +++ b/resources/definitions/Mark2_for_Ultimaker2.def.json @@ -130,6 +130,7 @@ "machine_min_cool_heat_time_window": { "default_value": 15.0 }, "machine_name": { "default_value": "Mark2_for_Ultimaker2" }, "machine_nozzle_cool_down_speed": { "default_value": 1.5 }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_heat_up_speed": { "default_value": 3.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "machine_show_variants": { "default_value": true }, diff --git a/resources/definitions/atom3.def.json b/resources/definitions/atom3.def.json index 6fab25a96d..c9b54d2f89 100644 --- a/resources/definitions/atom3.def.json +++ b/resources/definitions/atom3.def.json @@ -65,6 +65,7 @@ "machine_heated_bed": { "default_value": true }, "machine_height": { "default_value": 340 }, "machine_name": { "default_value": "Atom 3" }, + "machine_nozzle_head_distance": { "default_value": 6 }, "machine_shape": { "default_value": "elliptic" }, "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "default_value": ";MACHINE START CODE\nG21 ;metric values\nG90 ;absolute positioning\nG28 ;home\nG1 Z5 F9000\n;MACHINE START CODE" }, diff --git a/resources/definitions/creality_crm4.def.json b/resources/definitions/creality_crm4.def.json deleted file mode 100644 index 89ab3ed04c..0000000000 --- a/resources/definitions/creality_crm4.def.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 2, - "name": "Creality CR-M4", - "inherits": "creality_base", - "metadata": - { - "visible": true, - "quality_definition": "creality_base" - }, - "overrides": - { - "gantry_height": { "value": 35 }, - "machine_depth": { "default_value": 450 }, - "machine_height": { "default_value": 470 }, - "machine_name": { "default_value": "Creality CR-M4" }, - "machine_width": { "default_value": 450 } - } -} \ No newline at end of file diff --git a/resources/definitions/diy220.def.json b/resources/definitions/diy220.def.json index ea3e89ab04..f4c2e41364 100644 --- a/resources/definitions/diy220.def.json +++ b/resources/definitions/diy220.def.json @@ -35,6 +35,7 @@ "machine_max_feedrate_y": { "default_value": 300 }, "machine_max_feedrate_z": { "default_value": 40 }, "machine_name": { "default_value": "Diytech 220" }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "default_value": "G21\nG90\nM82\nM107\nG28\nG1 Z15 F200\nT0\nG92 E0\nG1 E16 F250\nG92 E0\n" }, "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, diff --git a/resources/definitions/dxu.def.json b/resources/definitions/dxu.def.json index 117edf43db..c5eb9720f3 100644 --- a/resources/definitions/dxu.def.json +++ b/resources/definitions/dxu.def.json @@ -122,6 +122,7 @@ "machine_name": { "default_value": "dxu" }, "machine_nozzle_cool_down_speed": { "default_value": 1.5 }, "machine_nozzle_expansion_angle": { "default_value": 45 }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_heat_up_speed": { "default_value": 3.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "machine_show_variants": { "default_value": true }, diff --git a/resources/definitions/erzay3d.def.json b/resources/definitions/erzay3d.def.json index af5784e4e6..5baadf32e4 100644 --- a/resources/definitions/erzay3d.def.json +++ b/resources/definitions/erzay3d.def.json @@ -44,6 +44,7 @@ "machine_max_jerk_xy": { "default_value": 10 }, "machine_max_jerk_z": { "default_value": 10 }, "machine_name": { "default_value": "Erzay3D" }, + "machine_nozzle_head_distance": { "default_value": 2.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "machine_shape": { "default_value": "elliptic" }, "machine_start_gcode": { "default_value": "G28\nG1 Z15.0 F6000\nG92 E0" }, diff --git a/resources/definitions/fdmextruder.def.json b/resources/definitions/fdmextruder.def.json index 101efee3b1..f60cf63360 100644 --- a/resources/definitions/fdmextruder.def.json +++ b/resources/definitions/fdmextruder.def.json @@ -167,17 +167,6 @@ "type": "float", "unit": "mm" }, - "machine_nozzle_head_distance": - { - "default_value": 3, - "description": "The height difference between the tip of the nozzle and the lowest part of the print head.", - "label": "Nozzle Length", - "settable_per_extruder": true, - "settable_per_mesh": false, - "settable_per_meshgroup": false, - "type": "float", - "unit": "mm" - }, "machine_nozzle_id": { "default_value": "unknown", diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index c0c90dc6d7..045bec05a4 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -28,18 +28,6 @@ "icon": "Printer", "children": { - "build_volume_fan_nr": - { - "label": "Build volume fan number", - "description": "The number of the fan that cools the build volume. If this is set to 0, it's means that there is no build volume fan", - "default_value": 0, - "minimum_value": "0", - "maximum_value": "999999", - "type": "int", - "settable_per_mesh": false, - "settable_per_extruder": false, - "settable_per_meshgroup": false - }, "machine_name": { "label": "Machine Type", @@ -301,6 +289,17 @@ "settable_per_meshgroup": false, "settable_globally": false }, + "machine_nozzle_head_distance": + { + "label": "Nozzle Length", + "description": "The height difference between the tip of the nozzle and the lowest part of the print head.", + "unit": "mm", + "default_value": 3, + "type": "float", + "settable_per_mesh": false, + "settable_per_extruder": true, + "settable_per_meshgroup": false + }, "machine_nozzle_expansion_angle": { "label": "Nozzle Angle", @@ -4468,37 +4467,6 @@ "settable_per_mesh": false, "settable_per_extruder": true }, - "build_fan_full_at_height": - { - "label": "Build Fan Speed at Height", - "description": "The height at which the fans spin on regular fan speed. At the layers below the fan speed gradually increases from Initial Fan Speed to Regular Fan Speed.", - "unit": "mm", - "type": "float", - "default_value": 0, - "minimum_value": "0", - "enabled": "build_volume_fan_nr != 0", - "maximum_value_warning": "10.0", - "settable_per_mesh": false, - "settable_per_extruder": false, - "settable_per_meshgroup": false, - "children": - { - "build_fan_full_layer": - { - "label": "Build Fan Speed at Layer", - "description": "The layer at which the build fans spin on full fan speed. This value is calculated and rounded to a whole number.", - "type": "int", - "default_value": 0, - "minimum_value": "0", - "enabled": "build_volume_fan_nr != 0", - "maximum_value_warning": "10 / resolveOrValue('layer_height')", - "value": "max(1, int(math.floor((build_fan_full_at_height - resolveOrValue('layer_height_0')) / resolveOrValue('layer_height')) + 2))", - "settable_per_mesh": false, - "settable_per_extruder": false, - "settable_per_meshgroup": false - } - } - }, "cool_fan_speed": { "label": "Fan Speed", diff --git a/resources/definitions/maker_starter.def.json b/resources/definitions/maker_starter.def.json index 5e5f9dcb5b..e654ee0915 100644 --- a/resources/definitions/maker_starter.def.json +++ b/resources/definitions/maker_starter.def.json @@ -27,6 +27,7 @@ "machine_heated_bed": { "default_value": false }, "machine_height": { "default_value": 200 }, "machine_name": { "default_value": "3DMaker Starter" }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_width": { "default_value": 210 }, "raft_airgap": { "default_value": 0.2 }, diff --git a/resources/definitions/mendel90.def.json b/resources/definitions/mendel90.def.json index d8619fe276..57e1276e6a 100644 --- a/resources/definitions/mendel90.def.json +++ b/resources/definitions/mendel90.def.json @@ -37,6 +37,7 @@ "machine_heated_bed": { "default_value": true }, "machine_height": { "default_value": 200 }, "machine_name": { "default_value": "Mendel90" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;absolute extrusion\nM107 ;start with the fan off\nG28 ;home\nG92 E0 ;zero the extruded length\nM140 S{material_bed_temperature_layer_0} ; set the bed temperature and continue on\nG1 X-50 Y98 F9000 ;go to the left of the top\nG1 Z0.05 ; close to the bed\nM104 S{material_print_temperature_layer_0}; pre-heat the extruder continue on\nM190 S{material_bed_temperature_layer_0} ;set the bed temp & wait\nM109 S{material_print_temperature_layer_0};set the extruder temp for layer 0 & wait\nG92 E0 ;zero the extruded length\nG1 X50 E10 F300 ; make a thick line to prime extruder\nG92 E0 ; reset extruder\nG1 E-4 F1800\nG1 Z0.3 ;lift Z\n" }, "machine_width": { "default_value": 200 }, diff --git a/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json b/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json index 722f4dade5..c013c49e05 100644 --- a/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json +++ b/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json @@ -78,6 +78,7 @@ "machine_heat_zone_length": { "default_value": 20 }, "machine_height": { "default_value": 205 }, "machine_name": { "default_value": "Discov3ry Complete (Ultimaker 2+)" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "default_value": "\n;Updated Firmware (.hex and Marlin .ino) for \n;Ultimaker 2+ with Discov3ry Extruder available at: \n;https://github.com/Structur3d/UM2.1Discov3ry-Firmware-beta \n;**Learn more at https://www.structur3d.io** \n \nM104 S{material_print_temperature} ;Start heating extruder \nM140 S{material_bed_temperature} ;Start heating bed \nG21 ;metric values \nG90 ;absolute positioning \nM82 ;set extruder to absolute mode \nM107 ;start with the fan off \nM302 ;allow cold extrusion \nM92 E2589 ;set extruder EEPROM steps/mm for paste \nG28 Z0 ;move Z to bottom endstops \nG28 X0 Y0 ;move X/Y to endstops \nG1 X15 Y0 F4000 ;move X/Y to front of printer \nG1 Z15.0 F9000 ;move the platform to 15mm \nG92 E0 ;zero the extruded length \nG1 F200 E10 ;extrude 10 mm of feed stock \nG92 E0 ;zero the extruded length again \nG1 F9000 \n;Put printing message on LCD screen \nM117 Printing..." }, "machine_width": { "default_value": 205 }, diff --git a/resources/definitions/tam.def.json b/resources/definitions/tam.def.json index 01437cebe7..84bbc9c8fb 100644 --- a/resources/definitions/tam.def.json +++ b/resources/definitions/tam.def.json @@ -44,6 +44,7 @@ "machine_max_acceleration_y": { "default_value": 6000 }, "machine_max_acceleration_z": { "default_value": 12000 }, "machine_name": { "default_value": "TypeAMachines" }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "default_value": ";-- START GCODE --\n;Sliced for Type A Machines Series 1\n;Sliced at: {day} {date} {time}\n;Basic settings:\n;Layer height: {layer_height}\n;Walls: {wall_thickness}\n;Fill: {fill_distance}\n;Print Speed: {print_speed}\n;Support: {support}\n;Retraction Speed: {retraction_speed}\n;Retraction Distance: {retraction_amount}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Settings based on: {material_profile}\nG21 ;metric values\nG90 ;absolute positioning\nG28 ;move to endstops\nG29 ;allows for auto-levelling\nG1 Z15.0 F12000 ;move the platform down 15mm\nG1 X150 Y5 F9000 ;center\nM140 S{material_bed_temperature} ;Prep Heat Bed\nM109 S{default_material_print_temperature} ;Heat To temp\nM190 S{material_bed_temperature} ;Heat Bed to temp\nG1 X150 Y5 Z0.3 ;move the platform to purge extrusion\nG92 E0 ;zero the extruded length\nG1 F200 X250 E30 ;extrude 30mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 X150 Y150 Z25 F12000 ;recenter and begin\nG1 F9000" }, "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index d749c96a00..8c0e066cd1 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -95,6 +95,7 @@ "machine_max_feedrate_y": { "default_value": 300 }, "machine_max_feedrate_z": { "default_value": 40 }, "machine_name": { "default_value": "Ultimaker 2" }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "value": "\"G0 F3000 Y50 ;avoid prime blob\" if machine_gcode_flavor == \"UltiGCode\" else \"G21 ;metric values\\nG90 ;absolute positioning\\nM82 ;set extruder to absolute mode\\nM107 ;start with the fan off\\nG28 Z0 ;move Z to bottom endstops\\nG28 X0 Y0 ;move X/Y to endstops\\nG1 X15 Y0 F4000 ;move X/Y to front of printer\\nG1 Z15.0 F9000 ;move the platform to 15mm\\nG92 E0 ;zero the extruded length\\nG1 F200 E10 ;extrude 10 mm of feed stock\\nG92 E0 ;zero the extruded length again\\nG1 Y50 F9000\\n;Put printing message on LCD screen\\nM117 Printing...\"" }, "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, diff --git a/resources/definitions/ultimaker2_plus.def.json b/resources/definitions/ultimaker2_plus.def.json index c06d8b1e68..b5ad30bb8d 100644 --- a/resources/definitions/ultimaker2_plus.def.json +++ b/resources/definitions/ultimaker2_plus.def.json @@ -83,6 +83,7 @@ "machine_heat_zone_length": { "default_value": 20 }, "machine_height": { "default_value": 205 }, "machine_name": { "default_value": "Ultimaker 2+" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_show_variants": { "default_value": true }, "speed_infill": { "value": "speed_print" }, "speed_support": { "value": "speed_wall_0" }, diff --git a/resources/definitions/ultimaker2_plus_connect.def.json b/resources/definitions/ultimaker2_plus_connect.def.json index 6cdd3e9705..8aae2d4c19 100644 --- a/resources/definitions/ultimaker2_plus_connect.def.json +++ b/resources/definitions/ultimaker2_plus_connect.def.json @@ -92,6 +92,7 @@ "machine_heat_zone_length": { "default_value": 20 }, "machine_height": { "default_value": 205 }, "machine_name": { "default_value": "Ultimaker 2+ Connect" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "value": "''" }, "machine_width": { "default_value": 223 }, diff --git a/resources/extruders/Mark2_extruder1.def.json b/resources/extruders/Mark2_extruder1.def.json index 9617678f7e..89992ad450 100644 --- a/resources/extruders/Mark2_extruder1.def.json +++ b/resources/extruders/Mark2_extruder1.def.json @@ -14,7 +14,6 @@ "default_value": 0, "maximum_value": "1" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 } } diff --git a/resources/extruders/Mark2_extruder2.def.json b/resources/extruders/Mark2_extruder2.def.json index b0ea604fbb..967e32d8b8 100644 --- a/resources/extruders/Mark2_extruder2.def.json +++ b/resources/extruders/Mark2_extruder2.def.json @@ -14,7 +14,6 @@ "default_value": 1, "maximum_value": "1" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 } } diff --git a/resources/extruders/atom3_extruder_0.def.json b/resources/extruders/atom3_extruder_0.def.json index fc51a8cf03..ccc7a0bd6b 100644 --- a/resources/extruders/atom3_extruder_0.def.json +++ b/resources/extruders/atom3_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 6 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/diy220_extruder_0.def.json b/resources/extruders/diy220_extruder_0.def.json index ab271d1006..4d802b4a8d 100644 --- a/resources/extruders/diy220_extruder_0.def.json +++ b/resources/extruders/diy220_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/dxu_extruder1.def.json b/resources/extruders/dxu_extruder1.def.json index b44f79fdac..de974b8174 100644 --- a/resources/extruders/dxu_extruder1.def.json +++ b/resources/extruders/dxu_extruder1.def.json @@ -14,7 +14,6 @@ "default_value": 0, "maximum_value": "1" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 }, "machine_nozzle_size": { "default_value": 0.4 }, diff --git a/resources/extruders/dxu_extruder2.def.json b/resources/extruders/dxu_extruder2.def.json index 358bc69dae..b4de471289 100644 --- a/resources/extruders/dxu_extruder2.def.json +++ b/resources/extruders/dxu_extruder2.def.json @@ -14,7 +14,6 @@ "default_value": 1, "maximum_value": "1" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 19.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 }, "machine_nozzle_size": { "default_value": 0.4 }, diff --git a/resources/extruders/erzay3d_extruder_0.def.json b/resources/extruders/erzay3d_extruder_0.def.json index 8ba6c573f3..a4082a6224 100644 --- a/resources/extruders/erzay3d_extruder_0.def.json +++ b/resources/extruders/erzay3d_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 2.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/maker_starter_extruder_0.def.json b/resources/extruders/maker_starter_extruder_0.def.json index 4154b00862..1a8877f8ef 100644 --- a/resources/extruders/maker_starter_extruder_0.def.json +++ b/resources/extruders/maker_starter_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/mendel90_extruder_0.def.json b/resources/extruders/mendel90_extruder_0.def.json index b04e2d2fe9..0701164a65 100644 --- a/resources/extruders/mendel90_extruder_0.def.json +++ b/resources/extruders/mendel90_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json b/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json index ec25298a5c..0258f9da9c 100644 --- a/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json +++ b/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.84 }, "material_diameter": { "default_value": 3.175 } } diff --git a/resources/extruders/tam_extruder_0.def.json b/resources/extruders/tam_extruder_0.def.json index 4e5cbe4216..b606474ff0 100644 --- a/resources/extruders/tam_extruder_0.def.json +++ b/resources/extruders/tam_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/ultimaker2_extruder_0.def.json b/resources/extruders/ultimaker2_extruder_0.def.json index 3432ace596..17d0d425df 100644 --- a/resources/extruders/ultimaker2_extruder_0.def.json +++ b/resources/extruders/ultimaker2_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 2.85 } } diff --git a/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json b/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json index 9ad61af313..0b74aae019 100644 --- a/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json +++ b/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 2.85 } } diff --git a/resources/extruders/ultimaker2_plus_extruder_0.def.json b/resources/extruders/ultimaker2_plus_extruder_0.def.json index ace4b5b813..3fec85805e 100644 --- a/resources/extruders/ultimaker2_plus_extruder_0.def.json +++ b/resources/extruders/ultimaker2_plus_extruder_0.def.json @@ -10,7 +10,6 @@ "overrides": { "extruder_nr": { "default_value": 0 }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 2.85 } } diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 24a5221f4f..8bf8688e0e 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -215,14 +215,14 @@ msgstr "" msgctxt "@label crash message" msgid "" -"

A fatal error has occurred in Cura. Please send us this Crash Report to fix the problem

\n" +"

A fatal error has occurred in Cura. Please send us this Crash Report to fix the problem

\n" "

Please use the \"Send report\" button to post a bug report automatically to our servers

\n" " " msgstr "" msgctxt "@label crash message" msgid "" -"

Oops, UltiMaker Cura has encountered something that doesn't seem right.

\n" +"

Oops, UltiMaker Cura has encountered something that doesn't seem right.

\n" "

We encountered an unrecoverable error during start up. It was possibly caused by some incorrect configuration files. We suggest to backup and reset your configuration.

\n" "

Backups can be found in the configuration folder.

\n" "

Please send us this Crash Report to fix the problem.

\n" From 1186303b154e7831b7ba02ae1f26478bcf20c203 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Fri, 9 Aug 2024 09:43:52 +0200 Subject: [PATCH 02/37] PP-512 Fix bad print quality for TPU AA08 on Factor 4 --- .../um_f4_aa0.8_tpu_0.2mm.inst.cfg | 3 ++- .../um_f4_aa0.8_tpu_0.3mm.inst.cfg | 26 +++++++++++++++++++ .../um_f4_aa0.8_tpu_0.4mm.inst.cfg | 26 +++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg create mode 100644 resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg index c3291f77a1..78cbae1205 100644 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg @@ -15,10 +15,11 @@ weight = -2 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' -infill_sparse_density = 10 +infill_sparse_density = 20 inset_direction = outside_in max_flow_acceleration = 1 skin_material_flow = =material_flow * 0.9 skin_material_flow_layer_0 = 90 speed_layer_0 = 20 +speed_print = 35 diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg new file mode 100644 index 0000000000..cdce6ac6cd --- /dev/null +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg @@ -0,0 +1,26 @@ +[general] +definition = ultimaker_factor4 +name = Extra Fast +version = 4 + +[metadata] +setting_version = 23 +variant = AA 0.8 +material = generic_tpu +quality_type = verydraft +type = quality +weight = -3 + +[values] +_plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 +_plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True +_plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' +infill_sparse_density = 20 +inset_direction = outside_in +material_print_temperature = =default_material_print_temperature + 5 +skin_material_flow = =material_flow * 0.9 +skin_material_flow_layer_0 = 90 +speed_layer_0 = 20 +speed_print = 35 + diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg new file mode 100644 index 0000000000..93e8965239 --- /dev/null +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg @@ -0,0 +1,26 @@ +[general] +definition = ultimaker_factor4 +name = Sprint +version = 4 + +[metadata] +setting_version = 23 +variant = AA 0.8 +material = generic_tpu +quality_type = superdraft +type = quality +weight = -4 + +[values] +_plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 +_plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True +_plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' +infill_sparse_density = 20 +inset_direction = outside_in +material_print_temperature = =default_material_print_temperature + 8 +skin_material_flow = =material_flow * 0.9 +skin_material_flow_layer_0 = 90 +speed_layer_0 = 20 +speed_print = 35 + From e89e578ed9beee8a364ee9b9fa9aa884a653cfe5 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Fri, 9 Aug 2024 07:45:20 +0000 Subject: [PATCH 03/37] Applied printer-linter format --- .../quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg | 4 ++-- .../quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg index cdce6ac6cd..faca58aaa3 100644 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg @@ -4,11 +4,11 @@ name = Extra Fast version = 4 [metadata] -setting_version = 23 -variant = AA 0.8 material = generic_tpu quality_type = verydraft +setting_version = 23 type = quality +variant = AA 0.8 weight = -3 [values] diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg index 93e8965239..81dacccf6f 100644 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg @@ -4,11 +4,11 @@ name = Sprint version = 4 [metadata] -setting_version = 23 -variant = AA 0.8 material = generic_tpu quality_type = superdraft +setting_version = 23 type = quality +variant = AA 0.8 weight = -4 [values] From b709f4d90f9be4e69d46de7be2a35252765386e2 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Fri, 23 Aug 2024 09:38:18 +0200 Subject: [PATCH 04/37] Remove the bad print profile that started this whole ticket --- .../um_f4_aa0.8_tpu_0.2mm.inst.cfg | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg deleted file mode 100644 index 78cbae1205..0000000000 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg +++ /dev/null @@ -1,25 +0,0 @@ -[general] -definition = ultimaker_factor4 -name = Fast -version = 4 - -[metadata] -material = generic_tpu -quality_type = draft -setting_version = 23 -type = quality -variant = AA 0.8 -weight = -2 - -[values] -gradual_flow_discretisation_step_size = 0.1 -gradual_flow_enabled = True -infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' -infill_sparse_density = 20 -inset_direction = outside_in -max_flow_acceleration = 1 -skin_material_flow = =material_flow * 0.9 -skin_material_flow_layer_0 = 90 -speed_layer_0 = 20 -speed_print = 35 - From 07fc8b8c5b99c9249af3b1e774bc5d53da36fd06 Mon Sep 17 00:00:00 2001 From: Frederic Meeuwissen <13856291+Frederic98@users.noreply.github.com> Date: Fri, 23 Aug 2024 12:05:45 +0200 Subject: [PATCH 05/37] Change GradualFlow plugin setting names --- .../ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg | 6 +++--- .../ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg index faca58aaa3..7949c64afc 100644 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg @@ -12,13 +12,13 @@ variant = AA 0.8 weight = -3 [values] -_plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 -_plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True -_plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +gradual_flow_discretisation_step_size = 0.1 +gradual_flow_enabled = True infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' infill_sparse_density = 20 inset_direction = outside_in material_print_temperature = =default_material_print_temperature + 5 +max_flow_acceleration = 1 skin_material_flow = =material_flow * 0.9 skin_material_flow_layer_0 = 90 speed_layer_0 = 20 diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg index 81dacccf6f..4b1d25bd18 100644 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg @@ -12,13 +12,13 @@ variant = AA 0.8 weight = -4 [values] -_plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 -_plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True -_plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +gradual_flow_discretisation_step_size = 0.1 +gradual_flow_enabled = True infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' infill_sparse_density = 20 inset_direction = outside_in material_print_temperature = =default_material_print_temperature + 8 +max_flow_acceleration = 1 skin_material_flow = =material_flow * 0.9 skin_material_flow_layer_0 = 90 speed_layer_0 = 20 From c11c97dde041d257ef5c0cf1198091c068627a47 Mon Sep 17 00:00:00 2001 From: Frederic Meeuwissen <13856291+Frederic98@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:03:49 +0200 Subject: [PATCH 06/37] Fix naming of the 0.3mm layer height profiles --- .../ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg index 6aa1be79a3..48feef8723 100644 --- a/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg @@ -1,6 +1,6 @@ [general] definition = ultimaker_factor4 -name = Sprint +name = Extra Fast version = 4 [metadata] From 0bf6bba43c4e120eb36353a2d7dc0bb4c057d0ad Mon Sep 17 00:00:00 2001 From: THeijmans Date: Wed, 21 Aug 2024 13:25:30 +0200 Subject: [PATCH 07/37] PP-514 Improve PVA printing quality and reliability on Factor 4 --- .../um_f4_bb0.4_pva_0.15mm.inst.cfg | 16 ++++++++++++++-- .../um_f4_bb0.4_pva_0.1mm.inst.cfg | 17 ++++++++++++++--- .../um_f4_bb0.4_pva_0.2mm.inst.cfg | 17 ++++++++++++++--- .../um_f4_bb0.4_pva_0.3mm.inst.cfg | 17 ++++++++++++++--- .../um_f4_bb0.8_pva_0.2mm.inst.cfg | 16 ++++++++++++++-- .../um_f4_bb0.8_pva_0.3mm.inst.cfg | 16 ++++++++++++++-- .../um_f4_bb0.8_pva_0.4mm.inst.cfg | 16 ++++++++++++++-- 7 files changed, 98 insertions(+), 17 deletions(-) diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg index 3294a3a150..37e9bb8b73 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg @@ -12,20 +12,32 @@ variant = BB 0.4 weight = -1 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg index 0f10e4f507..4c83276641 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg @@ -12,21 +12,32 @@ variant = BB 0.4 weight = 0 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 -speed_print = 50 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg index ef920e6fd7..93f62df983 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg @@ -12,21 +12,32 @@ variant = BB 0.4 weight = -2 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 -speed_print = 50 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg index 4165a27a58..0d946c0092 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg @@ -12,21 +12,32 @@ variant = BB 0.4 weight = -3 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 -speed_print = 40 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg index 2963265eec..148a82c991 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg @@ -12,20 +12,32 @@ variant = BB 0.8 weight = -2 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg index 0a1437fd30..8ab2146046 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg @@ -12,20 +12,32 @@ variant = BB 0.8 weight = -3 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg index edd837f8fc..52134575b0 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg @@ -12,20 +12,32 @@ variant = BB 0.8 weight = -4 [values] +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 max_flow_acceleration = 1 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 From 4064dddacc2c48c8152c377c6a387dd67739e7c2 Mon Sep 17 00:00:00 2001 From: Frederic Meeuwissen <13856291+Frederic98@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:12:03 +0200 Subject: [PATCH 08/37] Only convert to yes/no if value is a boolean --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 980288e3c9..d054f05485 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -1083,9 +1083,8 @@ class XmlMaterialProfile(InstanceContainer): # Skip material properties (eg diameter) or metadata (eg GUID) return - truth_map = { True: "yes", False: "no" } - if tag_name != "cura:setting" and instance.value in truth_map: - data = truth_map[instance.value] + if tag_name != "cura:setting" and isinstance(instance.value, bool): + data = "yes" if instance.value else "no" else: data = str(instance.value) From 8e05bb49e183024cd08fe70d052b702d2f34f8c2 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Wed, 21 Aug 2024 13:25:30 +0200 Subject: [PATCH 09/37] PP-514 Improve PVA printing quality and reliability on Factor 4 --- .../um_f4_bb0.4_pva_0.15mm.inst.cfg | 16 ++++++++++++++-- .../um_f4_bb0.4_pva_0.1mm.inst.cfg | 17 ++++++++++++++--- .../um_f4_bb0.4_pva_0.2mm.inst.cfg | 17 ++++++++++++++--- .../um_f4_bb0.4_pva_0.3mm.inst.cfg | 17 ++++++++++++++--- .../um_f4_bb0.8_pva_0.2mm.inst.cfg | 16 ++++++++++++++-- .../um_f4_bb0.8_pva_0.3mm.inst.cfg | 16 ++++++++++++++-- .../um_f4_bb0.8_pva_0.4mm.inst.cfg | 16 ++++++++++++++-- 7 files changed, 98 insertions(+), 17 deletions(-) diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg index bae4a519f3..380ea30c1e 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg @@ -15,17 +15,29 @@ weight = -1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg index 95b7c1856d..4123824c43 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg @@ -15,18 +15,29 @@ weight = 0 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 -speed_print = 50 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg index 8de45aa01b..f6cd7f65a7 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg @@ -15,18 +15,29 @@ weight = -2 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 -speed_print = 50 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg index be24017486..69f33c5232 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg @@ -15,18 +15,29 @@ weight = -3 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 -speed_print = 40 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg index 1e1ab101f4..f5241e08e7 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg @@ -15,17 +15,29 @@ weight = -2 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg index 2ae11eb441..e226d1737f 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg @@ -15,17 +15,29 @@ weight = -3 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg index 448152ca8e..d6b9e95ace 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg @@ -15,17 +15,29 @@ weight = -4 _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +acceleration_print = 1000.0 acceleration_support_bottom = 100 -acceleration_support_interface = 1500 +acceleration_support_interface = 1000 brim_replaces_support = False build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 -initial_layer_line_width_factor = 150 +gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 +jerk_print = 10 +material_flow_layer_0 = 90 minimum_support_area = 4 +prime_tower_flow = 90 prime_tower_min_volume = 15 +retraction_min_travel = 5.0 +retraction_prime_speed = 10.0 skin_material_flow = =material_flow * 0.93 +speed_print = 30 +support_angle = 45 +support_infill_rate = 20 support_infill_sparse_thickness = =min(layer_height * 2, machine_nozzle_size * 3 / 4) if layer_height <= 0.15 / 0.4 * machine_nozzle_size else layer_height support_interface_offset = 1 support_offset = 3 +support_xy_distance = 2 support_z_distance = 0 +switch_extruder_prime_speed = 10.0 From dc2a6cb8bf89e135039513514be59db27ef866cf Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 28 Aug 2024 14:58:08 +0200 Subject: [PATCH 10/37] TPU changes --- .../um_f4_aa0.8_tpu_0.3mm.inst.cfg | 26 +++++++++++++++++++ ...nst.cfg => um_f4_aa0.8_tpu_0.4mm.inst.cfg} | 10 ++++--- .../um_f4_global_Verydraft_Quality.inst.cfg | 2 +- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg rename resources/quality/ultimaker_factor4/{um_f4_aa0.8_tpu_0.2mm.inst.cfg => um_f4_aa0.8_tpu_0.4mm.inst.cfg} (77%) diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg new file mode 100644 index 0000000000..faca58aaa3 --- /dev/null +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.3mm.inst.cfg @@ -0,0 +1,26 @@ +[general] +definition = ultimaker_factor4 +name = Extra Fast +version = 4 + +[metadata] +material = generic_tpu +quality_type = verydraft +setting_version = 23 +type = quality +variant = AA 0.8 +weight = -3 + +[values] +_plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 +_plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True +_plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' +infill_sparse_density = 20 +inset_direction = outside_in +material_print_temperature = =default_material_print_temperature + 5 +skin_material_flow = =material_flow * 0.9 +skin_material_flow_layer_0 = 90 +speed_layer_0 = 20 +speed_print = 35 + diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg similarity index 77% rename from resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg rename to resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg index 7db0c220f4..81dacccf6f 100644 --- a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.4mm.inst.cfg @@ -1,24 +1,26 @@ [general] definition = ultimaker_factor4 -name = Fast +name = Sprint version = 4 [metadata] material = generic_tpu -quality_type = draft +quality_type = superdraft setting_version = 23 type = quality variant = AA 0.8 -weight = -2 +weight = -4 [values] _plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 _plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True _plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' -infill_sparse_density = 10 +infill_sparse_density = 20 inset_direction = outside_in +material_print_temperature = =default_material_print_temperature + 8 skin_material_flow = =material_flow * 0.9 skin_material_flow_layer_0 = 90 speed_layer_0 = 20 +speed_print = 35 diff --git a/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg index 6aa1be79a3..48feef8723 100644 --- a/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_global_Verydraft_Quality.inst.cfg @@ -1,6 +1,6 @@ [general] definition = ultimaker_factor4 -name = Sprint +name = Extra Fast version = 4 [metadata] From c7a286b33a1ca090fb2131399083a5449442b587 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 28 Aug 2024 13:16:33 +0000 Subject: [PATCH 11/37] Set conan package version 5.8.1 --- conandata.yml | 14 +++++++------- resources/conandata.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conandata.yml b/conandata.yml index 83bfd935a0..5a99882ab1 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,17 +1,17 @@ -version: "5.8.0" +version: "5.8.1" requirements: - - "cura_resources/5.8.0" - - "uranium/5.8.0" - - "curaengine/5.8.0" - - "cura_binary_data/5.8.0" - - "fdm_materials/5.8.0" + - "cura_resources/5.8.1" + - "uranium/5.8.1" + - "curaengine/5.8.1" + - "cura_binary_data/5.8.1" + - "fdm_materials/5.8.1" - "curaengine_plugin_gradual_flow/0.1.0-beta.4" - "dulcificum/0.2.1" - "pysavitar/5.3.0" - "pynest2d/5.3.0" - "native_cad_plugin/2.0.0" requirements_internal: - - "fdm_materials/5.8.0" + - "fdm_materials/5.8.1" - "cura_private_data/(latest)@internal/testing" urls: default: diff --git a/resources/conandata.yml b/resources/conandata.yml index d43b7d4dd2..7d5a43c891 100644 --- a/resources/conandata.yml +++ b/resources/conandata.yml @@ -1 +1 @@ -version: "5.8.0" +version: "5.8.1" From bcd74aac3a11dfde9ce073d4b0f7ed759bff1729 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 28 Aug 2024 17:08:57 +0200 Subject: [PATCH 12/37] Revert "TPU removal of 0.2mm" Requires upgrade script --- .../um_f4_aa0.8_tpu_0.2mm.inst.cfg | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg new file mode 100644 index 0000000000..7db0c220f4 --- /dev/null +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg @@ -0,0 +1,24 @@ +[general] +definition = ultimaker_factor4 +name = Fast +version = 4 + +[metadata] +material = generic_tpu +quality_type = draft +setting_version = 23 +type = quality +variant = AA 0.8 +weight = -2 + +[values] +_plugin__curaenginegradualflow__0_1_0__gradual_flow_discretisation_step_size = 0.1 +_plugin__curaenginegradualflow__0_1_0__gradual_flow_enabled = True +_plugin__curaenginegradualflow__0_1_0__max_flow_acceleration = 1 +infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' +infill_sparse_density = 10 +inset_direction = outside_in +skin_material_flow = =material_flow * 0.9 +skin_material_flow_layer_0 = 90 +speed_layer_0 = 20 + From 63ff5517541d5d5973b433236508ebf70a85e3fd Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 28 Aug 2024 17:34:17 +0200 Subject: [PATCH 13/37] 5.8.1 changelog --- resources/texts/change_log.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/texts/change_log.txt b/resources/texts/change_log.txt index cb5aa3d2a6..237caedea9 100644 --- a/resources/texts/change_log.txt +++ b/resources/texts/change_log.txt @@ -1,3 +1,11 @@ +[5.8.1] + +* Bug fixes: +- Fixed an issue where materials could not be synced to UltiMaker Printers + +* Profile Improvements +- Significant improvements for PVA and TPU 95A profiles for UltiMaker Factor 4 + [5.8] * New Z Seam Settings: From d0252554c40c843da37506405e31d38b16103c20 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 3 Sep 2024 18:23:41 +0200 Subject: [PATCH 14/37] Make extra sure cache is emptied when objects get altered. See the (new) cachePerInstance decorator in UM/Decorators, and the accompanying CachedMemberFunction handler-class. part of CURA-11761 --- cura/Settings/CuraContainerStack.py | 3 ++- cura/Settings/ExtruderStack.py | 3 ++- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cura/Settings/CuraContainerStack.py b/cura/Settings/CuraContainerStack.py index b5b8a1b721..ef1c9561af 100755 --- a/cura/Settings/CuraContainerStack.py +++ b/cura/Settings/CuraContainerStack.py @@ -5,7 +5,7 @@ from typing import Any, cast, List, Optional, Dict from PyQt6.QtCore import pyqtProperty, pyqtSignal, QObject from UM.Application import Application -from UM.Decorators import override +from UM.Decorators import CachedMemberFunctions, override from UM.FlameProfiler import pyqtSlot from UM.Logger import Logger from UM.Settings.ContainerStack import ContainerStack, InvalidContainerStackError @@ -237,6 +237,7 @@ class CuraContainerStack(ContainerStack): :param new_value: The new value to set the property to. """ + CachedMemberFunctions.clearInstanceCache(self) container_index = _ContainerIndexes.UserChanges self._containers[container_index].setProperty(key, property_name, property_value, container, set_from_cache) diff --git a/cura/Settings/ExtruderStack.py b/cura/Settings/ExtruderStack.py index eba41569b7..645abeb0f6 100644 --- a/cura/Settings/ExtruderStack.py +++ b/cura/Settings/ExtruderStack.py @@ -5,7 +5,7 @@ from typing import Any, Dict, TYPE_CHECKING, Optional from PyQt6.QtCore import pyqtProperty, pyqtSignal -from UM.Decorators import override +from UM.Decorators import CachedMemberFunctions, override from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase from UM.Settings.ContainerStack import ContainerStack from UM.Settings.ContainerRegistry import ContainerRegistry @@ -86,6 +86,7 @@ class ExtruderStack(CuraContainerStack): def setCompatibleMaterialDiameter(self, value: float) -> None: old_approximate_diameter = self.getApproximateMaterialDiameter() if self.getCompatibleMaterialDiameter() != value: + CachedMemberFunctions.clearInstanceCache(self) self.definitionChanges.setProperty("material_diameter", "value", value) self.compatibleMaterialDiameterChanged.emit() diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 49b5e7661d..c56c527f92 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -11,6 +11,7 @@ import xml.etree.ElementTree as ET from UM.PluginRegistry import PluginRegistry from UM.Resources import Resources from UM.Logger import Logger +from UM.Decorators import CachedMemberFunctions import UM.Dictionary from UM.Settings.InstanceContainer import InstanceContainer from UM.Settings.ContainerRegistry import ContainerRegistry @@ -71,6 +72,8 @@ class XmlMaterialProfile(InstanceContainer): Logger.log("w", "Can't change metadata {key} of material {material_id} because it's read-only.".format(key = key, material_id = self.getId())) return + CachedMemberFunctions.clearInstanceCache(self) + # Some metadata such as diameter should also be instantiated to be a setting. Go though all values for the # "properties" field and apply the new values to SettingInstances as well. new_setting_values_dict = {} @@ -480,6 +483,7 @@ class XmlMaterialProfile(InstanceContainer): first.append(element) def clearData(self): + CachedMemberFunctions.clearInstanceCache(self) self._metadata = { "id": self.getId(), "name": "" @@ -519,6 +523,8 @@ class XmlMaterialProfile(InstanceContainer): def deserialize(self, serialized, file_name = None): """Overridden from InstanceContainer""" + CachedMemberFunctions.clearInstanceCache(self) + containers_to_add = [] # update the serialized data first from UM.Settings.Interfaces import ContainerInterface From ccffbea8c91f3339d1d8f3fda5a21030e5fb225c Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 5 Sep 2024 11:03:58 +0200 Subject: [PATCH 15/37] Add ability to write condition Start/End gcode parts CURA-12093 --- plugins/CuraEngineBackend/StartSliceJob.py | 187 +++++++++++++----- tests/Machines/TestStartEndGCode.py | 220 +++++++++++++++++++++ 2 files changed, 360 insertions(+), 47 deletions(-) create mode 100644 tests/Machines/TestStartEndGCode.py diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 6da0edb2a7..129bbbb5d1 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -49,7 +49,20 @@ class StartJobResult(IntEnum): ObjectsWithDisabledExtruder = 8 -class GcodeStartEndFormatter(Formatter): +class GcodeConditionState(IntEnum): + OutsideCondition = 1 + ConditionFalse = 2 + ConditionTrue = 3 + ConditionDone = 4 + + +class GcodeInstruction(IntEnum): + Skip = 1 + Evaluate = 2 + EvaluateAndWrite = 3 + + +class GcodeStartEndFormatter: # Formatter class that handles token expansion in start/end gcode # Example of a start/end gcode string: # ``` @@ -63,22 +76,55 @@ class GcodeStartEndFormatter(Formatter): # will be used. Alternatively, if the expression is formatted as "{[expression], [extruder_nr]}", # then the expression will be evaluated with the extruder stack of the specified extruder_nr. - _extruder_regex = re.compile(r"^\s*(?P.*)\s*,\s*(?P.*)\s*$") + _instruction_regex = re.compile(r"{(?Pif|else|elif|endif)?\s*(?P.*?)\s*(?:,\s*(?P.*))?\s*}(?P\n?)") - def __init__(self, all_extruder_settings: Dict[str, Any], default_extruder_nr: int = -1) -> None: + def __init__(self, + all_extruder_settings: Dict[str, Dict[str, Any]], + default_extruder_nr: int = -1, + cura_application: CuraApplication = None, + extruder_manager: ExtruderManager = None + ) -> None: super().__init__() - self._all_extruder_settings: Dict[str, Any] = all_extruder_settings + self._all_extruder_settings: Dict[str, Dict[str, Any]] = all_extruder_settings self._default_extruder_nr: int = default_extruder_nr + self._cura_application = cura_application if cura_application is not None else CuraApplication.getInstance() + self._extruder_manager = extruder_manager if extruder_manager is not None else ExtruderManager.getInstance() - def get_field(self, field_name, args: [str], kwargs: dict) -> Tuple[str, str]: - # get_field method parses all fields in the format-string and parses them individually to the get_value method. - # e.g. for a string "Hello {foo.bar}" would the complete field "foo.bar" would be passed to get_field, and then - # the individual parts "foo" and "bar" would be passed to get_value. This poses a problem for us, because want - # to parse the entire field as a single expression. To solve this, we override the get_field method and return - # the entire field as the expression. - return self.get_value(field_name, args, kwargs), field_name + def format(self, text: str) -> str: + remaining_text: str = text + result: str = "" - def get_value(self, expression: str, args: [str], kwargs: dict) -> str: + self._condition_state: GcodeConditionState = GcodeConditionState.OutsideCondition + + while len(remaining_text) > 0: + next_code_match = self._instruction_regex.search(remaining_text) + if next_code_match is not None: + expression_start, expression_end = next_code_match.span() + + if expression_start > 0: + result += self._process_statement(remaining_text[:expression_start]) + + result += self._process_code(next_code_match) + + remaining_text = remaining_text[expression_end:] + + else: + result += self._process_statement(remaining_text) + remaining_text = "" + + return result + + def _process_statement(self, statement: str) -> str: + if self._condition_state in [GcodeConditionState.OutsideCondition, GcodeConditionState.ConditionTrue]: + return statement + else: + return "" + + def _process_code(self, code: re.Match) -> str: + condition: Optional[str] = code.group("condition") + expression: Optional[str] = code.group("expression") + extruder_nr_expr: Optional[str] = code.group("extruder_nr_expr") + end_of_line: Optional[str] = code.group("end_of_line") # The following variables are not settings, but only become available after slicing. # when these variables are encountered, we return them as-is. They are replaced later @@ -87,53 +133,100 @@ class GcodeStartEndFormatter(Formatter): if expression in post_slice_data_variables: return f"{{{expression}}}" - extruder_nr = str(self._default_extruder_nr) + extruder_nr: str = str(self._default_extruder_nr) + instruction: GcodeInstruction = GcodeInstruction.Skip # The settings may specify a specific extruder to use. This is done by # formatting the expression as "{expression}, {extruder_nr_expr}". If the # expression is formatted like this, we extract the extruder_nr and use # it to get the value from the correct extruder stack. - match = self._extruder_regex.match(expression) - if match: - expression = match.group("expression") - extruder_nr_expr = match.group("extruder_nr_expr") - - if extruder_nr_expr.isdigit(): - extruder_nr = extruder_nr_expr + if condition is None: + # This is a classic statement + if self._condition_state in [GcodeConditionState.OutsideCondition, GcodeConditionState.ConditionTrue]: + # Skip and move to next + instruction = GcodeInstruction.EvaluateAndWrite + else: + # This is a condition statement, first check validity + if condition == "if": + if self._condition_state != GcodeConditionState.OutsideCondition: + raise SyntaxError("Nested conditions are not supported") else: - # We get the value of the extruder_nr_expr from `_all_extruder_settings` dictionary - # rather than the global container stack. The `_all_extruder_settings["-1"]` is a - # dict-representation of the global container stack, with additional properties such - # as `initial_extruder_nr`. As users may enter such expressions we can't use the - # global container stack. - extruder_nr = str(self._all_extruder_settings["-1"].get(extruder_nr_expr, "-1")) + if self._condition_state == GcodeConditionState.OutsideCondition: + raise SyntaxError("Condition should start with an 'if' statement") - if extruder_nr in self._all_extruder_settings: - additional_variables = self._all_extruder_settings[extruder_nr].copy() - else: - Logger.warning(f"Extruder {extruder_nr} does not exist, using global settings") - additional_variables = self._all_extruder_settings["-1"].copy() + if condition == "if": + # First instruction, just evaluate it + instruction = GcodeInstruction.Evaluate - # Add the arguments and keyword arguments to the additional settings. These - # are currently _not_ used, but they are added for consistency with the - # base Formatter class. - for key, value in enumerate(args): - additional_variables[key] = value - for key, value in kwargs.items(): - additional_variables[key] = value + else: + if self._condition_state == GcodeConditionState.ConditionTrue: + # We have reached the next condition after a valid one has been found, skip the rest + self._condition_state = GcodeConditionState.ConditionDone - if extruder_nr == "-1": - container_stack = CuraApplication.getInstance().getGlobalContainerStack() - else: - container_stack = ExtruderManager.getInstance().getExtruderStack(extruder_nr) - if not container_stack: + if condition == "elif": + if self._condition_state == GcodeConditionState.ConditionFalse: + # New instruction, and valid condition has not been reached so far => evaluate it + instruction = GcodeInstruction.Evaluate + else: + # New instruction, but valid condition has already been reached => skip it + instruction = GcodeInstruction.Skip + + elif condition == "else": + instruction = GcodeInstruction.Skip # Never evaluate, expression should be empty + if self._condition_state == GcodeConditionState.ConditionFalse: + # Fallback instruction, and valid condition has not been reached so far => active next + self._condition_state = GcodeConditionState.ConditionTrue + + elif condition == "endif": + instruction = GcodeInstruction.Skip # Never evaluate, expression should be empty + self._condition_state = GcodeConditionState.OutsideCondition + + if instruction >= GcodeInstruction.Evaluate and extruder_nr_expr is not None: + extruder_nr_function = SettingFunction(extruder_nr_expr) + container_stack = self._cura_application.getGlobalContainerStack() + + # We add the variables contained in `_all_extruder_settings["-1"]`, which is a dict-representation of the + # global container stack, with additional properties such as `initial_extruder_nr`. As users may enter such + # expressions we can't use the global container stack. The variables contained in the global container stack + # will then be inserted twice, which is not optimal but works well. + extruder_nr = str(extruder_nr_function(container_stack, additional_variables=self._all_extruder_settings["-1"])) + + if instruction >= GcodeInstruction.Evaluate: + if extruder_nr in self._all_extruder_settings: + additional_variables = self._all_extruder_settings[extruder_nr].copy() + else: Logger.warning(f"Extruder {extruder_nr} does not exist, using global settings") - container_stack = CuraApplication.getInstance().getGlobalContainerStack() + additional_variables = self._all_extruder_settings["-1"].copy() - setting_function = SettingFunction(expression) - value = setting_function(container_stack, additional_variables=additional_variables) + if extruder_nr == "-1": + container_stack = self._cura_application.getGlobalContainerStack() + else: + container_stack = self._extruder_manager.getExtruderStack(extruder_nr) + if not container_stack: + Logger.warning(f"Extruder {extruder_nr} does not exist, using global settings") + container_stack = self._cura_application.getGlobalContainerStack() - return value + setting_function = SettingFunction(expression) + value = setting_function(container_stack, additional_variables=additional_variables) + + if instruction == GcodeInstruction.Evaluate: + if value: + self._condition_state = GcodeConditionState.ConditionTrue + else: + self._condition_state = GcodeConditionState.ConditionFalse + + return "" + else: + value_str = str(value) + + if end_of_line is not None: + # If we are evaluating an expression that is not a condition, restore the end of line + value_str += end_of_line + + return value_str + + else: + return "" class StartSliceJob(Job): diff --git a/tests/Machines/TestStartEndGCode.py b/tests/Machines/TestStartEndGCode.py new file mode 100644 index 0000000000..05ee34e6bb --- /dev/null +++ b/tests/Machines/TestStartEndGCode.py @@ -0,0 +1,220 @@ +# Copyright (c) 2024 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + +import pytest +from unittest.mock import MagicMock + +from plugins.CuraEngineBackend.StartSliceJob import GcodeStartEndFormatter + + +# def createMockedInstanceContainer(container_id): +# result = MagicMock() +# result.getId = MagicMock(return_value=container_id) +# result.getMetaDataEntry = MagicMock(side_effect=getMetadataEntrySideEffect) +# return result + +class MockValueProvider: + ## Creates a mock value provider. + # + # This initialises a dictionary with key-value pairs. + def __init__(self, values): + self._values = values + + ## Provides a value. + # + # \param name The key of the value to provide. + def getProperty(self, key, property_name, context = None): + if not (key in self._values): + return None + return self._values[key] + +extruder_0_values = { + "material_temperature": 190.0 +} + +extruder_1_values = { + "material_temperature": 210.0 +} + +global_values = { + "bed_temperature": 50.0, + "initial_extruder": 0 +} + +extruder_0_provider = MockValueProvider(extruder_0_values) +extruder_1_provider = MockValueProvider(extruder_1_values) + +all_extruder_settings = {"-1": global_values, "0": extruder_0_values, "1": extruder_1_values} + +test_cases = [ + ('Static code', 'G0', 'G0'), + + ('Basic replacement', 'M128 {bed_temperature}', 'M128 50.0'), + + ( + 'Conditional expression with global setting', +'''{if bed_temperature > 30} +G123 +{else} +G456 +{endif}''', +'''G123 +''' + ), + + ( + 'Conditional expression with extruder setting directly specified by index 0', +'''{if material_temperature > 200, 0} +G10 +{else} +G20 +{endif}''', +'''G20 +''' + ), + ( + 'Conditional expression with extruder setting directly specified by index 1', +'''{if material_temperature > 200, 1} +G100 +{else} +G200 +{endif}''', +'''G100 +''' + ), + + ( + 'Conditional expression with extruder index specified by setting', +'''{if material_temperature > 200, initial_extruder} +G1000 +{else} +G2000 +{endif}''', +'''G2000 +''' + ), + + ( + 'Conditional expression with extruder index specified by formula', +'''{if material_temperature > 200, (initial_extruder + 1) % 2} +X1000 +{else} +X2000 +{endif}''', +'''X1000 +''' + ), + + ( + 'Conditional expression with elsif', +'''{if bed_temperature < 30} +T30 +{elif bed_temperature >= 30 and bed_temperature < 40} +T40 +{elif bed_temperature >= 40 and bed_temperature < 50} +T50 +{elif bed_temperature >= 50 and bed_temperature < 60} +T60 +{elif bed_temperature >= 60 and bed_temperature < 70} +T70 +{else} +T-800 +{endif}''', +'''T60 +''' + ), + + ( + 'Formula inside a conditional expression', +'''{if bed_temperature < 30} +Z000 +{else} +Z{bed_temperature + 10} +{endif}''', +'''Z60.0 +''' + ), + + ( + 'Other commands around conditional expression', +''' +R000 +# My super initial command +R111 X123 Y456 Z789 +{if bed_temperature > 30} +R987 +R654 X321 +{else} +R963 X852 Y741 +R321 X654 Y987 +{endif} +# And finally, the end of the start at the beginning of the header +R369 +R357 X951 Y843''', +''' +R000 +# My super initial command +R111 X123 Y456 Z789 +R987 +R654 X321 +# And finally, the end of the start at the beginning of the header +R369 +R357 X951 Y843''' + ), + + ( + 'Multiple conditional expressions', +''' +A999 +{if bed_temperature > 30} +A000 +{else} +A100 +{endif} +A888 +{if material_temperature > 200, 0} +A200 +{else} +A300 +{endif} +A777 +''', +''' +A999 +A000 +A888 +A300 +A777 +''' + ), +] + +def pytest_generate_tests(metafunc): + if "original_gcode" in metafunc.fixturenames: + tests_ids = [test[0] for test in test_cases] + tests_data = [test[1:] for test in test_cases] + metafunc.parametrize("original_gcode, expected_gcode", tests_data, ids = tests_ids) + +@pytest.fixture +def cura_application(): + result = MagicMock() + result.getGlobalContainerStack = MagicMock(return_value = MockValueProvider(global_values)) + return result + +@pytest.fixture +def extruder_manager(): + def get_extruder(extruder_nr: str): + if extruder_nr == "0": + return extruder_0_provider + elif extruder_nr == "1": + return extruder_1_provider + else: + return None + + result = MagicMock() + result.getExtruderStack = MagicMock(side_effect = get_extruder) + return result + +def test_startEndGCode_replace(cura_application, extruder_manager, original_gcode, expected_gcode): + formatter = GcodeStartEndFormatter(all_extruder_settings, -1, cura_application, extruder_manager) + assert formatter.format(original_gcode) == expected_gcode From 41bbf5a951e476e1eca140ef5686776bae9caa43 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Fri, 6 Sep 2024 10:41:19 +0200 Subject: [PATCH 16/37] PP-519 Update printhead size for Factor 4 --- resources/definitions/ultimaker_factor4.def.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/definitions/ultimaker_factor4.def.json b/resources/definitions/ultimaker_factor4.def.json index 573b26cf50..5945d3a262 100644 --- a/resources/definitions/ultimaker_factor4.def.json +++ b/resources/definitions/ultimaker_factor4.def.json @@ -112,10 +112,10 @@ "machine_head_with_fans_polygon": { "default_value": [ - [-30, -80], - [-30, 20], - [50, 20], - [50, -80] + [-35, -80], + [-35, 30], + [55, 30], + [55, -80] ] }, "machine_heated_bed": { "default_value": true }, From 5bff7067b0b28d0e17a81e2ecea8ff17d41a964a Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 6 Sep 2024 12:19:58 +0200 Subject: [PATCH 17/37] Remove the tooltip over the G-Code area CURA-12093 In this context, the tooltip is quite useless, and causes some issues because it sometimes appears when you don't want to. Moreover, the next commit will add a link to a detailed documentation. --- resources/qml/MachineSettings/GcodeTextArea.qml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml index 2538cd9f65..05d3711bae 100644 --- a/resources/qml/MachineSettings/GcodeTextArea.qml +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -12,20 +12,16 @@ import Cura 1.1 as Cura // // TextArea widget for editing Gcode in the Machine Settings dialog. // -UM.TooltipArea +Item { id: control UM.I18nCatalog { id: catalog; name: "cura"; } - text: tooltip - property alias containerStackId: propertyProvider.containerStackId property alias settingKey: propertyProvider.key property alias settingStoreIndex: propertyProvider.storeIndex - property string tooltip: propertyProvider.properties.description ? propertyProvider.properties.description : "" - property alias labelText: titleLabel.text property alias labelFont: titleLabel.font From 370c8e49c3100f63070df149afe2fb71ffe40e4e Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 6 Sep 2024 12:20:27 +0200 Subject: [PATCH 18/37] Add a link to the documentation to write start/end GCode CURA-12093 --- .../MachineSettingsExtruderTab.qml | 16 ++++++++++++++-- .../MachineSettingsPrinterTab.qml | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml index 5e1ddc2f3f..ab7442bd4e 100644 --- a/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml @@ -182,7 +182,7 @@ Item Cura.GcodeTextArea // "Extruder Start G-code" { anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.bottom: buttonLearnMore.top anchors.bottomMargin: UM.Theme.getSize("default_margin").height anchors.left: parent.left width: base.columnWidth - UM.Theme.getSize("default_margin").width @@ -196,7 +196,7 @@ Item Cura.GcodeTextArea // "Extruder End G-code" { anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.bottom: buttonLearnMore.top anchors.bottomMargin: UM.Theme.getSize("default_margin").height anchors.right: parent.right width: base.columnWidth - UM.Theme.getSize("default_margin").width @@ -206,5 +206,17 @@ Item settingKey: "machine_extruder_end_code" settingStoreIndex: propertyStoreIndex } + + Cura.TertiaryButton + { + id: buttonLearnMore + + text: catalog.i18nc("@button", "Learn more") + iconSource: UM.Theme.getIcon("LinkExternal") + isIconOnRightSide: true + onClicked: Qt.openUrlExternally("https://github.com/Ultimaker/Cura/wiki/Start-End-G%E2%80%90Code") + anchors.bottom: parent.bottom + anchors.right: parent.right + } } } diff --git a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml index 740e248828..b01060c1df 100644 --- a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml @@ -376,7 +376,7 @@ Item anchors { top: upperBlock.bottom - bottom: parent.bottom + bottom: buttonLearnMore.top left: parent.left right: parent.right margins: UM.Theme.getSize("default_margin").width @@ -403,5 +403,19 @@ Item settingKey: "machine_end_gcode" settingStoreIndex: propertyStoreIndex } + + } + + Cura.TertiaryButton + { + id: buttonLearnMore + + text: catalog.i18nc("@button", "Learn more") + iconSource: UM.Theme.getIcon("LinkExternal") + isIconOnRightSide: true + onClicked: Qt.openUrlExternally("https://github.com/Ultimaker/Cura/wiki/Start-End-G%E2%80%90Code") + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width } } From 48ddaa8861c4c39a4f9ee48afdfff06bffd691f9 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 6 Sep 2024 12:20:46 +0200 Subject: [PATCH 19/37] Add a comment so that we don't forget to update the doc CURA-12093 --- plugins/CuraEngineBackend/StartSliceJob.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 129bbbb5d1..43176744a0 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -563,6 +563,9 @@ class StartSliceJob(Job): result["day"] = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][int(time.strftime("%w"))] result["initial_extruder_nr"] = CuraApplication.getInstance().getExtruderManager().getInitialExtruderNr() + # If adding of changing a setting here, please update the associated wiki page + # https://github.com/Ultimaker/Cura/wiki/Start-End-G%E2%80%90Code + return result def _cacheAllExtruderSettings(self): From 101a637bbb8a363593cbd896aa65e314fdc2029f Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 10 Sep 2024 12:44:50 +0200 Subject: [PATCH 20/37] Apply typo fix suggestion Co-authored-by: Remco Burema <41987080+rburema@users.noreply.github.com> --- plugins/CuraEngineBackend/StartSliceJob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 43176744a0..1ef56c49e4 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -563,7 +563,7 @@ class StartSliceJob(Job): result["day"] = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][int(time.strftime("%w"))] result["initial_extruder_nr"] = CuraApplication.getInstance().getExtruderManager().getInitialExtruderNr() - # If adding of changing a setting here, please update the associated wiki page + # If adding or changing a setting here, please update the associated wiki page # https://github.com/Ultimaker/Cura/wiki/Start-End-G%E2%80%90Code return result From d74e0487cd2349d9380fc84230a280759d0d8930 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 10 Sep 2024 12:50:50 +0200 Subject: [PATCH 21/37] Apply suggestion to remove unnecessary extra arguments CURA-12093 --- plugins/CuraEngineBackend/StartSliceJob.py | 11 +++-------- tests/Machines/TestStartEndGCode.py | 4 +++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 1ef56c49e4..0789e8a684 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -78,17 +78,12 @@ class GcodeStartEndFormatter: _instruction_regex = re.compile(r"{(?Pif|else|elif|endif)?\s*(?P.*?)\s*(?:,\s*(?P.*))?\s*}(?P\n?)") - def __init__(self, - all_extruder_settings: Dict[str, Dict[str, Any]], - default_extruder_nr: int = -1, - cura_application: CuraApplication = None, - extruder_manager: ExtruderManager = None - ) -> None: + def __init__(self, all_extruder_settings: Dict[str, Dict[str, Any]], default_extruder_nr: int = -1) -> None: super().__init__() self._all_extruder_settings: Dict[str, Dict[str, Any]] = all_extruder_settings self._default_extruder_nr: int = default_extruder_nr - self._cura_application = cura_application if cura_application is not None else CuraApplication.getInstance() - self._extruder_manager = extruder_manager if extruder_manager is not None else ExtruderManager.getInstance() + self._cura_application = CuraApplication.getInstance() + self._extruder_manager = ExtruderManager.getInstance() def format(self, text: str) -> str: remaining_text: str = text diff --git a/tests/Machines/TestStartEndGCode.py b/tests/Machines/TestStartEndGCode.py index 05ee34e6bb..a14214fe7e 100644 --- a/tests/Machines/TestStartEndGCode.py +++ b/tests/Machines/TestStartEndGCode.py @@ -216,5 +216,7 @@ def extruder_manager(): return result def test_startEndGCode_replace(cura_application, extruder_manager, original_gcode, expected_gcode): - formatter = GcodeStartEndFormatter(all_extruder_settings, -1, cura_application, extruder_manager) + formatter = GcodeStartEndFormatter(all_extruder_settings, -1) + formatter._cura_application = cura_application + formatter._extruder_manager = extruder_manager assert formatter.format(original_gcode) == expected_gcode From b514f5928bb5082314b54ae825c691752d309f10 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 10 Sep 2024 18:16:24 +0200 Subject: [PATCH 22/37] Add failures cases to start/end gcode unit test CURA-12093 --- tests/Machines/TestStartEndGCode.py | 98 +++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 5 deletions(-) diff --git a/tests/Machines/TestStartEndGCode.py b/tests/Machines/TestStartEndGCode.py index a14214fe7e..13c14f5acc 100644 --- a/tests/Machines/TestStartEndGCode.py +++ b/tests/Machines/TestStartEndGCode.py @@ -47,12 +47,13 @@ extruder_1_provider = MockValueProvider(extruder_1_values) all_extruder_settings = {"-1": global_values, "0": extruder_0_values, "1": extruder_1_values} test_cases = [ - ('Static code', 'G0', 'G0'), + ('Static code', None, 'G0', 'G0'), - ('Basic replacement', 'M128 {bed_temperature}', 'M128 50.0'), + ('Basic replacement', None, 'M128 {bed_temperature}', 'M128 50.0'), ( 'Conditional expression with global setting', + None, '''{if bed_temperature > 30} G123 {else} @@ -64,6 +65,7 @@ G456 ( 'Conditional expression with extruder setting directly specified by index 0', + None, '''{if material_temperature > 200, 0} G10 {else} @@ -74,6 +76,7 @@ G20 ), ( 'Conditional expression with extruder setting directly specified by index 1', + None, '''{if material_temperature > 200, 1} G100 {else} @@ -85,6 +88,7 @@ G200 ( 'Conditional expression with extruder index specified by setting', + None, '''{if material_temperature > 200, initial_extruder} G1000 {else} @@ -96,6 +100,7 @@ G2000 ( 'Conditional expression with extruder index specified by formula', + None, '''{if material_temperature > 200, (initial_extruder + 1) % 2} X1000 {else} @@ -107,6 +112,7 @@ X2000 ( 'Conditional expression with elsif', + None, '''{if bed_temperature < 30} T30 {elif bed_temperature >= 30 and bed_temperature < 40} @@ -126,6 +132,7 @@ T-800 ( 'Formula inside a conditional expression', + None, '''{if bed_temperature < 30} Z000 {else} @@ -137,6 +144,7 @@ Z{bed_temperature + 10} ( 'Other commands around conditional expression', + None, ''' R000 # My super initial command @@ -164,6 +172,7 @@ R357 X951 Y843''' ( 'Multiple conditional expressions', + None, ''' A999 {if bed_temperature > 30} @@ -185,6 +194,80 @@ A000 A888 A300 A777 +''' + ), + + ( + 'Nested condition expression', + SyntaxError, +'''{if bed_temperature < 30} +{if material_temperature < 30, 0} +M000 +{else} +M888 +{endif} +{else} +M{bed_temperature + 10} +{endif}''', + '' + ), + + ( + 'Wrong condition expression', + SyntaxError, +'''{of material_temperature > 200, 1} +G100 +{else} +G200 +{endif}''', + '' + ), + + ( + 'Condition expression without start', + SyntaxError, +''' +W100 +{else} +W200 +{endif}''', + '' + ), + + ( + 'Formula with non-existing variable', + None, + '{material_storage_temperature}', + '0' + ), + + ( + 'Missing formula end character', + None, + '{material_temperature, 0', + '{material_temperature, 0' + ), + + ( + 'Conditional expression with missing end character', + SyntaxError, +'''{if material_temperature > 200, 0 +Q1000 +{else} +Q2000 +{endif}''', + '' + ), + +( + 'Unexpected end character', + None, +'''{if material_temperature > 200, 0}} +S1000 +{else} +S2000 +{endif}''', +'''S2000 ''' ), ] @@ -193,7 +276,7 @@ def pytest_generate_tests(metafunc): if "original_gcode" in metafunc.fixturenames: tests_ids = [test[0] for test in test_cases] tests_data = [test[1:] for test in test_cases] - metafunc.parametrize("original_gcode, expected_gcode", tests_data, ids = tests_ids) + metafunc.parametrize("exception_type, original_gcode, expected_gcode", tests_data, ids = tests_ids) @pytest.fixture def cura_application(): @@ -215,8 +298,13 @@ def extruder_manager(): result.getExtruderStack = MagicMock(side_effect = get_extruder) return result -def test_startEndGCode_replace(cura_application, extruder_manager, original_gcode, expected_gcode): +def test_startEndGCode_replace(cura_application, extruder_manager, exception_type, original_gcode, expected_gcode): formatter = GcodeStartEndFormatter(all_extruder_settings, -1) formatter._cura_application = cura_application formatter._extruder_manager = extruder_manager - assert formatter.format(original_gcode) == expected_gcode + + if exception_type is not None: + with pytest.raises(exception_type): + formatter.format(original_gcode) + else: + assert formatter.format(original_gcode) == expected_gcode From 3945465e5008ca237ca9a470f56107395fe7c29d Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 10 Sep 2024 18:21:24 +0200 Subject: [PATCH 23/37] Fix stupid deprecated GitHb actions CURA-12093 --- .github/workflows/printer-linter-format.yml | 2 +- .github/workflows/printer-linter-pr-diagnose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/printer-linter-format.yml b/.github/workflows/printer-linter-format.yml index 8e65a481c4..d8e136f156 100644 --- a/.github/workflows/printer-linter-format.yml +++ b/.github/workflows/printer-linter-format.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: diff --git a/.github/workflows/printer-linter-pr-diagnose.yml b/.github/workflows/printer-linter-pr-diagnose.yml index ed51f8b2f8..e70cabce7d 100644 --- a/.github/workflows/printer-linter-pr-diagnose.yml +++ b/.github/workflows/printer-linter-pr-diagnose.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 @@ -55,7 +55,7 @@ jobs: echo ${{ github.event.pull_request.head.repo.full_name }} > printer-linter-result/pr-head-repo.txt echo ${{ github.event.pull_request.head.sha }} > printer-linter-result/pr-head-sha.txt - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: printer-linter-result path: printer-linter-result/ From 78394faf657b176e0071d2671777efea8a631546 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Thu, 12 Sep 2024 11:02:59 +0200 Subject: [PATCH 24/37] Remove from actions --- resources/qml/Actions.qml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 7acf39ecb2..0c673a9409 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -62,7 +62,6 @@ Item property alias showProfileFolder: showProfileFolderAction property alias documentation: documentationAction - property alias showTroubleshooting: showTroubleShootingAction property alias openSponsershipPage: openSponsershipPageAction property alias reportBug: reportBugAction property alias whatsNew: whatsNewAction @@ -86,14 +85,6 @@ Item UM.I18nCatalog{id: catalog; name: "cura"} - - Action - { - id: showTroubleShootingAction - onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting") - text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting") - } - Action { id: openSponsershipPageAction From a0c111c6f5db7d6fc37c337cf1cad27df4c358a1 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Thu, 12 Sep 2024 11:03:07 +0200 Subject: [PATCH 25/37] Remove from menu --- resources/qml/Menus/HelpMenu.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml index 6a57a99515..c257db0527 100644 --- a/resources/qml/Menus/HelpMenu.qml +++ b/resources/qml/Menus/HelpMenu.qml @@ -14,7 +14,6 @@ Cura.Menu title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") Cura.MenuItem { action: Cura.Actions.showProfileFolder } - Cura.MenuItem { action: Cura.Actions.showTroubleshooting} Cura.MenuItem { action: Cura.Actions.documentation } Cura.MenuItem { action: Cura.Actions.reportBug } Cura.MenuItem { action: Cura.Actions.openSponsershipPage } From 9b86f80a0e9122d98f975fa8fc38fe95f033ea8f Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 18 Sep 2024 15:38:55 +0200 Subject: [PATCH 26/37] Don't generate release description according to input --- .github/workflows/release-process_release-candidate.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release-process_release-candidate.yml b/.github/workflows/release-process_release-candidate.yml index d14701d278..961fe1ed49 100644 --- a/.github/workflows/release-process_release-candidate.yml +++ b/.github/workflows/release-process_release-candidate.yml @@ -9,6 +9,11 @@ on: required: true type: string + publish_release_description: + description: 'Publish the description of the release based on the changelog' + required: true + type: bool + jobs: parse-version: name: Parse input version string @@ -153,6 +158,7 @@ jobs: ref: ${{ needs.parse-version.outputs.branch_name }} - name: Extract changelog + if: ${{ inputs.publish_release_description }} run: python ./scripts/extract_changelog.py --version ${{ needs.parse-version.outputs.version_major }}.${{ needs.parse-version.outputs.version_minor }}.${{ needs.parse-version.outputs.version_patch }} --changelog ./resources/texts/change_log.txt > formatted_changelog.txt - name: Create release From 5373d6fe5438a7afa420c5f0bd04611d408c67c9 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 18 Sep 2024 15:42:44 +0200 Subject: [PATCH 27/37] Set proper input type --- .github/workflows/release-process_release-candidate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-process_release-candidate.yml b/.github/workflows/release-process_release-candidate.yml index 961fe1ed49..978209d0d2 100644 --- a/.github/workflows/release-process_release-candidate.yml +++ b/.github/workflows/release-process_release-candidate.yml @@ -12,7 +12,7 @@ on: publish_release_description: description: 'Publish the description of the release based on the changelog' required: true - type: bool + type: boolean jobs: parse-version: From b334717a11c3319844583377a4be85775adf6a5a Mon Sep 17 00:00:00 2001 From: rburema Date: Wed, 18 Sep 2024 15:50:10 +0000 Subject: [PATCH 28/37] Applied printer-linter format --- .../ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg | 5 +++-- .../quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg | 4 ++-- .../quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg | 4 ++-- .../quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg | 4 ++-- .../quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg | 4 ++-- .../quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg | 4 ++-- .../quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg index 61097b4bed..37e9bb8b73 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.15mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 @@ -40,3 +40,4 @@ support_offset = 3 support_xy_distance = 2 support_z_distance = 0 switch_extruder_prime_speed = 10.0 + diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg index 3c6b85079b..4c83276641 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.1mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg index 6c6f1a7955..93f62df983 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.2mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg index 1cca9ee3d8..0d946c0092 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.4_pva_0.3mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg index 4a6144c06c..148a82c991 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.2mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg index 402fe9642d..8ab2146046 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.3mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 diff --git a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg index bad9ccb92c..52134575b0 100644 --- a/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg +++ b/resources/quality/ultimaker_factor4/um_f4_bb0.8_pva_0.4mm.inst.cfg @@ -20,11 +20,11 @@ build_volume_temperature = =40 if extruders_enabled_count > 1 else 35 default_material_bed_temperature = =0 if extruders_enabled_count > 1 else 60 gradual_flow_discretisation_step_size = 0.1 gradual_flow_enabled = True -initial_layer_line_width_factor = 125 -max_flow_acceleration = 1 gradual_support_infill_steps = 0 +initial_layer_line_width_factor = 125 jerk_print = 10 material_flow_layer_0 = 90 +max_flow_acceleration = 1 minimum_support_area = 4 prime_tower_flow = 90 prime_tower_min_volume = 15 From 5bbb2fca6556836bbeb310f92939e94a0e1619e2 Mon Sep 17 00:00:00 2001 From: Paul Kuiper <46715907+pkuiper-ultimaker@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:56:35 +0200 Subject: [PATCH 29/37] Hard limit iso warning on bed temperatures above 120C PP-324 --- resources/definitions/ultimaker.def.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/definitions/ultimaker.def.json b/resources/definitions/ultimaker.def.json index 21e905fdf8..14c7f6d0e0 100644 --- a/resources/definitions/ultimaker.def.json +++ b/resources/definitions/ultimaker.def.json @@ -70,14 +70,12 @@ "machine_max_feedrate_e": { "default_value": 45 }, "material_bed_temperature": { - "maximum_value": "140", - "maximum_value_warning": "120", + "maximum_value": "120", "minimum_value": "0" }, "material_bed_temperature_layer_0": { - "maximum_value": "140", - "maximum_value_warning": "120", + "maximum_value": "120", "minimum_value": "0" }, "material_print_temp_wait": { "value": false }, From f0cbd8e8024c3e3716af156b42a00ee726622e93 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 19 Sep 2024 11:00:09 +0200 Subject: [PATCH 30/37] Restore lost change after an errored merge This reverts commit 946bf033066e561827da4d00afbc3b680cd7e552. --- .github/ISSUE_TEMPLATE/SlicingCrash.yaml | 6 +- conandata.yml | 2 +- cura/API/Interface/Settings.py | 62 +++++++++- cura/PrinterOutput/FormatMaps.py | 106 ++++++++++++++++++ .../Models/ExtruderConfigurationModel.py | 15 +-- .../Models/MaterialOutputModel.py | 30 +---- .../NetworkedPrinterOutputDevice.py | 13 +-- plugins/3MFWriter/ThreeMFWriter.py | 16 +-- plugins/CuraEngineBackend/StartSliceJob.py | 7 +- plugins/MakerbotWriter/MakerbotWriter.py | 27 ++++- plugins/UFPWriter/UFPWriter.py | 58 +--------- .../XmlMaterialProfile/XmlMaterialProfile.py | 30 +---- .../definitions/Mark2_for_Ultimaker2.def.json | 1 - resources/definitions/atom3.def.json | 1 - resources/definitions/creality_crm4.def.json | 18 +++ resources/definitions/diy220.def.json | 1 - resources/definitions/dxu.def.json | 1 - resources/definitions/erzay3d.def.json | 1 - resources/definitions/fdmextruder.def.json | 11 ++ resources/definitions/fdmprinter.def.json | 54 +++++++-- resources/definitions/maker_starter.def.json | 1 - resources/definitions/mendel90.def.json | 1 - ...tur3d_discov3ry1_complete_um2plus.def.json | 1 - resources/definitions/tam.def.json | 1 - resources/definitions/ultimaker2.def.json | 1 - .../definitions/ultimaker2_plus.def.json | 1 - .../ultimaker2_plus_connect.def.json | 1 - resources/extruders/Mark2_extruder1.def.json | 1 + resources/extruders/Mark2_extruder2.def.json | 1 + resources/extruders/atom3_extruder_0.def.json | 1 + .../extruders/diy220_extruder_0.def.json | 1 + resources/extruders/dxu_extruder1.def.json | 1 + resources/extruders/dxu_extruder2.def.json | 1 + .../extruders/erzay3d_extruder_0.def.json | 1 + .../maker_starter_extruder_0.def.json | 1 + .../extruders/mendel90_extruder_0.def.json | 1 + ...v3ry1_complete_um2plus_extruder_0.def.json | 1 + resources/extruders/tam_extruder_0.def.json | 1 + .../extruders/ultimaker2_extruder_0.def.json | 1 + ...ltimaker2_plus_connect_extruder_0.def.json | 1 + .../ultimaker2_plus_extruder_0.def.json | 1 + resources/i18n/cura.pot | 4 +- .../texts}/product_to_id.json | 0 43 files changed, 320 insertions(+), 165 deletions(-) create mode 100644 cura/PrinterOutput/FormatMaps.py create mode 100644 resources/definitions/creality_crm4.def.json rename {plugins/XmlMaterialProfile => resources/texts}/product_to_id.json (100%) diff --git a/.github/ISSUE_TEMPLATE/SlicingCrash.yaml b/.github/ISSUE_TEMPLATE/SlicingCrash.yaml index 0d93977627..06025886a2 100644 --- a/.github/ISSUE_TEMPLATE/SlicingCrash.yaml +++ b/.github/ISSUE_TEMPLATE/SlicingCrash.yaml @@ -6,9 +6,9 @@ body: attributes: value: | ### ✨Try our improved Cura 5.7✨ - Before filling out the report below, we want you to try the latest Cura 5.7 Beta. + Before filling out the report below, we want you to try the latest Cura 5.7. This version of Cura has become significantly more reliable and has an updated slicing engine that will automatically send a report to the Cura Team for analysis. - #### [You can find the downloads here](https://github.com/Ultimaker/Cura/releases/tag/5.7.0-beta.1) #### + #### [You can find the downloads here](https://github.com/Ultimaker/Cura/releases/latest) #### If you still encounter a crash you are still welcome to report the issue so we can use your model as a test case, you can find instructions on how to do that below. ### Project File @@ -35,7 +35,7 @@ body: - type: markdown attributes: value: | - We work hard on improving our slicing crashes. Our most recent release is 5.6.0. + We work hard on improving our slicing crashes. Our most recent release is 5.7.1. If you are not on the latest version of Cura, [you can download it here](https://github.com/Ultimaker/Cura/releases/latest) - type: input attributes: diff --git a/conandata.yml b/conandata.yml index 4faaed19c1..eda0a7c164 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,4 +1,4 @@ -version: "5.8.1" +version: "5.9.0-alpha.0" requirements: - "cura_resources/(latest)@ultimaker/testing" - "uranium/(latest)@ultimaker/testing" diff --git a/cura/API/Interface/Settings.py b/cura/API/Interface/Settings.py index 706a6d8c74..084023b9bd 100644 --- a/cura/API/Interface/Settings.py +++ b/cura/API/Interface/Settings.py @@ -1,7 +1,13 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from typing import TYPE_CHECKING +from dataclasses import asdict + +from typing import cast, Dict, TYPE_CHECKING + +from UM.Settings.InstanceContainer import InstanceContainer +from UM.Settings.SettingFunction import SettingFunction +from cura.Settings.GlobalStack import GlobalStack if TYPE_CHECKING: from cura.CuraApplication import CuraApplication @@ -47,3 +53,57 @@ class Settings: """ return self.application.getSidebarCustomMenuItems() + + def getSliceMetadata(self) -> Dict[str, Dict[str, Dict[str, str]]]: + """Get all changed settings and all settings. For each extruder and the global stack""" + print_information = self.application.getPrintInformation() + machine_manager = self.application.getMachineManager() + settings = { + "material": { + "length": print_information.materialLengths, + "weight": print_information.materialWeights, + "cost": print_information.materialCosts, + }, + "global": { + "changes": {}, + "all_settings": {}, + }, + "quality": asdict(machine_manager.activeQualityDisplayNameMap()), + } + + def _retrieveValue(container: InstanceContainer, setting_: str): + value_ = container.getProperty(setting_, "value") + for _ in range(0, 1024): # Prevent possibly endless loop by not using a limit. + if not isinstance(value_, SettingFunction): + return value_ # Success! + value_ = value_(container) + return 0 # Fallback value after breaking possibly endless loop. + + global_stack = cast(GlobalStack, self.application.getGlobalContainerStack()) + + # Add global user or quality changes + global_flattened_changes = InstanceContainer.createMergedInstanceContainer(global_stack.userChanges, global_stack.qualityChanges) + for setting in global_flattened_changes.getAllKeys(): + settings["global"]["changes"][setting] = _retrieveValue(global_flattened_changes, setting) + + # Get global all settings values without user or quality changes + for setting in global_stack.getAllKeys(): + settings["global"]["all_settings"][setting] = _retrieveValue(global_stack, setting) + + for i, extruder in enumerate(global_stack.extruderList): + # Add extruder fields to settings dictionary + settings[f"extruder_{i}"] = { + "changes": {}, + "all_settings": {}, + } + + # Add extruder user or quality changes + extruder_flattened_changes = InstanceContainer.createMergedInstanceContainer(extruder.userChanges, extruder.qualityChanges) + for setting in extruder_flattened_changes.getAllKeys(): + settings[f"extruder_{i}"]["changes"][setting] = _retrieveValue(extruder_flattened_changes, setting) + + # Get extruder all settings values without user or quality changes + for setting in extruder.getAllKeys(): + settings[f"extruder_{i}"]["all_settings"][setting] = _retrieveValue(extruder, setting) + + return settings diff --git a/cura/PrinterOutput/FormatMaps.py b/cura/PrinterOutput/FormatMaps.py new file mode 100644 index 0000000000..b8ad4df2a2 --- /dev/null +++ b/cura/PrinterOutput/FormatMaps.py @@ -0,0 +1,106 @@ +# Copyright (c) 2024 UltiMaker +# Cura is released under the terms of the LGPLv3 or higher. + +from UM.Resources import Resources + +import json +from typing import Dict, List, Optional + +class FormatMaps: + + # A map from the printer-type in their native file-formats to the internal name we use. + PRINTER_TYPE_NAME = { + "fire_e": "ultimaker_method", + "lava_f": "ultimaker_methodx", + "magma_10": "ultimaker_methodxl", + "sketch": "ultimaker_sketch" + } + + # A map from the extruder-name in their native file-formats to the internal name we use. + EXTRUDER_NAME_MAP = { + "mk14_hot": "1XA", + "mk14_hot_s": "2XA", + "mk14_c": "1C", + "mk14": "1A", + "mk14_s": "2A", + "mk14_e": "LABS" + } + + # A map from the material-name in their native file-formats to some info, including the internal name we use. + MATERIAL_MAP = { + "abs": {"name": "ABS", "guid": "2780b345-577b-4a24-a2c5-12e6aad3e690"}, + "abs-cf10": {"name": "ABS-CF", "guid": "495a0ce5-9daf-4a16-b7b2-06856d82394d"}, + "abs-wss1": {"name": "ABS-R", "guid": "88c8919c-6a09-471a-b7b6-e801263d862d"}, + "asa": {"name": "ASA", "guid": "f79bc612-21eb-482e-ad6c-87d75bdde066"}, + "nylon12-cf": {"name": "Nylon 12 CF", "guid": "3c6f2877-71cc-4760-84e6-4b89ab243e3b"}, + "nylon": {"name": "Nylon", "guid": "283d439a-3490-4481-920c-c51d8cdecf9c"}, + "pc": {"name": "PC", "guid": "62414577-94d1-490d-b1e4-7ef3ec40db02"}, + "petg": {"name": "PETG", "guid": "69386c85-5b6c-421a-bec5-aeb1fb33f060"}, + "pla": {"name": "PLA", "guid": "abb9c58e-1f56-48d1-bd8f-055fde3a5b56"}, + "pva": {"name": "PVA", "guid": "add51ef2-86eb-4c39-afd5-5586564f0715"}, + "wss1": {"name": "RapidRinse", "guid": "a140ef8f-4f26-4e73-abe0-cfc29d6d1024"}, + "sr30": {"name": "SR-30", "guid": "77873465-83a9-4283-bc44-4e542b8eb3eb"}, + "bvoh": {"name": "BVOH", "guid": "923e604c-8432-4b09-96aa-9bbbd42207f4"}, + "cpe": {"name": "CPE", "guid": "da1872c1-b991-4795-80ad-bdac0f131726"}, + "hips": {"name": "HIPS", "guid": "a468d86a-220c-47eb-99a5-bbb47e514eb0"}, + "tpu": {"name": "TPU 95A", "guid": "19baa6a9-94ff-478b-b4a1-8157b74358d2"}, + "im-pla": {"name": "Tough", "guid": "de031137-a8ca-4a72-bd1b-17bb964033ad"} + } + + __inverse_printer_name: Optional[Dict[str, str]] = None + __inverse_extruder_type: Optional[Dict[str, str]] = None + __inverse_material_map: Optional[Dict[str, str]] = None + __product_to_id_map: Optional[Dict[str, List[str]]] = None + + @classmethod + def getInversePrinterNameMap(cls) -> Dict[str, str]: + """Returns the inverse of the printer name map, that is, from the internal name to the name used in output.""" + if cls.__inverse_printer_name is not None: + return cls.__inverse_printer_name + cls.__inverse_printer_name = {} + for key, value in cls.PRINTER_TYPE_NAME.items(): + cls.__inverse_printer_name[value] = key + return cls.__inverse_printer_name + + @classmethod + def getInverseExtruderTypeMap(cls) -> Dict[str, str]: + """Returns the inverse of the extruder type map, that is, from the internal name to the name used in output.""" + if cls.__inverse_extruder_type is not None: + return cls.__inverse_extruder_type + cls.__inverse_extruder_type = {} + for key, value in cls.EXTRUDER_NAME_MAP.items(): + cls.__inverse_extruder_type[value] = key + return cls.__inverse_extruder_type + + @classmethod + def getInverseMaterialMap(cls) -> Dict[str, str]: + """Returns the inverse of the material map, that is, from the internal name to the name used in output. + + Note that this drops the extra info saved in the non-inverse material map, use that if you need it. + """ + if cls.__inverse_material_map is not None: + return cls.__inverse_material_map + cls.__inverse_material_map = {} + for key, value in cls.MATERIAL_MAP.items(): + cls.__inverse_material_map[value["name"]] = key + return cls.__inverse_material_map + + @classmethod + def getProductIdMap(cls) -> Dict[str, List[str]]: + """Gets a mapping from product names (for example, in the XML files) to their definition IDs. + + This loads the mapping from a file. + """ + if cls.__product_to_id_map is not None: + return cls.__product_to_id_map + + product_to_id_file = Resources.getPath(Resources.Texts, "product_to_id.json") + with open(product_to_id_file, encoding = "utf-8") as f: + contents = "" + for line in f: + contents += line if "#" not in line else "".join([line.replace("#", str(n)) for n in range(1, 12)]) + cls.__product_to_id_map = json.loads(contents) + cls.__product_to_id_map = {key: [value] for key, value in cls.__product_to_id_map.items()} + #This also loads "Ultimaker S5" -> "ultimaker_s5" even though that is not strictly necessary with the default to change spaces into underscores. + #However it is not always loaded with that default; this mapping is also used in serialize() without that default. + return cls.__product_to_id_map diff --git a/cura/PrinterOutput/Models/ExtruderConfigurationModel.py b/cura/PrinterOutput/Models/ExtruderConfigurationModel.py index ac924c684e..c5c480e224 100644 --- a/cura/PrinterOutput/Models/ExtruderConfigurationModel.py +++ b/cura/PrinterOutput/Models/ExtruderConfigurationModel.py @@ -1,9 +1,10 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2024 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from PyQt6.QtCore import pyqtProperty, QObject, pyqtSignal +from cura.PrinterOutput.FormatMaps import FormatMaps from .MaterialOutputModel import MaterialOutputModel @@ -45,16 +46,8 @@ class ExtruderConfigurationModel(QObject): @staticmethod def applyNameMappingHotend(hotendId) -> str: - _EXTRUDER_NAME_MAP = { - "mk14_hot":"1XA", - "mk14_hot_s":"2XA", - "mk14_c":"1C", - "mk14":"1A", - "mk14_s":"2A", - "mk14_e": "LABS" - } - if hotendId in _EXTRUDER_NAME_MAP: - return _EXTRUDER_NAME_MAP[hotendId] + if hotendId in FormatMaps.EXTRUDER_NAME_MAP: + return FormatMaps.EXTRUDER_NAME_MAP[hotendId] return hotendId @pyqtProperty(str, fset = setHotendID, notify = extruderConfigurationChanged) diff --git a/cura/PrinterOutput/Models/MaterialOutputModel.py b/cura/PrinterOutput/Models/MaterialOutputModel.py index 854226c6d4..8790d1626e 100644 --- a/cura/PrinterOutput/Models/MaterialOutputModel.py +++ b/cura/PrinterOutput/Models/MaterialOutputModel.py @@ -1,9 +1,10 @@ -# Copyright (c) 2017 Ultimaker B.V. +# Copyright (c) 2024 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from PyQt6.QtCore import pyqtProperty, QObject +from cura.PrinterOutput.FormatMaps import FormatMaps class MaterialOutputModel(QObject): @@ -23,30 +24,9 @@ class MaterialOutputModel(QObject): @staticmethod def getMaterialFromDefinition(guid, type, brand, name): - - _MATERIAL_MAP = { "abs" :{"name" :"ABS" ,"guid": "2780b345-577b-4a24-a2c5-12e6aad3e690"}, - "abs-cf10" :{"name": "ABS-CF" ,"guid": "495a0ce5-9daf-4a16-b7b2-06856d82394d"}, - "abs-wss1" :{"name" :"ABS-R" ,"guid": "88c8919c-6a09-471a-b7b6-e801263d862d"}, - "asa" :{"name" :"ASA" ,"guid": "f79bc612-21eb-482e-ad6c-87d75bdde066"}, - "nylon12-cf":{"name": "Nylon 12 CF" ,"guid": "3c6f2877-71cc-4760-84e6-4b89ab243e3b"}, - "nylon" :{"name" :"Nylon" ,"guid": "283d439a-3490-4481-920c-c51d8cdecf9c"}, - "pc" :{"name" :"PC" ,"guid": "62414577-94d1-490d-b1e4-7ef3ec40db02"}, - "petg" :{"name" :"PETG" ,"guid": "69386c85-5b6c-421a-bec5-aeb1fb33f060"}, - "pla" :{"name" :"PLA" ,"guid": "abb9c58e-1f56-48d1-bd8f-055fde3a5b56"}, - "pva" :{"name" :"PVA" ,"guid": "add51ef2-86eb-4c39-afd5-5586564f0715"}, - "wss1" :{"name" :"RapidRinse" ,"guid": "a140ef8f-4f26-4e73-abe0-cfc29d6d1024"}, - "sr30" :{"name" :"SR-30" ,"guid": "77873465-83a9-4283-bc44-4e542b8eb3eb"}, - "bvoh" :{"name" :"BVOH" ,"guid": "923e604c-8432-4b09-96aa-9bbbd42207f4"}, - "cpe" :{"name" :"CPE" ,"guid": "da1872c1-b991-4795-80ad-bdac0f131726"}, - "hips" :{"name" :"HIPS" ,"guid": "a468d86a-220c-47eb-99a5-bbb47e514eb0"}, - "tpu" :{"name" :"TPU 95A" ,"guid": "19baa6a9-94ff-478b-b4a1-8157b74358d2"}, - "im-pla" :{"name": "Tough" ,"guid": "de031137-a8ca-4a72-bd1b-17bb964033ad"} - } - - - if guid is None and brand != "empty" and type in _MATERIAL_MAP: - name = _MATERIAL_MAP[type]["name"] - guid = _MATERIAL_MAP[type]["guid"] + if guid is None and brand != "empty" and type in FormatMaps.MATERIAL_MAP: + name = FormatMaps.MATERIAL_MAP[type]["name"] + guid = FormatMaps.MATERIAL_MAP[type]["guid"] return name, guid diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index 2a683966db..3dc245d468 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Ultimaker B.V. +# Copyright (c) 2024 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. from UM.FileHandler.FileHandler import FileHandler #For typing. @@ -6,6 +6,7 @@ from UM.Logger import Logger from UM.Scene.SceneNode import SceneNode #For typing. from cura.API import Account from cura.CuraApplication import CuraApplication +from cura.PrinterOutput.FormatMaps import FormatMaps from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState, ConnectionType @@ -419,14 +420,8 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): @staticmethod def applyPrinterTypeMapping(printer_type): - _PRINTER_TYPE_NAME = { - "fire_e": "ultimaker_method", - "lava_f": "ultimaker_methodx", - "magma_10": "ultimaker_methodxl", - "sketch": "ultimaker_sketch" - } - if printer_type in _PRINTER_TYPE_NAME: - return _PRINTER_TYPE_NAME[printer_type] + if printer_type in FormatMaps.PRINTER_TYPE_NAME: + return FormatMaps.PRINTER_TYPE_NAME[printer_type] return printer_type @pyqtProperty(str, constant = True) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index 5a9fa487fc..a3eb43ca32 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -114,22 +114,24 @@ class ThreeMFWriter(MeshWriter): mesh_data = um_node.getMeshData() + node_matrix = um_node.getLocalTransformation() + node_matrix.preMultiply(transformation) + if center_mesh: - node_matrix = Matrix() + center_matrix = Matrix() # compensate for original center position, if object(s) is/are not around its zero position if mesh_data is not None: extents = mesh_data.getExtents() if extents is not None: # We use a different coordinate space while writing, so flip Z and Y - center_vector = Vector(extents.center.x, extents.center.y, extents.center.z) - node_matrix.setByTranslation(center_vector) - node_matrix.multiply(um_node.getLocalTransformation()) - else: - node_matrix = um_node.getLocalTransformation() + center_vector = Vector(-extents.center.x, -extents.center.y, -extents.center.z) + center_matrix.setByTranslation(center_vector) + node_matrix.preMultiply(center_matrix) - matrix_string = ThreeMFWriter._convertMatrixToString(node_matrix.preMultiply(transformation)) + matrix_string = ThreeMFWriter._convertMatrixToString(node_matrix) savitar_node.setTransformation(matrix_string) + if mesh_data is not None: savitar_node.getMeshData().setVerticesFromBytes(mesh_data.getVerticesAsByteArray()) indices_array = mesh_data.getIndicesAsByteArray() diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 7ece7b30a1..0789e8a684 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -454,7 +454,12 @@ class StartSliceJob(Job): for extruder_stack in global_stack.extruderList: self._buildExtruderMessage(extruder_stack) - for plugin in CuraApplication.getInstance().getBackendPlugins(): + backend_plugins = CuraApplication.getInstance().getBackendPlugins() + + # Sort backend plugins by name. Not a very good strategy, but at least it is repeatable. This will be improved later. + backend_plugins = sorted(backend_plugins, key=lambda backend_plugin: backend_plugin.getId()) + + for plugin in backend_plugins: if not plugin.usePlugin(): continue for slot in plugin.getSupportedSlots(): diff --git a/plugins/MakerbotWriter/MakerbotWriter.py b/plugins/MakerbotWriter/MakerbotWriter.py index 43595bbf24..34ef562fd3 100644 --- a/plugins/MakerbotWriter/MakerbotWriter.py +++ b/plugins/MakerbotWriter/MakerbotWriter.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 UltiMaker +# Copyright (c) 2024 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. from io import StringIO, BufferedIOBase import json @@ -18,6 +18,7 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.i18n import i18nCatalog from cura.CuraApplication import CuraApplication +from cura.PrinterOutput.FormatMaps import FormatMaps from cura.Snapshot import Snapshot from cura.Utils.Threading import call_on_qt_thread from cura.CuraVersion import ConanInstalls @@ -137,6 +138,30 @@ class MakerbotWriter(MeshWriter): for png_file in png_files: file, data = png_file["file"], png_file["data"] zip_stream.writestr(file, data) + api = CuraApplication.getInstance().getCuraAPI() + metadata_json = api.interface.settings.getSliceMetadata() + + # All the mapping stuff we have to do: + product_to_id_map = FormatMaps.getProductIdMap() + printer_name_map = FormatMaps.getInversePrinterNameMap() + extruder_type_map = FormatMaps.getInverseExtruderTypeMap() + material_map = FormatMaps.getInverseMaterialMap() + for key, value in metadata_json.items(): + if "all_settings" in value: + if "machine_name" in value["all_settings"]: + machine_name = value["all_settings"]["machine_name"] + if machine_name in product_to_id_map: + machine_name = product_to_id_map[machine_name][0] + value["all_settings"]["machine_name"] = printer_name_map.get(machine_name, machine_name) + if "machine_nozzle_id" in value["all_settings"]: + extruder_type = value["all_settings"]["machine_nozzle_id"] + value["all_settings"]["machine_nozzle_id"] = extruder_type_map.get(extruder_type, extruder_type) + if "material_type" in value["all_settings"]: + material_type = value["all_settings"]["material_type"] + value["all_settings"]["material_type"] = material_map.get(material_type, material_type) + + slice_metadata = json.dumps(metadata_json, separators=(", ", ": "), indent=4) + zip_stream.writestr("slicemetadata.json", slice_metadata) except (IOError, OSError, BadZipFile) as ex: Logger.log("e", f"Could not write to (.makerbot) file because: '{ex}'.") self.setInformation(catalog.i18nc("@error", "MakerbotWriter could not save to the designated path.")) diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py index 475e5fc01a..0cf756b6a4 100644 --- a/plugins/UFPWriter/UFPWriter.py +++ b/plugins/UFPWriter/UFPWriter.py @@ -24,6 +24,7 @@ from UM.Settings.InstanceContainer import InstanceContainer from cura.CuraApplication import CuraApplication from cura.Settings.GlobalStack import GlobalStack from cura.Utils.Threading import call_on_qt_thread +from cura.API import CuraAPI from UM.i18n import i18nCatalog @@ -85,7 +86,8 @@ class UFPWriter(MeshWriter): try: archive.addContentType(extension="json", mime_type="application/json") setting_textio = StringIO() - json.dump(self._getSliceMetadata(), setting_textio, separators=(", ", ": "), indent=4) + api = CuraApplication.getInstance().getCuraAPI() + json.dump(api.interface.settings.getSliceMetadata(), setting_textio, separators=(", ", ": "), indent=4) steam = archive.getStream(SLICE_METADATA_PATH) steam.write(setting_textio.getvalue().encode("UTF-8")) except EnvironmentError as e: @@ -210,57 +212,3 @@ class UFPWriter(MeshWriter): return [{"name": item.getName()} for item in DepthFirstIterator(node) if item.getMeshData() is not None and not item.callDecoration("isNonPrintingMesh")] - - def _getSliceMetadata(self) -> Dict[str, Dict[str, Dict[str, str]]]: - """Get all changed settings and all settings. For each extruder and the global stack""" - print_information = CuraApplication.getInstance().getPrintInformation() - machine_manager = CuraApplication.getInstance().getMachineManager() - settings = { - "material": { - "length": print_information.materialLengths, - "weight": print_information.materialWeights, - "cost": print_information.materialCosts, - }, - "global": { - "changes": {}, - "all_settings": {}, - }, - "quality": asdict(machine_manager.activeQualityDisplayNameMap()), - } - - def _retrieveValue(container: InstanceContainer, setting_: str): - value_ = container.getProperty(setting_, "value") - for _ in range(0, 1024): # Prevent possibly endless loop by not using a limit. - if not isinstance(value_, SettingFunction): - return value_ # Success! - value_ = value_(container) - return 0 # Fallback value after breaking possibly endless loop. - - global_stack = cast(GlobalStack, Application.getInstance().getGlobalContainerStack()) - - # Add global user or quality changes - global_flattened_changes = InstanceContainer.createMergedInstanceContainer(global_stack.userChanges, global_stack.qualityChanges) - for setting in global_flattened_changes.getAllKeys(): - settings["global"]["changes"][setting] = _retrieveValue(global_flattened_changes, setting) - - # Get global all settings values without user or quality changes - for setting in global_stack.getAllKeys(): - settings["global"]["all_settings"][setting] = _retrieveValue(global_stack, setting) - - for i, extruder in enumerate(global_stack.extruderList): - # Add extruder fields to settings dictionary - settings[f"extruder_{i}"] = { - "changes": {}, - "all_settings": {}, - } - - # Add extruder user or quality changes - extruder_flattened_changes = InstanceContainer.createMergedInstanceContainer(extruder.userChanges, extruder.qualityChanges) - for setting in extruder_flattened_changes.getAllKeys(): - settings[f"extruder_{i}"]["changes"][setting] = _retrieveValue(extruder_flattened_changes, setting) - - # Get extruder all settings values without user or quality changes - for setting in extruder.getAllKeys(): - settings[f"extruder_{i}"]["all_settings"][setting] = _retrieveValue(extruder, setting) - - return settings diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index d054f05485..13111c1c7a 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -17,6 +17,7 @@ from UM.Settings.ContainerRegistry import ContainerRegistry from UM.ConfigurationErrorMessage import ConfigurationErrorMessage from cura.CuraApplication import CuraApplication +from cura.PrinterOutput.FormatMaps import FormatMaps from cura.Machines.VariantType import VariantType try: @@ -249,7 +250,7 @@ class XmlMaterialProfile(InstanceContainer): machine_variant_map[definition_id][variant_name] = variant_dict # Map machine human-readable names to IDs - product_id_map = self.getProductIdMap() + product_id_map = FormatMaps.getProductIdMap() for definition_id, container in machine_container_map.items(): definition_id = container.getMetaDataEntry("definition") @@ -647,7 +648,7 @@ class XmlMaterialProfile(InstanceContainer): self._dirty = False # Map machine human-readable names to IDs - product_id_map = self.getProductIdMap() + product_id_map = FormatMaps.getProductIdMap() machines = data.iterfind("./um:settings/um:machine", self.__namespaces) for machine in machines: @@ -923,7 +924,7 @@ class XmlMaterialProfile(InstanceContainer): result_metadata.append(base_metadata) # Map machine human-readable names to IDs - product_id_map = cls.getProductIdMap() + product_id_map = FormatMaps.getProductIdMap() for machine in data.iterfind("./um:settings/um:machine", cls.__namespaces): machine_compatibility = common_compatibility @@ -1127,29 +1128,6 @@ class XmlMaterialProfile(InstanceContainer): id_list = list(id_list) return id_list - __product_to_id_map: Optional[Dict[str, List[str]]] = None - - @classmethod - def getProductIdMap(cls) -> Dict[str, List[str]]: - """Gets a mapping from product names in the XML files to their definition IDs. - - This loads the mapping from a file. - """ - if cls.__product_to_id_map is not None: - return cls.__product_to_id_map - - plugin_path = cast(str, PluginRegistry.getInstance().getPluginPath("XmlMaterialProfile")) - product_to_id_file = os.path.join(plugin_path, "product_to_id.json") - with open(product_to_id_file, encoding = "utf-8") as f: - contents = "" - for line in f: - contents += line if "#" not in line else "".join([line.replace("#", str(n)) for n in range(1, 12)]) - cls.__product_to_id_map = json.loads(contents) - cls.__product_to_id_map = {key: [value] for key, value in cls.__product_to_id_map.items()} - #This also loads "Ultimaker S5" -> "ultimaker_s5" even though that is not strictly necessary with the default to change spaces into underscores. - #However it is not always loaded with that default; this mapping is also used in serialize() without that default. - return cls.__product_to_id_map - @staticmethod def _parseCompatibleValue(value: str): """Parse the value of the "material compatible" property.""" diff --git a/resources/definitions/Mark2_for_Ultimaker2.def.json b/resources/definitions/Mark2_for_Ultimaker2.def.json index 789d5d42ec..dab45dd80c 100644 --- a/resources/definitions/Mark2_for_Ultimaker2.def.json +++ b/resources/definitions/Mark2_for_Ultimaker2.def.json @@ -130,7 +130,6 @@ "machine_min_cool_heat_time_window": { "default_value": 15.0 }, "machine_name": { "default_value": "Mark2_for_Ultimaker2" }, "machine_nozzle_cool_down_speed": { "default_value": 1.5 }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_heat_up_speed": { "default_value": 3.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "machine_show_variants": { "default_value": true }, diff --git a/resources/definitions/atom3.def.json b/resources/definitions/atom3.def.json index c9b54d2f89..6fab25a96d 100644 --- a/resources/definitions/atom3.def.json +++ b/resources/definitions/atom3.def.json @@ -65,7 +65,6 @@ "machine_heated_bed": { "default_value": true }, "machine_height": { "default_value": 340 }, "machine_name": { "default_value": "Atom 3" }, - "machine_nozzle_head_distance": { "default_value": 6 }, "machine_shape": { "default_value": "elliptic" }, "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "default_value": ";MACHINE START CODE\nG21 ;metric values\nG90 ;absolute positioning\nG28 ;home\nG1 Z5 F9000\n;MACHINE START CODE" }, diff --git a/resources/definitions/creality_crm4.def.json b/resources/definitions/creality_crm4.def.json new file mode 100644 index 0000000000..89ab3ed04c --- /dev/null +++ b/resources/definitions/creality_crm4.def.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "name": "Creality CR-M4", + "inherits": "creality_base", + "metadata": + { + "visible": true, + "quality_definition": "creality_base" + }, + "overrides": + { + "gantry_height": { "value": 35 }, + "machine_depth": { "default_value": 450 }, + "machine_height": { "default_value": 470 }, + "machine_name": { "default_value": "Creality CR-M4" }, + "machine_width": { "default_value": 450 } + } +} \ No newline at end of file diff --git a/resources/definitions/diy220.def.json b/resources/definitions/diy220.def.json index f4c2e41364..ea3e89ab04 100644 --- a/resources/definitions/diy220.def.json +++ b/resources/definitions/diy220.def.json @@ -35,7 +35,6 @@ "machine_max_feedrate_y": { "default_value": 300 }, "machine_max_feedrate_z": { "default_value": 40 }, "machine_name": { "default_value": "Diytech 220" }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "default_value": "G21\nG90\nM82\nM107\nG28\nG1 Z15 F200\nT0\nG92 E0\nG1 E16 F250\nG92 E0\n" }, "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, diff --git a/resources/definitions/dxu.def.json b/resources/definitions/dxu.def.json index c5eb9720f3..117edf43db 100644 --- a/resources/definitions/dxu.def.json +++ b/resources/definitions/dxu.def.json @@ -122,7 +122,6 @@ "machine_name": { "default_value": "dxu" }, "machine_nozzle_cool_down_speed": { "default_value": 1.5 }, "machine_nozzle_expansion_angle": { "default_value": 45 }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_heat_up_speed": { "default_value": 3.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "machine_show_variants": { "default_value": true }, diff --git a/resources/definitions/erzay3d.def.json b/resources/definitions/erzay3d.def.json index 5baadf32e4..af5784e4e6 100644 --- a/resources/definitions/erzay3d.def.json +++ b/resources/definitions/erzay3d.def.json @@ -44,7 +44,6 @@ "machine_max_jerk_xy": { "default_value": 10 }, "machine_max_jerk_z": { "default_value": 10 }, "machine_name": { "default_value": "Erzay3D" }, - "machine_nozzle_head_distance": { "default_value": 2.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "machine_shape": { "default_value": "elliptic" }, "machine_start_gcode": { "default_value": "G28\nG1 Z15.0 F6000\nG92 E0" }, diff --git a/resources/definitions/fdmextruder.def.json b/resources/definitions/fdmextruder.def.json index f60cf63360..101efee3b1 100644 --- a/resources/definitions/fdmextruder.def.json +++ b/resources/definitions/fdmextruder.def.json @@ -167,6 +167,17 @@ "type": "float", "unit": "mm" }, + "machine_nozzle_head_distance": + { + "default_value": 3, + "description": "The height difference between the tip of the nozzle and the lowest part of the print head.", + "label": "Nozzle Length", + "settable_per_extruder": true, + "settable_per_mesh": false, + "settable_per_meshgroup": false, + "type": "float", + "unit": "mm" + }, "machine_nozzle_id": { "default_value": "unknown", diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 48e013aa16..571d501212 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -28,6 +28,18 @@ "icon": "Printer", "children": { + "build_volume_fan_nr": + { + "label": "Build volume fan number", + "description": "The number of the fan that cools the build volume. If this is set to 0, it's means that there is no build volume fan", + "default_value": 0, + "minimum_value": "0", + "maximum_value": "999999", + "type": "int", + "settable_per_mesh": false, + "settable_per_extruder": false, + "settable_per_meshgroup": false + }, "machine_name": { "label": "Machine Type", @@ -289,17 +301,6 @@ "settable_per_meshgroup": false, "settable_globally": false }, - "machine_nozzle_head_distance": - { - "label": "Nozzle Length", - "description": "The height difference between the tip of the nozzle and the lowest part of the print head.", - "unit": "mm", - "default_value": 3, - "type": "float", - "settable_per_mesh": false, - "settable_per_extruder": true, - "settable_per_meshgroup": false - }, "machine_nozzle_expansion_angle": { "label": "Nozzle Angle", @@ -4545,6 +4546,37 @@ "settable_per_mesh": false, "settable_per_extruder": true }, + "build_fan_full_at_height": + { + "label": "Build Fan Speed at Height", + "description": "The height at which the fans spin on regular fan speed. At the layers below the fan speed gradually increases from Initial Fan Speed to Regular Fan Speed.", + "unit": "mm", + "type": "float", + "default_value": 0, + "minimum_value": "0", + "enabled": "build_volume_fan_nr != 0", + "maximum_value_warning": "10.0", + "settable_per_mesh": false, + "settable_per_extruder": false, + "settable_per_meshgroup": false, + "children": + { + "build_fan_full_layer": + { + "label": "Build Fan Speed at Layer", + "description": "The layer at which the build fans spin on full fan speed. This value is calculated and rounded to a whole number.", + "type": "int", + "default_value": 0, + "minimum_value": "0", + "enabled": "build_volume_fan_nr != 0", + "maximum_value_warning": "10 / resolveOrValue('layer_height')", + "value": "max(1, int(math.floor((build_fan_full_at_height - resolveOrValue('layer_height_0')) / resolveOrValue('layer_height')) + 2))", + "settable_per_mesh": false, + "settable_per_extruder": false, + "settable_per_meshgroup": false + } + } + }, "cool_fan_speed": { "label": "Fan Speed", diff --git a/resources/definitions/maker_starter.def.json b/resources/definitions/maker_starter.def.json index e654ee0915..5e5f9dcb5b 100644 --- a/resources/definitions/maker_starter.def.json +++ b/resources/definitions/maker_starter.def.json @@ -27,7 +27,6 @@ "machine_heated_bed": { "default_value": false }, "machine_height": { "default_value": 200 }, "machine_name": { "default_value": "3DMaker Starter" }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_width": { "default_value": 210 }, "raft_airgap": { "default_value": 0.2 }, diff --git a/resources/definitions/mendel90.def.json b/resources/definitions/mendel90.def.json index 57e1276e6a..d8619fe276 100644 --- a/resources/definitions/mendel90.def.json +++ b/resources/definitions/mendel90.def.json @@ -37,7 +37,6 @@ "machine_heated_bed": { "default_value": true }, "machine_height": { "default_value": 200 }, "machine_name": { "default_value": "Mendel90" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;absolute extrusion\nM107 ;start with the fan off\nG28 ;home\nG92 E0 ;zero the extruded length\nM140 S{material_bed_temperature_layer_0} ; set the bed temperature and continue on\nG1 X-50 Y98 F9000 ;go to the left of the top\nG1 Z0.05 ; close to the bed\nM104 S{material_print_temperature_layer_0}; pre-heat the extruder continue on\nM190 S{material_bed_temperature_layer_0} ;set the bed temp & wait\nM109 S{material_print_temperature_layer_0};set the extruder temp for layer 0 & wait\nG92 E0 ;zero the extruded length\nG1 X50 E10 F300 ; make a thick line to prime extruder\nG92 E0 ; reset extruder\nG1 E-4 F1800\nG1 Z0.3 ;lift Z\n" }, "machine_width": { "default_value": 200 }, diff --git a/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json b/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json index c013c49e05..722f4dade5 100644 --- a/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json +++ b/resources/definitions/structur3d_discov3ry1_complete_um2plus.def.json @@ -78,7 +78,6 @@ "machine_heat_zone_length": { "default_value": 20 }, "machine_height": { "default_value": 205 }, "machine_name": { "default_value": "Discov3ry Complete (Ultimaker 2+)" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "default_value": "\n;Updated Firmware (.hex and Marlin .ino) for \n;Ultimaker 2+ with Discov3ry Extruder available at: \n;https://github.com/Structur3d/UM2.1Discov3ry-Firmware-beta \n;**Learn more at https://www.structur3d.io** \n \nM104 S{material_print_temperature} ;Start heating extruder \nM140 S{material_bed_temperature} ;Start heating bed \nG21 ;metric values \nG90 ;absolute positioning \nM82 ;set extruder to absolute mode \nM107 ;start with the fan off \nM302 ;allow cold extrusion \nM92 E2589 ;set extruder EEPROM steps/mm for paste \nG28 Z0 ;move Z to bottom endstops \nG28 X0 Y0 ;move X/Y to endstops \nG1 X15 Y0 F4000 ;move X/Y to front of printer \nG1 Z15.0 F9000 ;move the platform to 15mm \nG92 E0 ;zero the extruded length \nG1 F200 E10 ;extrude 10 mm of feed stock \nG92 E0 ;zero the extruded length again \nG1 F9000 \n;Put printing message on LCD screen \nM117 Printing..." }, "machine_width": { "default_value": 205 }, diff --git a/resources/definitions/tam.def.json b/resources/definitions/tam.def.json index 84bbc9c8fb..01437cebe7 100644 --- a/resources/definitions/tam.def.json +++ b/resources/definitions/tam.def.json @@ -44,7 +44,6 @@ "machine_max_acceleration_y": { "default_value": 6000 }, "machine_max_acceleration_z": { "default_value": 12000 }, "machine_name": { "default_value": "TypeAMachines" }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "default_value": ";-- START GCODE --\n;Sliced for Type A Machines Series 1\n;Sliced at: {day} {date} {time}\n;Basic settings:\n;Layer height: {layer_height}\n;Walls: {wall_thickness}\n;Fill: {fill_distance}\n;Print Speed: {print_speed}\n;Support: {support}\n;Retraction Speed: {retraction_speed}\n;Retraction Distance: {retraction_amount}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Settings based on: {material_profile}\nG21 ;metric values\nG90 ;absolute positioning\nG28 ;move to endstops\nG29 ;allows for auto-levelling\nG1 Z15.0 F12000 ;move the platform down 15mm\nG1 X150 Y5 F9000 ;center\nM140 S{material_bed_temperature} ;Prep Heat Bed\nM109 S{default_material_print_temperature} ;Heat To temp\nM190 S{material_bed_temperature} ;Heat Bed to temp\nG1 X150 Y5 Z0.3 ;move the platform to purge extrusion\nG92 E0 ;zero the extruded length\nG1 F200 X250 E30 ;extrude 30mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 X150 Y150 Z25 F12000 ;recenter and begin\nG1 F9000" }, "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index 8c0e066cd1..d749c96a00 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -95,7 +95,6 @@ "machine_max_feedrate_y": { "default_value": 300 }, "machine_max_feedrate_z": { "default_value": 40 }, "machine_name": { "default_value": "Ultimaker 2" }, - "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, "machine_start_gcode": { "value": "\"G0 F3000 Y50 ;avoid prime blob\" if machine_gcode_flavor == \"UltiGCode\" else \"G21 ;metric values\\nG90 ;absolute positioning\\nM82 ;set extruder to absolute mode\\nM107 ;start with the fan off\\nG28 Z0 ;move Z to bottom endstops\\nG28 X0 Y0 ;move X/Y to endstops\\nG1 X15 Y0 F4000 ;move X/Y to front of printer\\nG1 Z15.0 F9000 ;move the platform to 15mm\\nG92 E0 ;zero the extruded length\\nG1 F200 E10 ;extrude 10 mm of feed stock\\nG92 E0 ;zero the extruded length again\\nG1 Y50 F9000\\n;Put printing message on LCD screen\\nM117 Printing...\"" }, "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, diff --git a/resources/definitions/ultimaker2_plus.def.json b/resources/definitions/ultimaker2_plus.def.json index b5ad30bb8d..c06d8b1e68 100644 --- a/resources/definitions/ultimaker2_plus.def.json +++ b/resources/definitions/ultimaker2_plus.def.json @@ -83,7 +83,6 @@ "machine_heat_zone_length": { "default_value": 20 }, "machine_height": { "default_value": 205 }, "machine_name": { "default_value": "Ultimaker 2+" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_show_variants": { "default_value": true }, "speed_infill": { "value": "speed_print" }, "speed_support": { "value": "speed_wall_0" }, diff --git a/resources/definitions/ultimaker2_plus_connect.def.json b/resources/definitions/ultimaker2_plus_connect.def.json index 8aae2d4c19..6cdd3e9705 100644 --- a/resources/definitions/ultimaker2_plus_connect.def.json +++ b/resources/definitions/ultimaker2_plus_connect.def.json @@ -92,7 +92,6 @@ "machine_heat_zone_length": { "default_value": 20 }, "machine_height": { "default_value": 205 }, "machine_name": { "default_value": "Ultimaker 2+ Connect" }, - "machine_nozzle_head_distance": { "default_value": 5 }, "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "value": "''" }, "machine_width": { "default_value": 223 }, diff --git a/resources/extruders/Mark2_extruder1.def.json b/resources/extruders/Mark2_extruder1.def.json index 89992ad450..9617678f7e 100644 --- a/resources/extruders/Mark2_extruder1.def.json +++ b/resources/extruders/Mark2_extruder1.def.json @@ -14,6 +14,7 @@ "default_value": 0, "maximum_value": "1" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 } } diff --git a/resources/extruders/Mark2_extruder2.def.json b/resources/extruders/Mark2_extruder2.def.json index 967e32d8b8..b0ea604fbb 100644 --- a/resources/extruders/Mark2_extruder2.def.json +++ b/resources/extruders/Mark2_extruder2.def.json @@ -14,6 +14,7 @@ "default_value": 1, "maximum_value": "1" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 } } diff --git a/resources/extruders/atom3_extruder_0.def.json b/resources/extruders/atom3_extruder_0.def.json index ccc7a0bd6b..fc51a8cf03 100644 --- a/resources/extruders/atom3_extruder_0.def.json +++ b/resources/extruders/atom3_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 6 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/diy220_extruder_0.def.json b/resources/extruders/diy220_extruder_0.def.json index 4d802b4a8d..ab271d1006 100644 --- a/resources/extruders/diy220_extruder_0.def.json +++ b/resources/extruders/diy220_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/dxu_extruder1.def.json b/resources/extruders/dxu_extruder1.def.json index de974b8174..b44f79fdac 100644 --- a/resources/extruders/dxu_extruder1.def.json +++ b/resources/extruders/dxu_extruder1.def.json @@ -14,6 +14,7 @@ "default_value": 0, "maximum_value": "1" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 }, "machine_nozzle_size": { "default_value": 0.4 }, diff --git a/resources/extruders/dxu_extruder2.def.json b/resources/extruders/dxu_extruder2.def.json index b4de471289..358bc69dae 100644 --- a/resources/extruders/dxu_extruder2.def.json +++ b/resources/extruders/dxu_extruder2.def.json @@ -14,6 +14,7 @@ "default_value": 1, "maximum_value": "1" }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_offset_x": { "default_value": 19.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 }, "machine_nozzle_size": { "default_value": 0.4 }, diff --git a/resources/extruders/erzay3d_extruder_0.def.json b/resources/extruders/erzay3d_extruder_0.def.json index a4082a6224..8ba6c573f3 100644 --- a/resources/extruders/erzay3d_extruder_0.def.json +++ b/resources/extruders/erzay3d_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 2.5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/maker_starter_extruder_0.def.json b/resources/extruders/maker_starter_extruder_0.def.json index 1a8877f8ef..4154b00862 100644 --- a/resources/extruders/maker_starter_extruder_0.def.json +++ b/resources/extruders/maker_starter_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/mendel90_extruder_0.def.json b/resources/extruders/mendel90_extruder_0.def.json index 0701164a65..b04e2d2fe9 100644 --- a/resources/extruders/mendel90_extruder_0.def.json +++ b/resources/extruders/mendel90_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json b/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json index 0258f9da9c..ec25298a5c 100644 --- a/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json +++ b/resources/extruders/structur3d_discov3ry1_complete_um2plus_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.84 }, "material_diameter": { "default_value": 3.175 } } diff --git a/resources/extruders/tam_extruder_0.def.json b/resources/extruders/tam_extruder_0.def.json index b606474ff0..4e5cbe4216 100644 --- a/resources/extruders/tam_extruder_0.def.json +++ b/resources/extruders/tam_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 } } diff --git a/resources/extruders/ultimaker2_extruder_0.def.json b/resources/extruders/ultimaker2_extruder_0.def.json index 17d0d425df..3432ace596 100644 --- a/resources/extruders/ultimaker2_extruder_0.def.json +++ b/resources/extruders/ultimaker2_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 3 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 2.85 } } diff --git a/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json b/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json index 0b74aae019..9ad61af313 100644 --- a/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json +++ b/resources/extruders/ultimaker2_plus_connect_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 2.85 } } diff --git a/resources/extruders/ultimaker2_plus_extruder_0.def.json b/resources/extruders/ultimaker2_plus_extruder_0.def.json index 3fec85805e..ace4b5b813 100644 --- a/resources/extruders/ultimaker2_plus_extruder_0.def.json +++ b/resources/extruders/ultimaker2_plus_extruder_0.def.json @@ -10,6 +10,7 @@ "overrides": { "extruder_nr": { "default_value": 0 }, + "machine_nozzle_head_distance": { "default_value": 5 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 2.85 } } diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 8bf8688e0e..24a5221f4f 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -215,14 +215,14 @@ msgstr "" msgctxt "@label crash message" msgid "" -"

A fatal error has occurred in Cura. Please send us this Crash Report to fix the problem

\n" +"

A fatal error has occurred in Cura. Please send us this Crash Report to fix the problem

\n" "

Please use the \"Send report\" button to post a bug report automatically to our servers

\n" " " msgstr "" msgctxt "@label crash message" msgid "" -"

Oops, UltiMaker Cura has encountered something that doesn't seem right.

\n" +"

Oops, UltiMaker Cura has encountered something that doesn't seem right.

\n" "

We encountered an unrecoverable error during start up. It was possibly caused by some incorrect configuration files. We suggest to backup and reset your configuration.

\n" "

Backups can be found in the configuration folder.

\n" "

Please send us this Crash Report to fix the problem.

\n" diff --git a/plugins/XmlMaterialProfile/product_to_id.json b/resources/texts/product_to_id.json similarity index 100% rename from plugins/XmlMaterialProfile/product_to_id.json rename to resources/texts/product_to_id.json From 4419c6b2ccacf5aadf127a38de5d0422e8eaac71 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Thu, 19 Sep 2024 13:13:15 +0200 Subject: [PATCH 31/37] Re-introduce the 0.2mm to prevent break --- .../um_f4_aa0.8_tpu_0.2mm.inst.cfg | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg diff --git a/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg new file mode 100644 index 0000000000..c3291f77a1 --- /dev/null +++ b/resources/quality/ultimaker_factor4/um_f4_aa0.8_tpu_0.2mm.inst.cfg @@ -0,0 +1,24 @@ +[general] +definition = ultimaker_factor4 +name = Fast +version = 4 + +[metadata] +material = generic_tpu +quality_type = draft +setting_version = 23 +type = quality +variant = AA 0.8 +weight = -2 + +[values] +gradual_flow_discretisation_step_size = 0.1 +gradual_flow_enabled = True +infill_pattern = ='zigzag' if infill_sparse_density > 50 else 'cross_3d' +infill_sparse_density = 10 +inset_direction = outside_in +max_flow_acceleration = 1 +skin_material_flow = =material_flow * 0.9 +skin_material_flow_layer_0 = 90 +speed_layer_0 = 20 + From fa636c235bb6873841f8680380c919da6590c4ed Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 19 Sep 2024 13:36:24 +0200 Subject: [PATCH 32/37] Set explicit empty description when not published --- .github/workflows/release-process_release-candidate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-process_release-candidate.yml b/.github/workflows/release-process_release-candidate.yml index 978209d0d2..8851d1b9f6 100644 --- a/.github/workflows/release-process_release-candidate.yml +++ b/.github/workflows/release-process_release-candidate.yml @@ -169,8 +169,8 @@ jobs: strategy: replace title: UltiMaker Cura ${{ inputs.cura_version }} draft: true - body-source: file - body: formatted_changelog.txt + body-source: ${{ inputs.publish_release_description && 'file' || 'literal' }} + body: ${{ inputs.publish_release_description && 'formatted_changelog.txt' || '' }} - name: Download artifacts uses: actions/download-artifact@v4.1.7 From 41c734498faaf7d52e5cac36cf5222e9bf47b52e Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 19 Sep 2024 15:53:06 +0200 Subject: [PATCH 33/37] Don't re-create the release if not necessary --- .github/workflows/release-process_release-candidate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-process_release-candidate.yml b/.github/workflows/release-process_release-candidate.yml index 8851d1b9f6..62051a0809 100644 --- a/.github/workflows/release-process_release-candidate.yml +++ b/.github/workflows/release-process_release-candidate.yml @@ -163,14 +163,15 @@ jobs: - name: Create release uses: notpeelz/action-gh-create-release@v5.0.1 + if: ${{ inputs.publish_release_description }} with: target: ${{ needs.create-tags.outputs.main_commit }} tag: ${{ inputs.cura_version }} strategy: replace title: UltiMaker Cura ${{ inputs.cura_version }} draft: true - body-source: ${{ inputs.publish_release_description && 'file' || 'literal' }} - body: ${{ inputs.publish_release_description && 'formatted_changelog.txt' || '' }} + body-source: file + body: formatted_changelog.txt - name: Download artifacts uses: actions/download-artifact@v4.1.7 From efa91dd094df5d096a298550e1de8a1168a399f1 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Fri, 20 Sep 2024 08:45:23 +0200 Subject: [PATCH 34/37] Update conandata.yml --- resources/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/conandata.yml b/resources/conandata.yml index 7d5a43c891..9e4e8b5271 100644 --- a/resources/conandata.yml +++ b/resources/conandata.yml @@ -1 +1 @@ -version: "5.8.1" +version: "5.9.0-alpha.0" From 5261936c4e37d296605dcdb510bf159a09c1c156 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 20 Sep 2024 10:11:27 +0200 Subject: [PATCH 35/37] Make description more explicit --- .github/workflows/release-process_release-candidate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-process_release-candidate.yml b/.github/workflows/release-process_release-candidate.yml index 62051a0809..1afb8aad04 100644 --- a/.github/workflows/release-process_release-candidate.yml +++ b/.github/workflows/release-process_release-candidate.yml @@ -10,7 +10,7 @@ on: type: string publish_release_description: - description: 'Publish the description of the release based on the changelog' + description: 'Create the GitHub release (if existing, the description will be overridden based on the changelog)' required: true type: boolean From 74cafe1c4b84a7be6321e6fd4197de18aa97afae Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 24 Sep 2024 08:55:29 +0200 Subject: [PATCH 36/37] Handle message too big error when sending model data to engine CURA-11103 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index dd7987bc42..a7126af14e 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -197,7 +197,8 @@ class CuraEngineBackend(QObject, Backend): self._slicing_error_message.actionTriggered.connect(self._reportBackendError) self._resetLastSliceTimeStats() - self._snapshot: Optional[QImage] = None + self._snapshot: Optional[QImage] = None + self._last_socket_error: Optional[Arcus.Error] = None application.initializationFinished.connect(self.initialize) @@ -569,7 +570,19 @@ class CuraEngineBackend(QObject, Backend): return # Preparation completed, send it to the backend. - self._socket.sendMessage(job.getSliceMessage()) + if not self._socket.sendMessage(job.getSliceMessage()): + if self._last_socket_error is not None and self._last_socket_error.getErrorCode() == Arcus.ErrorCode.MessageTooBigError: + error_txt = catalog.i18nc("@info:status", "Unable to send the model data to the engine. Please try to use a less detailed model, or reduce the number of instances.") + else: + error_txt = catalog.i18nc("@info:status", "Unable to send the model data to the engine. Please try again, or contact support.") + + self._error_message = Message(error_txt, + title=catalog.i18nc("@info:title", "Unable to slice"), + message_type=Message.MessageType.WARNING) + self._error_message.show() + self.setState(BackendState.Error) + self.backendError.emit(job) + return # Notify the user that it's now up to the backend to do its job self.setState(BackendState.Processing) @@ -691,6 +704,7 @@ class CuraEngineBackend(QObject, Backend): if error.getErrorCode() == Arcus.ErrorCode.Debug: return + self._last_socket_error = error self._terminate() self._createSocket() From eb963d7cbff3c46728a657d6fbbc36f2e8ec7fb9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 25 Sep 2024 14:18:49 +0200 Subject: [PATCH 37/37] Add supress signals when renaming profiles This fixes the situation where sometimes a signal was emitted while we were still in the process of changing things CURA-6842 --- cura/Machines/Models/QualityManagementModel.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cura/Machines/Models/QualityManagementModel.py b/cura/Machines/Models/QualityManagementModel.py index 86e35f6b28..92551dbddf 100644 --- a/cura/Machines/Models/QualityManagementModel.py +++ b/cura/Machines/Models/QualityManagementModel.py @@ -127,13 +127,12 @@ class QualityManagementModel(ListModel): # have no container for the global stack, because "my_profile" just got renamed to "my_new_profile". This results # in crashes because the rest of the system assumes that all data in a QualityChangesGroup will be correct. # - # Renaming the container for the global stack in the end seems to be ok, because the assumption is mostly based - # on the quality changes container for the global stack. + # This is why we use the "supress_signals" flag for the set name. This basically makes the change silent. for metadata in quality_changes_group.metadata_per_extruder.values(): extruder_container = cast(InstanceContainer, container_registry.findContainers(id = metadata["id"])[0]) - extruder_container.setName(new_name) + extruder_container.setName(new_name, supress_signals=True) global_container = cast(InstanceContainer, container_registry.findContainers(id = quality_changes_group.metadata_for_global["id"])[0]) - global_container.setName(new_name) + global_container.setName(new_name, supress_signals=True) quality_changes_group.name = new_name