mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 06:11:02 +00:00
A user preset is read from its own file and flattened against the system preset it inherits. It cannot inherit another file of the same pass, because the presets being read only join the collection once they have all been read, so the files are independent of each other. load_presets splits the way the vendor cache load already does: resolve_user_preset reads and flattens one file and touches nothing shared, and commit_user_preset installs it, counts its errors, and does the file work a load can trigger (removing an unreadable preset, writing back a filament preset that named no compatible printer). Both callers now share resolve_then_commit, which holds the two-phase shape, works through the items in batches so what is held at once does not grow with how many there are, and gives each piece of a batch one CNumericLocalesSetter rather than one per file. It throws rather than commit a batch that a canceled task group of the caller left unresolved. A setter nested in another on the same thread does nothing while the locale is still "C", so one setter per piece of a batch covers every file in it, and each batch runs isolated, so a thread waiting on it picks up none of the caller's other work. A filament preset whose derived compatible printer cannot be written back still loads, with the failure counted. Loading 328 user presets goes from 105 to 34 ms on a 16-core desktop.
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: