diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 8de60b741e..ebf4a01c94 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -663,13 +663,13 @@ void PrintConfigDef::init_common_params() def->set_default_value(new ConfigOptionFloat(100.0)); def = this->add("extruder_printable_height", coFloats); - def->label = L("Printable height"); - def->tooltip = L("Maximum printable height which is limited by mechanism of printer"); + def->label = L("Extruder printable height"); + def->tooltip = L("Maximum printable height of the extruder"); def->sidetext = L("mm"); def->min = 0; def->max = 1000; - def->mode = comSimple; - def->set_default_value(new ConfigOptionFloatsNullable{}); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloatsNullable{0}); def = this->add("unprintable_filament_types", coStrings); def->label = L("Unprintable filament type"); @@ -7384,6 +7384,7 @@ std::set printer_extruder_options = { }; std::set printer_options_with_variant_1 = { + "nozzle_volume", "retraction_length", "z_hop", "retract_lift_above", diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 575479bb08..fba9802fea 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -1017,13 +1017,22 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config case coPercents: case coFloats: case coFloat:{ - double val = opt->type == coFloats ? - config.opt_float(opt_key, idx) : - opt->type == coFloat ? config.opt_float(opt_key) : - config.option(opt_key)->get_at(idx); - ret = double_to_string(val); - } - break; + if (opt_key == "extruder_printable_height") { + auto opt_values = dynamic_cast(config.option(opt_key))->values; + if (!opt_values.empty()) { + double val = opt_values[idx]; + ret = double_to_string(val); + } + } + else { + double val = opt->type == coFloats ? + config.opt_float(opt_key, idx) : + opt->type == coFloat ? config.opt_float(opt_key) : + config.option(opt_key)->get_at(idx); + ret = double_to_string(val); + } + break; + } case coString: ret = from_u8(config.opt_string(opt_key)); break; @@ -1089,6 +1098,15 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config ret = get_thumbnails_string(config.option(opt_key)->values); else ret = config.option(opt_key)->get_at(idx); + break; + case coPointsGroups: + if (opt_key == "extruder_printable_area") { + auto values = config.option(opt_key)->values; + if (!values.empty()) + ret = get_thumbnails_string(config.option(opt_key)->get_at(idx)); + } + else + ret = config.option(opt_key)->get_at(idx); break; case coNone: default: diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 366396e748..00627e0e6c 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4065,7 +4065,6 @@ void TabPrinter::build_fff() // optgroup->append_single_option_line("printable_area"); optgroup->append_single_option_line("printable_height"); optgroup->append_single_option_line("support_multi_bed_types","bed-types"); - optgroup->append_single_option_line("nozzle_volume"); optgroup->append_single_option_line("best_object_pos"); // todo: for multi_extruder test optgroup->append_single_option_line("z_offset"); @@ -4618,10 +4617,16 @@ if (is_marlin_flavor) auto page = add_options_page(page_name, "custom-gcode_extruder", true); // ORCA: icon only visible on placeholders m_pages.insert(m_pages.begin() + n_before_extruders + extruder_idx, page); - auto optgroup = page->new_optgroup(L("Size"), L"param_extruder_size"); + auto optgroup = page->new_optgroup(L("Basic information"), L"param_type", -1, true); optgroup->append_single_option_line("nozzle_diameter", "", extruder_idx); //optgroup->append_single_option_line("nozzle_volume_type", "", extruder_idx); + optgroup->append_single_option_line("nozzle_volume", "", extruder_idx); + optgroup->append_single_option_line("extruder_printable_height", "", extruder_idx); + Option option = optgroup->get_option("extruder_printable_area", extruder_idx); + option.opt.full_width = true; + optgroup->append_single_option_line(option); + optgroup->m_on_change = [this, extruder_idx](const t_config_option_key& opt_key, boost::any value) { bool is_SEMM = m_config->opt_bool("single_extruder_multi_material"); @@ -4910,6 +4915,11 @@ void TabPrinter::toggle_options() size_t i = size_t(val - 1); bool have_retract_length = m_config->opt_float("retraction_length", i) > 0; + toggle_option("extruder_printable_area", false, i); // disable + toggle_line("extruder_printable_area", m_preset_bundle->get_printer_extruder_count() == 2, i); //hide + toggle_option("extruder_printable_height", false, i); + toggle_line("extruder_printable_height", m_preset_bundle->get_printer_extruder_count() == 2, i); + // when using firmware retraction, firmware decides retraction length bool use_firmware_retraction = m_config->opt_bool("use_firmware_retraction"); toggle_option("retract_length", !use_firmware_retraction, i); @@ -6610,7 +6620,7 @@ void Tab::switch_excluder(int extruder_id) for (auto page : m_pages) { bool is_extruder = false; page->m_opt_id_map.clear(); - if (m_extruder_switch == nullptr && page->title().StartsWith("Extruder ")) { + if (m_extruder_switch == nullptr && page->title().StartsWith("Extruder")) { int extruder_id2 = std::atoi(page->title().Mid(9).ToUTF8()) - 1; if (extruder_id >= 0 && extruder_id2 != extruder_id) continue; @@ -6619,12 +6629,13 @@ void Tab::switch_excluder(int extruder_id) is_extruder = true; } for (auto group : page->m_optgroups) { - if (is_extruder && group->title == "Type") { - for (auto &opt : group->opt_map()) - page->m_opt_id_map.insert({opt.first, opt.first}); - continue; - } for (auto &opt : group->opt_map()) { + auto iter = std::find(printer_extruder_options.begin(), printer_extruder_options.end(), opt.second.first); + if (iter != printer_extruder_options.end()) { + page->m_opt_id_map.insert({opt.first, opt.first}); + continue; + } + if (opt.second.second >= 0) { const_cast(opt.second.second) = index; page->m_opt_id_map.insert({opt.second.first + "#" + std::to_string(index), opt.first});