mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-24 19:32:18 +00:00
feat(engine): wire the per-filament volume-map producer pipeline
- Print::update_filament_maps_to_config takes filament/volume/nozzle maps, backfills an empty volume map from extruder types, rebuilds filament_map_2, re-expands the per-filament variant arrays, and recomputes retract overrides keyed by resolved slots - grouping writes its result back in every non-sequential mode; manual multi-nozzle grouping validates the user mapping and raises a translatable error on deviation; the engine's concrete volume assignment is deliberately not merged yet (per-filament arrays are already consumed by filament id, so materializing High Flow now would change motion before the layer-aware resolvers land) - Print::apply treats the three map keys as engine outputs in auto modes (erased from the diff and adopted), compares them against used filaments in manual mode, and keeps the pre-expansion snapshot in sync with the late normalization pass so rebuilt headers reflect the sliced state instead of resurrecting stale values - volume/nozzle maps and extruder_nozzle_stats join the invalidation group of filament_map (wipe tower + skirt/brim) - PresetBundle composes full configs with an optional per-filament volume map (plate map, else defaults derived from each extruder's flow type); project config keeps the map sized across filament count changes - PartPlate stores per-plate volume/nozzle maps; Plater injects them at every slice-composition site (incl. g-code reload and wipe-tower estimation); BackgroundSlicingProcess reads engine results back to the plate in auto modes - per-filament map trust guards relaxed to size-match everywhere now that every producer sizes the map; single-filament explicit flow assignments are honored - tests: grouping volume maps stay concrete, merge semantics of update_used_filament_values, single-filament override honoring Motion g-code is byte-identical fleet-wide including Hybrid projects (19-fixture gate + repro determinism double-slice). Header deltas: the map keys now dump real values, and stale pre-normalization values (e.g. enable_prime_tower on single-used-filament prints) no longer leak into the config block.
This commit is contained in:
@@ -8818,7 +8818,11 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
|
||||
if (preset_bundle->get_printer_extruder_count() > 1) {
|
||||
PartPlate* cur_plate = background_process.get_current_plate();
|
||||
std::vector<int> f_maps = cur_plate->get_real_filament_maps(preset_bundle->project_config);
|
||||
invalidated = background_process.apply(this->model, preset_bundle->full_config(false, f_maps));
|
||||
std::vector<int> f_volume_maps = cur_plate->get_filament_volume_maps();
|
||||
if (f_volume_maps.empty()) {
|
||||
f_volume_maps = preset_bundle->get_default_nozzle_volume_types_for_filaments(f_maps);
|
||||
}
|
||||
invalidated = background_process.apply(this->model, preset_bundle->full_config(false, f_maps, f_volume_maps));
|
||||
background_process.fff_print()->set_extruder_filament_info(get_extruder_filament_info());
|
||||
}
|
||||
else
|
||||
@@ -18326,7 +18330,11 @@ void Plater::apply_background_progress()
|
||||
Print::ApplyStatus invalidated;
|
||||
if (preset_bundle->get_printer_extruder_count() > 1) {
|
||||
std::vector<int> f_maps = part_plate->get_real_filament_maps(preset_bundle->project_config);
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false, f_maps));
|
||||
std::vector<int> f_volume_maps = part_plate->get_filament_volume_maps();
|
||||
if (f_volume_maps.empty()) {
|
||||
f_volume_maps = preset_bundle->get_default_nozzle_volume_types_for_filaments(f_maps);
|
||||
}
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false, f_maps, f_volume_maps));
|
||||
}
|
||||
else
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false));
|
||||
@@ -18371,7 +18379,11 @@ int Plater::select_plate(int plate_index, bool need_slice)
|
||||
//always apply the current plate's print
|
||||
if (preset_bundle->get_printer_extruder_count() > 1) {
|
||||
std::vector<int> f_maps = part_plate->get_real_filament_maps(preset_bundle->project_config);
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false, f_maps));
|
||||
std::vector<int> f_volume_maps = part_plate->get_filament_volume_maps();
|
||||
if (f_volume_maps.empty()) {
|
||||
f_volume_maps = preset_bundle->get_default_nozzle_volume_types_for_filaments(f_maps);
|
||||
}
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false, f_maps, f_volume_maps));
|
||||
}
|
||||
else
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false));
|
||||
@@ -18792,7 +18804,11 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click, bool isModi
|
||||
//always apply the current plate's print
|
||||
if (preset_bundle->get_printer_extruder_count() > 1) {
|
||||
std::vector<int> f_maps = part_plate->get_real_filament_maps(preset_bundle->project_config);
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false, f_maps));
|
||||
std::vector<int> f_volume_maps = part_plate->get_filament_volume_maps();
|
||||
if (f_volume_maps.empty()) {
|
||||
f_volume_maps = preset_bundle->get_default_nozzle_volume_types_for_filaments(f_maps);
|
||||
}
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false, f_maps, f_volume_maps));
|
||||
}
|
||||
else
|
||||
invalidated = p->background_process.apply(this->model(), preset_bundle->full_config(false));
|
||||
|
||||
Reference in New Issue
Block a user