[3dprinter-general] Bug#1040806: cura-engine: ADT failure "Trying to retrieve setting with no value given: 'adhesion_extruder_nr'"
Dan Bungert
daniel.bungert at canonical.com
Mon Jul 10 23:52:15 BST 2023
Source: cura-engine
Version: 1:4.13.0-1build1
Severity: normal
X-Debbugs-Cc: daniel.bungert at canonical.com
Dear Maintainer,
Visible in both Sid and Ubuntu Mantic is the following autopkgtest error:
[ERROR] Trying to retrieve setting with no value given: 'adhesion_extruder_nr'
See the attached patch, which is just a trivial backport of
https://github.com/Ultimaker/CuraEngine/pull/1693
(I submitted this bug twice before, if duplicates show up later for some
reason please forgive me)
-Dan
-------------- next part --------------
Description: Fix ADT - setting with no value given: 'adhesion_extruder_nr'
Origin: https://github.com/Ultimaker/CuraEngine/pull/1693/commits/adecda53fff5c77ccf43a54ee37d5654a4032858
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2026769
Bug: https://github.com/Ultimaker/CuraEngine/pull/1693
Forwarded: not-needed
Last-Update: 2023-07-10
--- a/src/raft.cpp
+++ b/src/raft.cpp
@@ -18,7 +18,7 @@
void Raft::generate(SliceDataStorage& storage)
{
assert(storage.raftOutline.size() == 0 && "Raft polygon isn't generated yet, so should be empty!");
- const Settings& settings = Application::getInstance().current_slice->scene.current_mesh_group->settings.get<ExtruderTrain&>("adhesion_extruder_nr").settings;
+ const Settings& settings = Application::getInstance().current_slice->scene.current_mesh_group->settings.get<ExtruderTrain&>("raft_base_extruder_nr").settings;
const coord_t distance = settings.get<coord_t>("raft_margin");
constexpr bool include_support = true;
constexpr bool include_prime_tower = true;
@@ -51,16 +51,19 @@
coord_t Raft::getTotalThickness()
{
- const ExtruderTrain& train = Application::getInstance().current_slice->scene.current_mesh_group->settings.get<ExtruderTrain&>("adhesion_extruder_nr");
- return train.settings.get<coord_t>("raft_base_thickness")
- + train.settings.get<size_t>("raft_interface_layers") * train.settings.get<coord_t>("raft_interface_thickness")
- + train.settings.get<size_t>("raft_surface_layers") * train.settings.get<coord_t>("raft_surface_thickness");
+ const Settings& mesh_group_settings =Application::getInstance().current_slice->scene.current_mesh_group->settings;
+ const ExtruderTrain& base_train = mesh_group_settings.get<ExtruderTrain&>("raft_base_extruder_nr");
+ const ExtruderTrain& interface_train = mesh_group_settings.get<ExtruderTrain&>("raft_interface_extruder_nr");
+ const ExtruderTrain& surface_train = mesh_group_settings.get<ExtruderTrain&>("raft_surface_extruder_nr");
+ return base_train.settings.get<coord_t>("raft_base_thickness")
+ + interface_train.settings.get<size_t>("raft_interface_layers") * interface_train.settings.get<coord_t>("raft_interface_thickness")
+ + surface_train.settings.get<size_t>("raft_surface_layers") * surface_train.settings.get<coord_t>("raft_surface_thickness");
}
coord_t Raft::getZdiffBetweenRaftAndLayer1()
{
const Settings& mesh_group_settings = Application::getInstance().current_slice->scene.current_mesh_group->settings;
- const ExtruderTrain& train = mesh_group_settings.get<ExtruderTrain&>("adhesion_extruder_nr");
+ const ExtruderTrain& train = mesh_group_settings.get<ExtruderTrain&>("raft_surface_extruder_nr");
if (mesh_group_settings.get<EPlatformAdhesion>("adhesion_type") != EPlatformAdhesion::RAFT)
{
return 0;
@@ -94,12 +97,15 @@
size_t Raft::getTotalExtraLayers()
{
- const ExtruderTrain& train = Application::getInstance().current_slice->scene.current_mesh_group->settings.get<ExtruderTrain&>("adhesion_extruder_nr");
- if (train.settings.get<EPlatformAdhesion>("adhesion_type") != EPlatformAdhesion::RAFT)
+ const Settings& mesh_group_settings =Application::getInstance().current_slice->scene.current_mesh_group->settings;
+ const ExtruderTrain& base_train = mesh_group_settings.get<ExtruderTrain&>("raft_base_extruder_nr");
+ const ExtruderTrain& interface_train = mesh_group_settings.get<ExtruderTrain&>("raft_interface_extruder_nr");
+ const ExtruderTrain& surface_train = mesh_group_settings.get<ExtruderTrain&>("raft_surface_extruder_nr");
+ if (base_train.settings.get<EPlatformAdhesion>("adhesion_type") != EPlatformAdhesion::RAFT)
{
return 0;
}
- return 1 + train.settings.get<size_t>("raft_interface_layers") + train.settings.get<size_t>("raft_surface_layers") + getFillerLayerCount();
+ return 1 + interface_train.settings.get<size_t>("raft_interface_layers") + surface_train.settings.get<size_t>("raft_surface_layers") + getFillerLayerCount();
}
--- a/src/sliceDataStorage.cpp
+++ b/src/sliceDataStorage.cpp
@@ -595,12 +595,15 @@
}
coord_t adhesion_size = 0; //Make sure there is enough room for the platform adhesion around support.
- const ExtruderTrain& adhesion_extruder = mesh_group_settings.get<ExtruderTrain&>("adhesion_extruder_nr");
+ const ExtruderTrain& base_train = mesh_group_settings.get<ExtruderTrain&>("raft_base_extruder_nr");
+ const ExtruderTrain& interface_train = mesh_group_settings.get<ExtruderTrain&>("raft_interface_extruder_nr");
+ const ExtruderTrain& surface_train = mesh_group_settings.get<ExtruderTrain&>("raft_surface_extruder_nr");
+ const ExtruderTrain& skirt_brim_train = mesh_group_settings.get<ExtruderTrain&>("skirt_brim_extruder_nr");
coord_t extra_skirt_line_width = 0;
const std::vector<bool> is_extruder_used = getExtrudersUsed();
for (size_t extruder_nr = 0; extruder_nr < Application::getInstance().current_slice->scene.extruders.size(); extruder_nr++)
{
- if (extruder_nr == adhesion_extruder.extruder_nr || !is_extruder_used[extruder_nr]) //Unused extruders and the primary adhesion extruder don't generate an extra skirt line.
+ if (extruder_nr == skirt_brim_train.extruder_nr || !is_extruder_used[extruder_nr]) //Unused extruders and the primary adhesion extruder don't generate an extra skirt line.
{
continue;
}
@@ -610,13 +613,23 @@
switch (mesh_group_settings.get<EPlatformAdhesion>("adhesion_type"))
{
case EPlatformAdhesion::BRIM:
- adhesion_size = adhesion_extruder.settings.get<coord_t>("skirt_brim_line_width") * adhesion_extruder.settings.get<Ratio>("initial_layer_line_width_factor") * adhesion_extruder.settings.get<size_t>("brim_line_count") + extra_skirt_line_width;
+ adhesion_size = skirt_brim_train.settings.get<coord_t>("skirt_brim_line_width")
+ * skirt_brim_train.settings.get<Ratio>("initial_layer_line_width_factor")
+ * skirt_brim_train.settings.get<size_t>("brim_line_count") + extra_skirt_line_width;
break;
case EPlatformAdhesion::RAFT:
- adhesion_size = adhesion_extruder.settings.get<coord_t>("raft_margin");
+ adhesion_size = std::max({
+ base_train.settings.get<coord_t>("raft_margin"),
+ interface_train.settings.get<coord_t>("raft_margin"),
+ surface_train.settings.get<coord_t>("raft_margin")
+ });
break;
case EPlatformAdhesion::SKIRT:
- adhesion_size = adhesion_extruder.settings.get<coord_t>("skirt_gap") + adhesion_extruder.settings.get<coord_t>("skirt_brim_line_width") * adhesion_extruder.settings.get<Ratio>("initial_layer_line_width_factor") * adhesion_extruder.settings.get<size_t>("skirt_line_count") + extra_skirt_line_width;
+ adhesion_size = skirt_brim_train.settings.get<coord_t>("skirt_gap")
+ + skirt_brim_train.settings.get<coord_t>("skirt_brim_line_width")
+ * skirt_brim_train.settings.get<Ratio>("initial_layer_line_width_factor")
+ * skirt_brim_train.settings.get<size_t>("skirt_line_count")
+ + extra_skirt_line_width;
break;
case EPlatformAdhesion::NONE:
adhesion_size = 0;
--- a/src/support.cpp
+++ b/src/support.cpp
@@ -504,8 +504,11 @@
break;
case EPlatformAdhesion::RAFT:
{
- const ExtruderTrain& raft_extruder = mesh_group_settings.get<ExtruderTrain&>("adhesion_extruder_nr");
- adhesion_size = raft_extruder.settings.get<coord_t>("raft_margin");
+ adhesion_size = std::max({
+ mesh_group_settings.get<ExtruderTrain&>("raft_base_extruder_nr").settings.get<coord_t>("raft_margin"),
+ mesh_group_settings.get<ExtruderTrain&>("raft_interface_extruder_nr").settings.get<coord_t>("raft_margin"),
+ mesh_group_settings.get<ExtruderTrain&>("raft_surface_extruder_nr").settings.get<coord_t>("raft_margin")
+ });
break;
}
case EPlatformAdhesion::SKIRT:
More information about the 3dprinter-general
mailing list