mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-04 18:58:00 -05:00
A K2 SE lists a loaded spool whose RFID tag the firmware does not know with only its colour: vendor, type and name blank, state 2. The printer shows the spool, but parse_cfs_response skipped every material with a blank vendor and type regardless of state, so the sync dialog never offered that slot. No firmware has been seen marking an empty slot that way; empty slots carry state 0 and no colour. Skip a non-zero state entry only when its colour is blank too. The slot then shows in the sync dialog as an unread tray, like a Bambu tray with an unknown spool: mapping it yields Generic PLA in the default colour. The preset matcher returns no preset for an empty type instead of scanning every preset for nothing. The sync code for Moonraker printers assumes every tray either carries a filament id or is a placeholder for an empty slot; an existing tray with neither shifts the entries of the trays after it in an overwrite sync. So a tray that resolved to no preset is published as a placeholder as well: the overwrite sync keeps the project filament in that position, as it does for an empty slot, and the tray stays visible in its colour. Read the box and material fields through the null-safe JSON helpers the K1 parser already uses, so a null or mistyped field reads as blank instead of throwing out of the sync. Tests: parse the reporter's boxsInfo payload and check that the unnamed spool is listed, a truly blank entry is still skipped, a null field reads as blank, and an empty type matches no preset; an overwrite sync with such a placeholder between loaded slots keeps every slot's colour.
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: