From 08131f065b3f4f0b60d2bfe16c746d78b361c327 Mon Sep 17 00:00:00 2001 From: nemart69 <78763471+nemart69@users.noreply.github.com> Date: Tue, 9 Feb 2021 21:17:19 +0100 Subject: [PATCH] Raft changes, GUI part --- src/slic3r/GUI/ConfigManipulation.cpp | 5 +++++ src/slic3r/GUI/Field.cpp | 2 ++ src/slic3r/GUI/GUI.cpp | 2 ++ src/slic3r/GUI/OptionsGroup.cpp | 3 +++ src/slic3r/GUI/Plater.cpp | 3 ++- src/slic3r/GUI/Tab.cpp | 6 +++++- 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index aba26b20317..31a08e1c2b2 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -292,6 +292,11 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("support_material_extruder", have_support_material || have_skirt); toggle_field("support_material_speed", have_support_material || have_brim || have_skirt); + for (auto el : { "raft_xy_size_compensation", "raft_size_adjust" }) + toggle_field(el, have_raft); + for (auto el : { "raft_overhangs", "raft_contact_distance" }) + toggle_field(el, have_raft && !have_support_soluble); + bool has_ironing = config->opt_bool("ironing"); for (auto el : { "ironing_type", "ironing_flowrate", "ironing_spacing", "ironing_speed" }) toggle_field(el, has_ironing); diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 88c8331874a..ed99866b372 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1231,6 +1231,8 @@ boost::any& Choice::get_value() m_value = static_cast(ret_enum); else if (m_opt_id == "printhost_authorization_type") m_value = static_cast(ret_enum); + else if (m_opt_id == "raft_size_adjust") + m_value = static_cast(ret_enum); } else if (m_opt.gui_type == "f_enum_open") { const int ret_enum = field->GetSelection(); diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index dea22601224..1f0a1e5cf4a 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -198,6 +198,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt config.set_key_value(opt_key, new ConfigOptionEnum(boost::any_cast(value))); else if(opt_key == "printhost_authorization_type") config.set_key_value(opt_key, new ConfigOptionEnum(boost::any_cast(value))); + else if (opt_key == "raft_size_adjust") + config.set_key_value(opt_key, new ConfigOptionEnum(boost::any_cast(value))); } break; case coPoints:{ diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 10774abe3a9..80d79b581b7 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -894,6 +894,9 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config else if (opt_key == "printhost_authorization_type") { ret = static_cast(config.option>(opt_key)->value); } + else if (opt_key == "raft_size_adjust") { + ret = static_cast(config.option>(opt_key)->value); + } } break; case coPoints: diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7824dcfdff4..564e668e37b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1933,7 +1933,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) // These values are necessary to construct SlicingParameters by the Canvas3D variable layer height editor. "layer_height", "first_layer_height", "min_layer_height", "max_layer_height", "brim_width", "perimeters", "perimeter_extruder", "fill_density", "infill_extruder", "top_solid_layers", - "support_material", "support_material_extruder", "support_material_interface_extruder", "support_material_contact_distance", "raft_layers" + "support_material", "support_material_extruder", "support_material_interface_extruder", "support_material_contact_distance", "raft_layers", + "raft_overhangs", "raft_contact_distance", "raft_xy_size_compensation", "raft_size_adjust" })) , sidebar(new Sidebar(q)) , m_ui_jobs(this) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index ccb82b011f6..956fb78651f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1486,7 +1486,11 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Raft")); optgroup->append_single_option_line("raft_layers", category_path + "raft-layers"); -// # optgroup->append_single_option_line(get_option_("raft_contact_distance"); + // RaftingEdition + optgroup->append_single_option_line("raft_overhangs"); + optgroup->append_single_option_line("raft_contact_distance"); + optgroup->append_single_option_line("raft_xy_size_compensation"); + optgroup->append_single_option_line("raft_size_adjust"); optgroup = page->new_optgroup(L("Options for support material and raft")); optgroup->append_single_option_line("support_material_contact_distance", category_path + "contact-z-distance");