mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-04 16:52:29 +00:00
feat(engine): resolve per-variant config columns for raw filament reads on the export path
When a per-layer nozzle grouping migrates a filament across nozzle variants, the write-back turns two groups of config arrays from filament-indexed into column-indexed: the per-variant filament options (one column per variant a filament uses) and the merged extruder retract overrides (resized to the column count by apply_override). Export-path readers that still indexed them with the raw filament id read a neighbor's column for every filament ordered after a migrating one: toolchange/standby temperatures (M104/M109), retraction lengths and feedrates, wipe distance, z-hop types, air-filtration keys, and - through the Extruder's cached flow term - the extrusion E of every move. Now every such read resolves its column through the existing layer-aware resolver (get_filament_config_index -> Print::get_filament_config_indx), which returns the raw filament id whenever no per-layer grouping result is published, so static prints are byte-inert by construction. The Extruder itself has no layer knowledge, so it gains an injected config column (set_config_index, default = filament id) that the generator refreshes at the only two resolution-changing events - layer change and writer toolchange - and that re-syncs the cached e_per_mm3 flow term. Old-filament reads resolve at the current layer, which is safe because the per-layer maps are gap-filled carry-forward. Whole-array placeholder copies (toolchange temperature overrides) are rebuilt in filament order, mirroring the existing per-variant placeholder remap. The resolvers move to the public section so non-friend helpers (ooze prevention) can resolve too. Documented, deliberately unchanged: the wipe tower's per-filament parameter rows (no layer dimension; tower x per-layer grouping is a follow-up), travel_slope's physical-extruder read, estimator pre-heat bookkeeping temps, and index-0 header diagnostics. Verification: new Extruder column-injection scenario (defaults, column follow + flow-cache rescale, filament-indexed reads unaffected, reset semantics) and a migrating write-back case proving the column shift for filaments ordered after a migrator and the resolver tracking it (11 + 14 assertions); suites green (libslic3r 48998/169, fff_print 655/61); 20/20 pinned-slice byte gate bit-identical (incl. sequential repro x2 deterministic).
This commit is contained in:
@@ -1333,6 +1333,10 @@ void WipeTower2::set_extruder(size_t idx, const PrintConfig& config)
|
||||
//while (m_filpar.size() < idx+1) // makes sure the required element is in the vector
|
||||
m_filpar.push_back(FilamentParameters());
|
||||
|
||||
// Orca: one row per filament, indexed by the raw filament id. Under a per-layer nozzle
|
||||
// grouping the per-variant arrays may hold several columns per filament; the tower has no
|
||||
// layer dimension here, so it keeps the filament's first column (tower x per-layer
|
||||
// grouping is a documented follow-up).
|
||||
m_filpar[idx].material = config.filament_type.get_at(idx);
|
||||
if (m_wipe_tower_filament > 0)
|
||||
m_filpar[idx].is_soluble = (idx != size_t(m_wipe_tower_filament - 1));
|
||||
|
||||
Reference in New Issue
Block a user