From 8970ee28b26edd41496f268e5426d628e5b0db2a Mon Sep 17 00:00:00 2001 From: bubnikv Date: Thu, 8 Aug 2019 09:48:56 +0200 Subject: [PATCH] Fixed linking of the "pad" combo box of the Plater with the respective pad boolean values of the configuration layer. --- src/slic3r/GUI/Field.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 39fa9c54b..72e5fb8f9 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -905,7 +905,7 @@ boost::any& Choice::get_value() wxString ret_str = field->GetValue(); // options from right panel - std::vector right_panel_options{ "support", "scale_unit" }; + std::vector right_panel_options{ "support", "pad", "scale_unit" }; for (auto rp_option: right_panel_options) if (m_opt_id == rp_option) return m_value = boost::any(ret_str); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index c0ff5644b..0377fdbbf 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -834,6 +834,11 @@ static wxString support_combo_value_for_config(const DynamicPrintConfig &config, _("Everywhere")); } +static wxString pad_combo_value_for_config(const DynamicPrintConfig &config) +{ + return config.opt_bool("pad_enable") ? (config.opt_bool("pad_zero_elevation") ? _("Around object") : _("Below object")) : _("None"); +} + void Tab::on_value_change(const std::string& opt_key, const boost::any& value) { if (wxGetApp().plater() == nullptr) { @@ -853,6 +858,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) (opt_key == "supports_enable" || opt_key == "support_buildplate_only")) og_freq_chng_params->set_value("support", support_combo_value_for_config(*m_config, is_fff)); + if (! is_fff && (opt_key == "pad_enable" || opt_key == "pad_zero_elevation")) + og_freq_chng_params->set_value("pad", pad_combo_value_for_config(*m_config)); + if (opt_key == "brim_width") { bool val = m_config->opt_float("brim_width") > 0.0 ? true : false; @@ -987,6 +995,8 @@ void Tab::update_frequently_changed_parameters() if (!og_freq_chng_params) return; og_freq_chng_params->set_value("support", support_combo_value_for_config(*m_config, is_fff)); + if (! is_fff) + og_freq_chng_params->set_value("pad", pad_combo_value_for_config(*m_config)); const std::string updated_value_key = is_fff ? "fill_density" : "pad_enable";