Fix usage of most of the multi-variant parameters

This commit is contained in:
Noisyfox
2026-05-20 23:30:43 +08:00
parent 353e9519f0
commit 8a6573db19
11 changed files with 122 additions and 115 deletions

View File

@@ -868,13 +868,15 @@ void PrintObject::generate_support_material()
void PrintObject::estimate_curled_extrusions()
{
if (this->set_started(posEstimateCurledExtrusions)) {
if ( std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(),
[](const PrintRegion *region) { return region->config().enable_overhang_speed.getBool(); })) {
if ( std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(), [](const PrintRegion* region) {
const auto& cfg = region->config().enable_overhang_speed.values;
return std::any_of(cfg.begin(), cfg.end(), [](const unsigned char v) { return (bool) v; });
})) {
// Estimate curling of support material and add it to the malformaition lines of each layer
float support_flow_width = support_material_flow(this, this->config().layer_height).width();
SupportSpotsGenerator::Params params{this->print()->m_config.filament_type.values,
float(this->print()->default_object_config().inner_wall_acceleration.getFloat()),
/*float(this->print()->default_object_config().inner_wall_acceleration.getFloat()),*/
this->config().raft_layers.getInt(), this->config().brim_type.value,
float(this->config().brim_width.getFloat())};
SupportSpotsGenerator::estimate_malformations(this->layers(), params);
@@ -1121,11 +1123,11 @@ bool PrintObject::invalidate_state_by_config_options(
// todo multi_extruders: Parameter migration between single and double extruder printers
auto is_gap_fill_changed_state_due_to_speed = [&opt_key, &old_config, &new_config]() -> bool {
if (opt_key == "gap_infill_speed") {
const auto *old_gap_fill_speed = old_config.option<ConfigOptionFloat>(opt_key);
const auto *new_gap_fill_speed = new_config.option<ConfigOptionFloat>(opt_key);
const auto *old_gap_fill_speed = old_config.option<ConfigOptionFloatsNullable>(opt_key);
const auto *new_gap_fill_speed = new_config.option<ConfigOptionFloatsNullable>(opt_key);
assert(old_gap_fill_speed && new_gap_fill_speed);
return (old_gap_fill_speed->value > 0.f && new_gap_fill_speed->value == 0.f) ||
(old_gap_fill_speed->value == 0.f && new_gap_fill_speed->value > 0.f);
return (old_gap_fill_speed->values.size() != new_gap_fill_speed->values.size())
|| (old_gap_fill_speed->values != new_gap_fill_speed->values);
}
return false;
};