Repository navigation
OpenSpool: parse additional_color_hexes for multicolor spools - #37
Open
RrrrobertB1992 wants to merge 1 commit into
Open
RrrrobertB1992 wants to merge 1 commit into
RrrrobertB1992 wants to merge 1 commit into
Conversation
OpenSpool tags may carry extra colors in `additional_color_hexes` (used by the Snapmaker U1 extended firmware for dual/rainbow spools). The processor previously kept only `color_hex`, dropping the rest. Append up to 4 additional colors (5 total, matching the U1's FILAMENT_PROTO_COLOR_NUMS_MAX) to `colors`, using the tag's alpha. Single-color tags produce the same output and unique_id as before. Adds a dual-color (red/blue) OpenSpool fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011NVRoJLjL7JBmLBtmjrTrv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenSpool tags can carry extra colors in additional_color_hexes. The Snapmaker U1 Extended Firmware documents this field for multicolor spools (dual-color, rainbow), and its built-in reader already parses it. The OpenRFID OpenSpool processor only reads color_hex, so every multicolor OpenSpool tag shows up as a single color.
Changes
-Append up to 4 entries from additional_color_hexes to colors, for 5 total. That matches the U1's FILAMENT_PROTO_COLOR_NUMS_MAX. The extra colors use the tag's alpha.
-Pass all colors to generate_unique_id. A single-color tag still produces exactly the same unique_id as before.
-Add a fixture: test/tags/OpenSpool/eSUN PLA Silk Red Blue OpenSpool.bin/.yml, a red/blue dual-color tag.
Testing
-pytest test: 97 passed, 1 skipped. Without the fix, the new fixture fails; all existing fixtures are unchanged.
-Tested on hardware: a Snapmaker U1 on Extended Firmware with base 2.0.0.205, using this change plus the companion firmware PR below. I loaded a red/blue OpenSpool tag (color_hex: FF0000, additional_color_hexes: ["0000FF"]) with OpenRFID as the detection system. Results:
print_task_config.filament_color_multi for that channel: nums 2, colors ["FF0000", "0000FF"]. Before this change it showed nums 1, ["FF0000"].
-The touchscreen shows the spool as a red/blue split swatch.
-I changed both colors by hand, then refreshed from the tag, and both colors went back to the tag's values.
-Single-color spools (Anycubic tags) on the other channels still show one color.
Images
Companion firmware PR, which forwards colors 2–5 to the printer: [(https://github.com/paxx12-snapmaker-u1/SnapmakerU1-Extended-Firmware/pull/788)]