fix: slot assignment dialog matches PLA Silk, Matte PLA etc. to PLA slots #64

Merged
viewit merged 1 commits from p2l/KX-Bridge-Release:feature/slot-assignment-fix into master 2026-06-21 21:40:28 +02:00
Contributor

The material compatibility check in openFilamentDialog used exact string matching, so variants like "PLA Silk", "PLA-CF", "Matte PLA" would not match against a slot loaded with "PLA" and would show "No matching material" instead of being offered the slot.

This fix uses a prefix/substring check so any material string that contains or starts with the base type (PLA, PETG, ABS, etc.) is treated as compatible.

The material compatibility check in `openFilamentDialog` used exact string matching, so variants like `"PLA Silk"`, `"PLA-CF"`, `"Matte PLA"` would not match against a slot loaded with `"PLA"` and would show "No matching material" instead of being offered the slot. This fix uses a prefix/substring check so any material string that contains or starts with the base type (`PLA`, `PETG`, `ABS`, etc.) is treated as compatible.
p2l added 1 commit 2026-06-18 21:44:02 +02:00
_normalizeMaterialKey now scans all space-separated words in a slot label and
returns the first known base material type found. This handles both "modifier
first" ("Matte PLA") and "modifier last" ("PLA Silk", "PLA Matte") patterns,
which arise when users label slots with full product-style names while OrcaSlicer
writes only the base type (PLA, PETG, …) in GCode comments.

Dash-suffix composites ("PLA-CF", "PETG-CF") contain no space and are unchanged,
preserving correct incompatibility with their base types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
p2l added 2 commits 2026-06-18 21:50:35 +02:00
_normalizeMaterialKey now scans all space-separated words in a slot label and
returns the first known base material type found. This handles both "modifier
first" ("Matte PLA") and "modifier last" ("PLA Silk", "PLA Matte") patterns,
which arise when users label slots with full product-style names while OrcaSlicer
writes only the base type (PLA, PETG, …) in GCode comments.

Dash-suffix composites ("PLA-CF", "PETG-CF") contain no space and are unchanged,
preserving correct incompatibility with their base types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_normalizeMaterialKey now scans all space-separated words in a slot label and
returns the first known base material type found. This handles both "modifier
first" ("Matte PLA") and "modifier last" ("PLA Silk", "PLA Matte") patterns,
which arise when users label slots with full product-style names while OrcaSlicer
writes only the base type (PLA, PETG, …) in GCode comments.

Dash-suffix composites ("PLA-CF", "PETG-CF") contain no space and are unchanged,
preserving correct incompatibility with their base types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
viewit approved these changes 2026-06-21 21:39:55 +02:00
viewit left a comment
Owner

LGTM

LGTM
viewit merged commit fc504b4e3b into master 2026-06-21 21:40:28 +02:00
Owner

Thanks @p2l — clean fix. The word-scan approach correctly handles all the modifier+base patterns ("Matte PLA", "PLA Silk", "Silk PETG" etc.) without breaking dash-suffix variants like PLA-CF. Merged into master.

Thanks @p2l — clean fix. The word-scan approach correctly handles all the modifier+base patterns ("Matte PLA", "PLA Silk", "Silk PETG" etc.) without breaking dash-suffix variants like PLA-CF. Merged into master.
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: viewit/KX-Bridge-Release#64
No description provided.