From 6b58f67fb8ae0577cbb8a9ee682217912339771e Mon Sep 17 00:00:00 2001 From: bubnikv Date: Sat, 14 Mar 2020 07:46:39 +0100 Subject: [PATCH] "inifinit_skirt" renamed to "draft_shield" Polished the tooltip for the draft shield. Legacy conversion from old skirt_heigth == -1 to draft_shield = 1 --- src/libslic3r/Print.cpp | 9 +++------ src/libslic3r/PrintConfig.cpp | 14 ++++++++++---- src/libslic3r/PrintConfig.hpp | 4 ++-- src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/Preset.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 2 +- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index d7975acc3..effe6085e 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -162,7 +162,7 @@ bool Print::invalidate_state_by_config_options(const std::vector 0) - return (m_config.infinit_skirt && m_config.skirts > 0) - || (m_config.ooze_prevention && this->extruders().size() > 1); + return (m_config.draft_shield && m_config.skirts > 0) || (m_config.ooze_prevention && this->extruders().size() > 1); } bool Print::has_skirt() const { - return (m_config.skirt_height > 0 && m_config.skirts > 0) - || this->has_infinite_skirt(); + return (m_config.skirt_height > 0 && m_config.skirts > 0) || this->has_infinite_skirt(); } static inline bool sequential_print_horizontal_clearance_valid(const Print &print) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index ac45fc770..3637f460f 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1698,9 +1698,10 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionInt(1)); - def = this->add("infinit_skirt", coBool); - def->label = L("Use unlimit skirt"); - def->tooltip = L("If enabled, the skirt will be as tall as a highest printed object."); + def = this->add("draft_shield", coBool); + def->label = L("Draft shield"); + def->tooltip = L("If enabled, the skirt will be as tall as a highest printed object. " + "This is useful to protect an ABS or ASA print from warping and detaching from print bed due to wind draft."); def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(false)); @@ -3011,6 +3012,11 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va } else if (opt_key == "support_material_pattern" && value == "pillars") { // Slic3r PE does not support the pillars. They never worked well. value = "rectilinear"; + } else if (opt_key == "skirt_height" && value == "-1") { + // PrusaSlicer no more accepts skirt_height == -1 to print a draft shield to the top of the highest object. + // A new "draft_shield" boolean config value is used instead. + opt_key = "draft_shield"; + value = "1"; } else if (opt_key == "octoprint_host") { opt_key = "print_host"; } else if (opt_key == "octoprint_cafile") { @@ -3219,7 +3225,7 @@ std::string FullPrintConfig::validate() return "Invalid value for --infill-every-layers"; // --skirt-height - if (this->skirt_height < -1) // -1 means as tall as the object + if (this->skirt_height < 0) return "Invalid value for --skirt-height"; // --bridge-flow-ratio diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 210ea05db..505db6b6e 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -802,7 +802,7 @@ public: ConfigOptionBools retract_layer_change; ConfigOptionFloat skirt_distance; ConfigOptionInt skirt_height; - ConfigOptionBool infinit_skirt; + ConfigOptionBool draft_shield; ConfigOptionInt skirts; ConfigOptionInts slowdown_below_layer_time; ConfigOptionBool spiral_vase; @@ -875,7 +875,7 @@ protected: OPT_PTR(retract_layer_change); OPT_PTR(skirt_distance); OPT_PTR(skirt_height); - OPT_PTR(infinit_skirt); + OPT_PTR(draft_shield); OPT_PTR(skirts); OPT_PTR(slowdown_below_layer_time); OPT_PTR(spiral_vase); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 21a677708..6ae0b221b 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -272,7 +272,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) for (auto el : { "skirt_distance", "skirt_height" }) toggle_field(el, have_skirt); - toggle_field("skirt_height", !config->opt_bool("infinit_skirt")); + toggle_field("skirt_height", !config->opt_bool("draft_shield")); bool have_brim = config->opt_float("brim_width") > 0; // perimeter_extruder uses the same logic as in Print::extruders() diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 3761835f1..aa6ac24fd 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -413,7 +413,7 @@ const std::vector& Preset::print_options() "perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed", "top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed", "bridge_speed", "gap_fill_speed", "travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration", - "bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "infinit_skirt", + "bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "draft_shield", "min_skirt_length", "brim_width", "support_material", "support_material_auto", "support_material_threshold", "support_material_enforce_layers", "raft_layers", "support_material_pattern", "support_material_with_sheath", "support_material_spacing", "support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 7a8a4579e..5e87c74a3 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1178,7 +1178,7 @@ void TabPrint::build() optgroup->append_single_option_line("skirts"); optgroup->append_single_option_line("skirt_distance"); optgroup->append_single_option_line("skirt_height"); - optgroup->append_single_option_line("infinit_skirt"); + optgroup->append_single_option_line("draft_shield"); optgroup->append_single_option_line("min_skirt_length"); optgroup = page->new_optgroup(_(L("Brim")));