Fix flush_multiplier type mismatch: use ConfigOptionFloats instead of ConfigOptionFloat (#13062)

This commit is contained in:
SoftFever
2026-04-01 14:43:12 +08:00
committed by GitHub
parent 0a762dfede
commit c948d87102
2 changed files with 4 additions and 7 deletions

View File

@@ -9029,11 +9029,8 @@ void DynamicPrintConfig::update_values_to_printer_extruders(DynamicPrintConfig&
//variant index
variant_index[e_index] = get_index_for_extruder(e_index+1, id_name, extruder_type, nozzle_volume_type, variant_name);
if (variant_index[e_index] < 0) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(", Line %1%: could not found extruder_type %2%, nozzle_volume_type %3%, extruder_index %4%")
%__LINE__ %s_keys_names_ExtruderType[extruder_type] % s_keys_names_NozzleVolumeType[nozzle_volume_type] % (e_index+1);
assert(false);
//for some updates happens in a invalid state(caused by popup window)
//we need to avoid crash
// Orca: This is expected during transient UI states (e.g. popup windows),
// fall back to 0 silently.
variant_index[e_index] = 0;
}
}

View File

@@ -4050,8 +4050,8 @@ void Sidebar::auto_calc_flushing_volumes_internal(const int modify_id, const int
const std::vector<int>& min_flush_volumes = get_min_flush_volumes(full_config, extruder_id);
ConfigOptionFloat* flush_multi_opt = project_config.option<ConfigOptionFloat>("flush_multiplier");
float flush_multiplier = flush_multi_opt ? flush_multi_opt->getFloat() : 1.f;
const auto* flush_multi_opt = project_config.option<ConfigOptionFloats>("flush_multiplier");
float flush_multiplier = flush_multi_opt ? (float)flush_multi_opt->get_at(extruder_id) : 1.f;
std::vector<double> matrix = init_matrix;
int m_max_flush_volume = Slic3r::g_max_flush_volume;
unsigned int m_number_of_extruders = (int)(sqrt(init_matrix.size()) + 0.001);