Skip to content

fix(driver): detect profile drift, not just colour, after an AMS assign - #14

Open
wolfrage76 wants to merge 1 commit into
Fire-Devils:develfrom
wolfrage76:fix/verify-ams-profile-drift
Open

fix(driver): detect profile drift, not just colour, after an AMS assign#14
wolfrage76 wants to merge 1 commit into
Fire-Devils:develfrom
wolfrage76:fix/verify-ams-profile-drift

Conversation

@wolfrage76

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to fix(driver): re-push configure when a stale deferred config reverts the tray #13: the post-assign verify only compared tray colour, so a swap of two same-colour spools (e.g. red HS Matte vs red PLA+) kept the previous occupant's AMS code and PFUS with no re-push.
  • Record the AMS code, setting_id, and colour actually configured per slot, and re-push once if the live tray's AMS code (or colour) disagrees.
  • Clear a slot's cached params when a different spool takes it, so a later rebuild cannot resurrect the old occupant's PFUS.
  • Suppress profile learning while the tray still contradicts the code we just configured, which was persisting the previous spool's AMS code onto the new filament.

Test plan

  • Weigh a spool into a sticky AMS slot that just held a different spool of the same colour but a different profile — Filaman assigns correctly and Studio keeps the new spool's profile (not the previous occupant's)
  • Watch logs for a one-shot WARNING tray overwritten after assign … AMS code … re-sending configure when the race occurs; no second re-push
  • printer_write_mode / _apply_to_printer off: no verify re-push
  • After a swap, the new filament's bambu_idx is not overwritten with the previous spool's AMS code
  • pytest tests/test_profile_variants.py

A swap where both spools share a colour slipped past the post-assign check:
the tray reverted to the previous spool's AMS code and PFUS while the colour
still matched, so no re-push happened and Studio resolved the wrong profile.

Record the code/setting/colour actually configured per slot and compare the
AMS code too. Clear a slot's cached params when a different spool takes it,
so a later rebuild cannot resurrect the old occupant's PFUS. Suppress profile
learning while the tray still contradicts the code we just configured, which
was persisting the previous spool's AMS code onto the new filament.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant