mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-23 14:10:55 -05:00
Print::m_extruder_filament_info feeds filament grouping, but it was a plain member with no change detection and no invalidation entry point. Changing only the device-side AMS material inventory, such as a spool colour, therefore left a finished slice valid: Print::apply() reported UNCHANGED, the grouping steps stayed done, and export re-emitted the previous G-code with a stale filament_map. Compare the inventory in Print::apply() and invalidate the grouping steps when it changed: - set_extruder_filament_info() now only stashes the payload, so apply() can compare it against the installed one and act on the change under the state lock. - The comparison projects both payloads exactly as grouping does: colour, type, tray name, support flag and filament id per tray. Volatile AMS keys such as remaining amount, temperatures and filament_changed therefore do not count. - A changed inventory invalidates psWipeTower and psSkirtBrim, matching what extruder_ams_count already does, and escalates to APPLY_STATUS_INVALIDATED only when a step was actually taken back. - A payload carrying no tray configs at all is treated as "not known yet" rather than "no filaments", so an AMS reconnect does not invalidate a finished slice, while clearing the last spool still does. - The Plater hands the inventory to apply() before applying, so the change rides the same pass. Adds comparator tests for the inventory projection and an integration test that drives process() and apply() over a two-extruder auto-match print.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: