Files
bambuddy/backend
maziggy 372ab3b788 Route external spools to a nozzle when the printer has no AMS (#2771)
Five X2Ds with no AMS, each printing from its external spool holder,
    took a job sent to a named printer and refused the same job sent to
    "Any X2D": the file uploaded, the firmware answered 0700_8012 "Failed
    to get AMS mapping table", and the item failed after three attempts.

    A named-printer job carries a mapping the frontend resolved at queue
    time, so the scheduler's matcher never runs. A model-based job has no
    printer until dispatch, so the matcher does run -- and could not see an
    external spool on a dual-nozzle printer. _build_loaded_filaments derived
    dual-nozzle status from ams_extruder_map, which is built from AMS info
    bits, so a printer with zero AMS units reported an empty map; every
    external spool got extruder_id=None, and the nozzle-aware hard filter in
    _match_filaments_to_slots discarded it because None equals neither 0 nor
    1. The mapping came back all -1, was cleared to None, and the print
    command went out as use_ams:true with no ams_mapping and no
    ams_mapping2 at all.

    This is the backend half of #1257, which fixed the same logic in
    useFilamentMapping.ts and left this copy behind. Mirror its inference:
    a populated nozzles[1].nozzle_diameter, a non-empty ams_extruder_map, or
    more than one vt_tray entry. Replaying the reporter's own push-status
    now yields extruder 1 for Ext-L and 0 for Ext-R, and a nozzle-1
    requirement resolves to [254] -- what their working named-printer
    dispatch sent. Single-nozzle printers keep extruder_id=None; nozzles
    always has two entries, so its length alone must not be the signal.

    Also stop dispatching a job the firmware is certain to reject. When the
    matcher ran, matched nothing, and the printer has no AMS, fail the item
    with the filament and nozzle it wants instead of spending an upload and
    two retries on it -- that path already ended in a failed item, just an
    opaque one. With an AMS attached the firmware error still stands, since
    there the user can load a spool and press Resume. Fail-safe like the
    nozzle-diameter guard (#1899): every branch short of a positive finding
    returns None and dispatches as before.

    _apply_filament_overrides is extracted from _compute_ams_mapping_for_printer
    so the message names the filament the matcher looked for rather than the one
    the 3MF was sliced with.
2026-08-15 14:22:24 +02:00
..