From ab3d8349b6533987a7db9e57e11f28da32434d9a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 9 Aug 2017 09:24:02 +0200 Subject: [PATCH 1/6] Also skip empty containers when getting layer height for a quality profile CURA-4133 On some machines such as UM2, there is no material. Getting the layer height in this case will result back to the global stack itself, which is the layer height of the current setting. This is a problem for "Normal" (or "Fine") quality because it uses the machine's default layer height. --- cura/Settings/ProfilesModel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py index 18acb5e9e8..3775353143 100644 --- a/cura/Settings/ProfilesModel.py +++ b/cura/Settings/ProfilesModel.py @@ -108,9 +108,9 @@ class ProfilesModel(InstanceContainersModel): #Quality has no value for layer height either. Get the layer height from somewhere lower in the stack. skip_until_container = global_container_stack.material - if not skip_until_container: #No material in stack. + if not skip_until_container or skip_until_container == ContainerRegistry.getInstance().getEmptyInstanceContainer(): #No material in stack. skip_until_container = global_container_stack.variant - if not skip_until_container: #No variant in stack. + if not skip_until_container or skip_until_container == ContainerRegistry.getInstance().getEmptyInstanceContainer(): #No variant in stack. skip_until_container = global_container_stack.getBottom() item["layer_height"] = str(global_container_stack.getRawProperty("layer_height", "value", skip_until_container = skip_until_container.getId())) + unit #Fall through to the currently loaded material. yield item \ No newline at end of file From e4146212508c71348186a317aafa276018b2497c Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 9 Aug 2017 09:27:42 +0200 Subject: [PATCH 2/6] Fix code style --- cura/Settings/ProfilesModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py index 3775353143..545f44401a 100644 --- a/cura/Settings/ProfilesModel.py +++ b/cura/Settings/ProfilesModel.py @@ -113,4 +113,4 @@ class ProfilesModel(InstanceContainersModel): if not skip_until_container or skip_until_container == ContainerRegistry.getInstance().getEmptyInstanceContainer(): #No variant in stack. skip_until_container = global_container_stack.getBottom() item["layer_height"] = str(global_container_stack.getRawProperty("layer_height", "value", skip_until_container = skip_until_container.getId())) + unit #Fall through to the currently loaded material. - yield item \ No newline at end of file + yield item From c0d96a1d79bf8ef987f8870a895781ec89e2bbf4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 9 Aug 2017 09:46:00 +0200 Subject: [PATCH 3/6] Remove heat/cool speeds that are equal to default The default value for both of these settings in fdmprinter is 2. --- resources/definitions/101Hero.def.json | 2 -- resources/definitions/grr_neo.def.json | 6 ------ resources/definitions/kossel_mini.def.json | 6 ------ resources/definitions/kossel_pro.def.json | 6 ------ resources/definitions/makeR_pegasus.def.json | 6 ------ resources/definitions/makeR_prusa_tairona_i3.def.json | 6 ------ resources/definitions/makeit_pro_l.def.json | 6 ------ resources/definitions/makeit_pro_m.def.json | 6 ------ resources/definitions/maker_starter.def.json | 6 ------ resources/definitions/mankati_fullscale_xt_plus.def.json | 2 -- resources/definitions/mendel90.def.json | 6 ------ resources/definitions/printrbot_simple.def.json | 2 -- resources/definitions/printrbot_simple_extended.def.json | 2 -- resources/definitions/prusa_i3.def.json | 6 ------ resources/definitions/prusa_i3_mk2.def.json | 2 -- resources/definitions/prusa_i3_xl.def.json | 6 ------ resources/definitions/rigidbot.def.json | 6 ------ resources/definitions/rigidbot_big.def.json | 6 ------ resources/definitions/tam.def.json | 3 --- resources/definitions/ultimaker2.def.json | 6 ------ resources/definitions/ultimaker_original.def.json | 6 ------ resources/definitions/ultimaker_original_dual.def.json | 6 ------ resources/definitions/uniqbot_one.def.json | 6 ------ resources/definitions/vertex_k8400.def.json | 6 ------ resources/definitions/vertex_k8400_dual.def.json | 6 ------ 25 files changed, 127 deletions(-) diff --git a/resources/definitions/101Hero.def.json b/resources/definitions/101Hero.def.json index 205696c450..c629cb3769 100644 --- a/resources/definitions/101Hero.def.json +++ b/resources/definitions/101Hero.def.json @@ -28,8 +28,6 @@ "layer_height": { "default_value": 0.2 }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { "default_value": 2 }, - "machine_nozzle_cool_down_speed": { "default_value": 2 }, "machine_head_with_fans_polygon": { "default_value": [ [ 0, 0 ], diff --git a/resources/definitions/grr_neo.def.json b/resources/definitions/grr_neo.def.json index e2a4d47b78..d09126f3e4 100644 --- a/resources/definitions/grr_neo.def.json +++ b/resources/definitions/grr_neo.def.json @@ -30,12 +30,6 @@ "machine_nozzle_size": { "default_value": 0.5 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_polygon": { "default_value": [ [-75, -18], diff --git a/resources/definitions/kossel_mini.def.json b/resources/definitions/kossel_mini.def.json index 78ee3aac1e..e0e4665570 100644 --- a/resources/definitions/kossel_mini.def.json +++ b/resources/definitions/kossel_mini.def.json @@ -36,12 +36,6 @@ "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, diff --git a/resources/definitions/kossel_pro.def.json b/resources/definitions/kossel_pro.def.json index e8403a1727..c9dbd63a50 100644 --- a/resources/definitions/kossel_pro.def.json +++ b/resources/definitions/kossel_pro.def.json @@ -35,12 +35,6 @@ "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, diff --git a/resources/definitions/makeR_pegasus.def.json b/resources/definitions/makeR_pegasus.def.json index 561486c011..08f7702666 100644 --- a/resources/definitions/makeR_pegasus.def.json +++ b/resources/definitions/makeR_pegasus.def.json @@ -37,12 +37,6 @@ "material_diameter": { "default_value": 2.85 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_polygon": { "default_value": [ [-75, -18], diff --git a/resources/definitions/makeR_prusa_tairona_i3.def.json b/resources/definitions/makeR_prusa_tairona_i3.def.json index ab80fd0f5e..612497d012 100644 --- a/resources/definitions/makeR_prusa_tairona_i3.def.json +++ b/resources/definitions/makeR_prusa_tairona_i3.def.json @@ -37,12 +37,6 @@ "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_polygon": { "default_value": [ [-75, -18], diff --git a/resources/definitions/makeit_pro_l.def.json b/resources/definitions/makeit_pro_l.def.json index 32f65d2b99..30043cd906 100644 --- a/resources/definitions/makeit_pro_l.def.json +++ b/resources/definitions/makeit_pro_l.def.json @@ -35,12 +35,6 @@ "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_with_fans_polygon": { "default_value": [ diff --git a/resources/definitions/makeit_pro_m.def.json b/resources/definitions/makeit_pro_m.def.json index 7cae1d12ae..abaec4c81f 100644 --- a/resources/definitions/makeit_pro_m.def.json +++ b/resources/definitions/makeit_pro_m.def.json @@ -35,12 +35,6 @@ "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_with_fans_polygon": { "default_value": [ diff --git a/resources/definitions/maker_starter.def.json b/resources/definitions/maker_starter.def.json index 305a35d0ca..e4c09c75f2 100644 --- a/resources/definitions/maker_starter.def.json +++ b/resources/definitions/maker_starter.def.json @@ -33,12 +33,6 @@ "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "gantry_height": { "default_value": 55 }, diff --git a/resources/definitions/mankati_fullscale_xt_plus.def.json b/resources/definitions/mankati_fullscale_xt_plus.def.json index 65ed223f9e..c841859962 100644 --- a/resources/definitions/mankati_fullscale_xt_plus.def.json +++ b/resources/definitions/mankati_fullscale_xt_plus.def.json @@ -19,8 +19,6 @@ "machine_heated_bed": { "default_value": true }, "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { "default_value": 2 }, - "machine_nozzle_cool_down_speed": { "default_value": 2 }, "machine_head_with_fans_polygon": { "default_value": [ [ -3, 3 ], diff --git a/resources/definitions/mendel90.def.json b/resources/definitions/mendel90.def.json index cce0c3133a..fee035cdd9 100644 --- a/resources/definitions/mendel90.def.json +++ b/resources/definitions/mendel90.def.json @@ -62,12 +62,6 @@ "machine_heat_zone_length": { "default_value": 16 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2.0 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2.0 - }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, diff --git a/resources/definitions/printrbot_simple.def.json b/resources/definitions/printrbot_simple.def.json index b1af5f3baa..b0ece54f8f 100644 --- a/resources/definitions/printrbot_simple.def.json +++ b/resources/definitions/printrbot_simple.def.json @@ -22,8 +22,6 @@ "machine_center_is_zero": { "default_value": false }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { "default_value": 2 }, - "machine_nozzle_cool_down_speed": { "default_value": 2 }, "machine_head_with_fans_polygon": { "default_value": [ [-49, 20], diff --git a/resources/definitions/printrbot_simple_extended.def.json b/resources/definitions/printrbot_simple_extended.def.json index b464e06c7e..4cf9cb477c 100644 --- a/resources/definitions/printrbot_simple_extended.def.json +++ b/resources/definitions/printrbot_simple_extended.def.json @@ -22,8 +22,6 @@ "machine_center_is_zero": { "default_value": false }, "machine_nozzle_size": { "default_value": 0.4 }, "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { "default_value": 2 }, - "machine_nozzle_cool_down_speed": { "default_value": 2 }, "machine_head_with_fans_polygon": { "default_value": [ [ 55, -20 ], diff --git a/resources/definitions/prusa_i3.def.json b/resources/definitions/prusa_i3.def.json index 3b1adc5f00..307246dbc9 100644 --- a/resources/definitions/prusa_i3.def.json +++ b/resources/definitions/prusa_i3.def.json @@ -36,12 +36,6 @@ "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_polygon": { "default_value": [ [-75, -18], diff --git a/resources/definitions/prusa_i3_mk2.def.json b/resources/definitions/prusa_i3_mk2.def.json index e0c4475362..02af039867 100644 --- a/resources/definitions/prusa_i3_mk2.def.json +++ b/resources/definitions/prusa_i3_mk2.def.json @@ -31,8 +31,6 @@ "retraction_retract_speed": { "default_value": 35 }, "retraction_prime_speed": { "default_value": 35 }, "adhesion_type": { "default_value": "skirt" }, - "machine_nozzle_heat_up_speed": { "default_value": 2 }, - "machine_nozzle_cool_down_speed": { "default_value": 2 }, "machine_head_with_fans_polygon": { "default_value": [[-31,31],[34,31],[34,-40],[-31,-40]] }, "gantry_height": { "default_value": 28 }, "machine_max_feedrate_z": { "default_value": 12 }, diff --git a/resources/definitions/prusa_i3_xl.def.json b/resources/definitions/prusa_i3_xl.def.json index 7dcd6aceaf..9d792f8249 100644 --- a/resources/definitions/prusa_i3_xl.def.json +++ b/resources/definitions/prusa_i3_xl.def.json @@ -36,12 +36,6 @@ "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2.0 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2.0 - }, "machine_head_polygon": { "default_value": [ [-75, -18], diff --git a/resources/definitions/rigidbot.def.json b/resources/definitions/rigidbot.def.json index 7d083bb6f5..1f63af8758 100644 --- a/resources/definitions/rigidbot.def.json +++ b/resources/definitions/rigidbot.def.json @@ -26,12 +26,6 @@ "machine_heated_bed": { "default_value": true }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "gantry_height": { "default_value": 0 }, diff --git a/resources/definitions/rigidbot_big.def.json b/resources/definitions/rigidbot_big.def.json index 6ac84cbde1..8ba52303dd 100644 --- a/resources/definitions/rigidbot_big.def.json +++ b/resources/definitions/rigidbot_big.def.json @@ -29,12 +29,6 @@ "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "gantry_height": { "default_value": 0 }, diff --git a/resources/definitions/tam.def.json b/resources/definitions/tam.def.json index 6d085763ce..87dba5f027 100644 --- a/resources/definitions/tam.def.json +++ b/resources/definitions/tam.def.json @@ -43,9 +43,6 @@ "xy_offset": { "default_value": -0.01 }, - "machine_nozzle_heat_up_speed": { "default_value": 2 }, - "machine_nozzle_cool_down_speed": { "default_value": 2 }, - "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, "material_diameter": { "default_value": 1.75 }, diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index 5b2f339589..d8126f9488 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -56,12 +56,6 @@ "default_value": 0.4, "minimum_value": "0.001" }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "gantry_height": { "default_value": 48 }, diff --git a/resources/definitions/ultimaker_original.def.json b/resources/definitions/ultimaker_original.def.json index f3f188dd48..8a00e9ed1b 100644 --- a/resources/definitions/ultimaker_original.def.json +++ b/resources/definitions/ultimaker_original.def.json @@ -34,12 +34,6 @@ "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_with_fans_polygon": { "default_value": [ diff --git a/resources/definitions/ultimaker_original_dual.def.json b/resources/definitions/ultimaker_original_dual.def.json index e219a5ecb5..b047198225 100644 --- a/resources/definitions/ultimaker_original_dual.def.json +++ b/resources/definitions/ultimaker_original_dual.def.json @@ -39,12 +39,6 @@ "machine_nozzle_size": { "default_value": 0.4 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_head_with_fans_polygon": { "default_value": [ diff --git a/resources/definitions/uniqbot_one.def.json b/resources/definitions/uniqbot_one.def.json index a3ab5cc779..7ec5f162ea 100644 --- a/resources/definitions/uniqbot_one.def.json +++ b/resources/definitions/uniqbot_one.def.json @@ -34,12 +34,6 @@ "material_diameter": { "default_value": 1.75 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "gantry_height": { "default_value": 55 }, diff --git a/resources/definitions/vertex_k8400.def.json b/resources/definitions/vertex_k8400.def.json index 3d1ca2d1a9..ac7ccd5e93 100644 --- a/resources/definitions/vertex_k8400.def.json +++ b/resources/definitions/vertex_k8400.def.json @@ -65,12 +65,6 @@ "gantry_height": { "default_value": 18 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, diff --git a/resources/definitions/vertex_k8400_dual.def.json b/resources/definitions/vertex_k8400_dual.def.json index 7b5efcee9c..f6b3d6cfbb 100644 --- a/resources/definitions/vertex_k8400_dual.def.json +++ b/resources/definitions/vertex_k8400_dual.def.json @@ -70,12 +70,6 @@ "gantry_height": { "default_value": 18 }, - "machine_nozzle_heat_up_speed": { - "default_value": 2 - }, - "machine_nozzle_cool_down_speed": { - "default_value": 2 - }, "machine_extruder_count": { "default_value": 2 }, From 6fd3963e8fec683adc3ffe988e81875b04365d4e Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 9 Aug 2017 09:46:20 +0200 Subject: [PATCH 4/6] Fix material searching in isContainerUsed() CURA-4129 Searching for used materials should also take into account the material container ID. --- cura/Settings/ContainerManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index 9707ca4909..9cbd93555a 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -341,7 +341,8 @@ class ContainerManager(QObject): this_container = container_results[0] container_guid = this_container.getMetaDataEntry("GUID") # check all material container IDs with the same GUID - material_containers = self._container_registry.findInstanceContainers(GUID = container_guid, + material_containers = self._container_registry.findInstanceContainers(id = container_id, + GUID = container_guid, type = "material") if material_containers: container_ids_to_check = [container.getId() for container in material_containers] From 65554b60e19507635c79048dc73862e6b25ec0ec Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 9 Aug 2017 13:06:13 +0200 Subject: [PATCH 5/6] Mark definition_changes conflict if it is not found CURA-4143 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 278e3030ec..af314858a1 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -225,6 +225,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader): if definition_changes: if definition_changes[0] != instance_container: definition_changes_conflict = True + else: + definition_changes_conflict = True elif container_type == "user": num_user_settings += len(instance_container._instances) elif container_type in self._ignored_instance_container_types: From ccabbd8ca0215ad220d7610fc37668a85d78c12c Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 9 Aug 2017 13:11:37 +0200 Subject: [PATCH 6/6] Mark definition changes container found instead of conflict CURA-4143 Reverts 65554b60e19507635c79048dc73862e6b25ec0ec --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index af314858a1..9b390cb636 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -222,11 +222,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): definition_name = instance_container.getName() num_settings_overriden_by_definition_changes += len(instance_container._instances) definition_changes = self._container_registry.findDefinitionContainers(id = container_id) + containers_found_dict["definition_changes"] = True if definition_changes: if definition_changes[0] != instance_container: definition_changes_conflict = True - else: - definition_changes_conflict = True elif container_type == "user": num_user_settings += len(instance_container._instances) elif container_type in self._ignored_instance_container_types: