fix(ams): don't map AMS placeholders to empty trays (Upload & Print with an empty slot below the used filament) #98
Reference in New Issue
Block a user
No description provided.
Delete Branch "walterioo/KX-Bridge-Release:fix/empty-tray-placeholder-auto-mapping"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Printing via OrcaSlicer's "Upload and print" failed — or fed from the wrong
spool — whenever the AMS had an empty slot below the used filament (e.g.
printing with Filament 4 while slot 3 was empty). Printing with all slots full
already worked.
Root cause:
_start_print→_build_auto_ams_box_mappingkeeps the mappingpositional (entry N = TN) by inserting a placeholder at each gap, but the
placeholder's
ams_indexpointed at the gap's own index. For an empty slot thatreferences a physically empty tray, and the printer rejects a mapping entry aimed
at an empty tray — even for a tool the GCode never actually calls — so the print
broke at filament load.
Fix: the placeholder entry is kept (positional alignment, entry N = TN, is
preserved); only what it points at changes. Gap placeholders now point their
ams_index(and color/material) at a definitely-loaded fallback tray (thehighest loaded slot) instead of the gap's own empty index. The all-slots-full
path is unchanged.
Type
Tested with
Checklist
tests/test_auto_ams_box_mapping_empty_slot.py)thx for the great PR !