ENH: config: add the extruder variant apply logic in Print::Apply()

we need to keep the original values and update after pre-slice
jira: no-jira

Change-Id: I232d3c43340b4a23bc42121bd05380746e736f20
(cherry picked from commit 7b7ebf1b959ba5c967baff30fb226c808a2e7d44)
This commit is contained in:
lane.wei
2024-07-08 16:20:38 +08:00
committed by Noisyfox
parent d7029d383f
commit 22ce2ebc9a
8 changed files with 190 additions and 18 deletions

View File

@@ -2607,10 +2607,18 @@ void Print::finalize_first_layer_convex_hull()
void Print::update_filament_maps_to_config(std::vector<int> f_maps)
{
std::vector<int>& filament_maps = m_full_print_config.option<ConfigOptionInts>("filament_map", true)->values;
if (m_config.filament_map.values != f_maps)
{
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": filament maps changed after pre-slicing.");
m_ori_full_print_config.option<ConfigOptionInts>("filament_map", true)->values = f_maps;
m_config.filament_map.values = f_maps;
filament_maps = f_maps;
m_config.filament_map.values = f_maps;
m_full_print_config = m_ori_full_print_config;
m_full_print_config.update_values_to_printer_extruders_for_multiple_filaments(m_full_print_config, filament_options_with_variant, "filament_self_index", "filament_extruder_variant");
t_config_option_keys keys(filament_options_with_variant.begin(), filament_options_with_variant.end());
m_config.apply_only(m_full_print_config, keys, true);
}
}
std::vector<int> Print::get_filament_maps() const