Apply per-variant cooling, ramming and temperature range on nozzle-rack slices

Fan speeds, multi-tool ramming, the tower interface and flush temperature
fallbacks and the custom G-code placeholders now use the extruder variant a
filament prints with on each layer, instead of reading by filament id.
This commit is contained in:
SoftFever
2026-10-01 02:54:18 +08:00
parent 0028e65763
commit c03f4925a9
12 changed files with 166 additions and 78 deletions
@@ -308,8 +308,8 @@ DynamicPrintConfig slice_config(PresetBundle &bundle)
// type (Direct Drive + Bowden) the mismatched lookup spams [error] lines. Single-nozzle and non-BBL
// printers keep the default map (their toolchange rides the AMS/tool-changer path unchanged).
const bool pin_filament_map = bundle.is_bbl_vendor() && nozzles > 1;
auto &fmap = bundle.project_config.option<ConfigOptionInts>("filament_map", true)->values;
if (pin_filament_map) {
auto &fmap = bundle.project_config.option<ConfigOptionInts>("filament_map", true)->values;
for (size_t i = 0; i < fmap.size(); ++i)
fmap[i] = int(i % nozzles) + 1;
}
@@ -317,9 +317,8 @@ DynamicPrintConfig slice_config(PresetBundle &bundle)
// A fresh printer selection uses its declared nozzle volumes, just like the
// app. Otherwise a high-flow preset is silently sliced with Standard tuning.
bundle.reset_default_nozzle_volume_type();
auto &filament_map = bundle.project_config.option<ConfigOptionInts>("filament_map", true)->values;
bundle.project_config.option<ConfigOptionInts>("filament_volume_map", true)->values =
bundle.get_default_nozzle_volume_types_for_filaments(filament_map);
bundle.get_default_nozzle_volume_types_for_filaments(fmap);
DynamicPrintConfig cfg = bundle.full_config();
cfg.set_key_value("enable_prime_tower", new ConfigOptionBool(true)); // force a purge tower so the change is detectable