Skip to content

Bambu-style swatch map for third-party send dialogs (CANVAS, U1, QIDI Box) - #625

Merged
aceRage merged 6 commits into
mainfrom
cursor/third-party-filament-map-c9fb
Oct 20, 2026
Merged

aceRage merged 6 commits into
mainfrom
cursor/third-party-filament-map-c9fb

Conversation

@aceRage

@aceRage aceRage commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

What

The per-filament slot dropdown in the third-party send dialogs ("Filament 1 PLA -> Tray 2 PLA Generic") is replaced by a Bambu-send-dialog-style swatch map: one MaterialItem card per used filament (slicer colour on top, device slot colour underneath, badge), and a MappingItem tile popup grouped by unit with an "As sliced" tile. The Bambu SelectMachineDialog is unchanged.

It is now the picker for every PrintHostSendDialog host that reports named slots:

Host Slots Tile labels Starting slot
Elegoo CC1 + CANVAS CANVAS trays 1A..1D (2A.. for a second unit) remembered mapping (preselect_slot), else closest colour
Snapmaker U1 toolheads (print_task_config) T1..T4 closest colour
QIDI Box (#611) Box slots b*4+n 1A..1D, 2A.. the filament's own material first, closest colour among those, never colour alone
No slots / no filament names none no rows, dialog as before -
Flashforge its own IFS dialog unchanged unchanged

Tile labels (fix for the review finding)

Labels come from the slot's position, never the printer's raw ids (third_party_slots_from):

  • CANVAS: units are numbered in order of appearance and trays by their place in the unit. A 1-based tray_id or canvas_id no longer reads B, C, D, A or 2A.
  • QIDI Box: Box slot b*4+n is <b+1><A+n>.
  • Tool slots (unit = -1, U1 / Moonraker toolheads): T1..T4, as Slot::label() and the Device card name them.
  • Slot::index stays the value the mapping string and the remembered mapping use.

Kept as before

  • Auto-match: initial_slot_position() uses the remembered slot first, else PrintHostDevices::auto_match_slot(..., qidi_box). That is the same rule the wxChoice rows used.
  • Elegoo remembered mappings: preselect_slot, remember on send, and slot_map_for all still read mapping_choice_positions().
  • Warnings:
    • The Elegoo warnings (more filaments than trays, temperature out of range, empty tray, shared tray) keep their original msgids, so existing translations still apply. They now name the tray by its tile label ("tray 1B").
    • Type and colour mismatch lines are added under the map.
    • With no rows there are no warnings, the same guard as before.
  • QIDI: the options panel and the printing guard are unchanged. Use Box off greys the map and sends no mapping.
  • Nozzle badges follow filament_map only when the device's slots say which nozzle they feed. A U1, whose filament_map may name toolheads, shows filament numbers.
  • Light/dark theme and DPI: the panel's sys_color_changed and msw_rescale handlers are called from the dialog.

Tests

tests/slic3rutils/third_party_filament_map_tests.cpp (new; the PR's model tests were moved out of the Elegoo file):

  • Labels per host kind: CANVAS with 0-based and 1-based trays, a 1-based unit and two units; U1 T1..T4; QIDI one and two Boxes.
  • Auto-match per host kind: U1/CANVAS closest colour; QIDI material-first, an unloaded slot, no type, and the same slots treated as a non-Box host.
  • Remembered CANVAS mapping beats the colour match and encodes to the protocol index.
  • Encode, read-only identity, mismatch and badges. The badge cases include U1 with a multi-nozzle filament_map.

Builds

  • Windows: edgebuild job 342 (swatch). It runs slic3rutils_tests, installs a test copy at C:/Dev/EdgeSlicerTest/swatch and runs the G-code gate. Result: succeeded on the VM; slic3rutils_tests all passed (1324 cases, the 10 new map cases included); G-code gate IDENTICAL 10/10 vs the Windows baseline 6b47212.
  • Mac: edgebuild job 341 (swatch_mac, --app). slic3rutils_tests: all passed (1337 cases). Test copy at ~/EdgeSlicerTest/swatch_mac/EdgeSlicer.app.

Hand test

  • CC1 Upload and Print: swatches labelled 1A..1D in tray order. Send once with a non-default pick, reopen, and check that the remembered pick is preselected. Warnings read "tray 1B" etc.
  • U1 send dialog: T1..T4 swatches with the right colours; an empty head shows -. Badges show filament numbers.
  • QIDI Box: code review only (no printer).
  • A host with no slots (plain OctoPrint/Moonraker without filament names) looks unchanged.
  • Light/dark theme switch with the dialog open; popup open then close dialog.
  • Mac copy: same CC1/U1 glance.

Draft until the owner's hand test. No printer was contacted by the agent.

cursor Bot pushed a commit that referenced this pull request Oct 19, 2026
…-sync-d523

Carry the shared Bambu-style filament map panel (#625 via #616) up the
Creality stack. CFS sync has no send-dialog mapping of its own.

Conflicts in printhost_devices_tests.cpp kept both the CFS sync
preset-match cases and the color_match_from_positions identity test.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 19, 2026
…f039-38ab

Adopt the shared Bambu-style filament map panel for K3 direct-rack
printers (third_party_map_read_only). Read-only mapping[i] is the
identity T-number slot so tiles, highlight and mapping_warning() agree.
filament_mapping() stays empty; start remains opGcodeFile.

T1-T3 counts only lines whose previous non-blank is "; custom gcode end"
(allowing ;_FORCE_RESUME_FAN_SPEED). A preceding T0 block cannot credit
a later T1-T3 (F10).

Conflicts in PrintHostDialogs kept K3 mapping_warning() next to the
#625 third_party_mismatch_warning() helper.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 19, 2026
…er-mmu-slots-f5f8

Adopt the shared Bambu-style filament map panel for Happy Hare, AFC, and
QIDI Box hosts only (not Snapmaker/U1). Gates/lanes/Box slots group as
1A-1D with colour and type; Slot::index and the sent mapping stay the
same.

Conflicts in PrintHostDeviceStatus kept both the Happy Hare/AFC parsers
and the QIDI Box helpers from #625.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Elegoo CC upload now uses MaterialItem colour cards and a MappingItem
slot popup instead of a text combo, while the start-print slot_map is
unchanged. Other hosts keep the existing rows; Bambu and Snapmaker
are not switched over.

Deft
Call the panel's DPI/theme handlers from the send dialog, use dark-mode colours only on the new badge and panel paths, add the panel to gettext, label Elegoo warnings with the same 1A-1D tiles, shrink the badge so long types still fit, number unit-less slots 1..N, and keep read-only auto-match visual while encoding an empty mapping.

Deft
update_mapping_note combines mapping_warning() and third_party_mismatch_warning(). Read-only mismatch compares T-number identity, not the visual auto-match. The nozzle badge pill follows Body_10 extent so labels like 10 fit.

Deft
Every third-party send dialog that gets named slots from its printer now
shows the Bambu-style swatch map instead of the per-filament dropdown:
Elegoo CANVAS, Snapmaker U1 toolheads and the QIDI Box. A host with no
slots shows no rows, as before; Flashforge keeps its IFS dialog.

Tiles are labelled by position, never by the printer's raw ids:
CANVAS units in order of appearance and trays by their place in the
unit (1A..1D, 2A..), so a 1-based tray_id no longer reads B, C, D, A;
QIDI Box slot b*4+n is <b+1><A+n>; tool slots are T1..T4.

The starting slot keeps the old rule (initial_slot_position): the
remembered Elegoo mapping first, else the closest colour, or on a QIDI
Box the filament's own material first. Nozzle badges only follow
filament_map when the slots say which nozzle they feed, so a U1 shows
filament numbers. The Elegoo warnings keep their old msgids and name the
tray by its tile label. No rows means no warnings.

The map's tests move to third_party_filament_map_tests.cpp and cover
labels, auto-match and remembered mappings per host kind.

Deft
@aceRage
aceRage force-pushed the cursor/third-party-filament-map-c9fb branch from 884d042 to db03bc4 Compare October 20, 2026 13:11
@aceRage aceRage changed the title Bambu-style filament mapping row for third-party send dialogs (Elegoo CC) Bambu-style swatch map for third-party send dialogs (CANVAS, U1, QIDI Box) Oct 20, 2026
update_mapping_note() keeps the no-rows guard and adds #643's QIDI Box
problem lines. On a QIDI Box those lines replace the swatch map's own
type/colour mismatch lines, so a wrong-material slot is reported once.

Deft
aceRage added a commit that referenced this pull request Oct 20, 2026
@aceRage
aceRage marked this pull request as ready for review October 20, 2026 23:46
@aceRage
aceRage merged commit ac5d397 into main Oct 20, 2026
1 check passed
aceRage added a commit that referenced this pull request Oct 21, 2026
…n empty dropdown

The printer ComboBox no longer opens when it has no items, and the Bambu
send dialogs show a translated placeholder instead of a blank label.
Edge has no ForceDropdownOpen (upstream's third ComboBox site); the
empty-list guard is on mouseDown and keyDown, using texts rather than
upstream's items. Third-party send dialogs (#625 Elegoo, Moonraker/QIDI)
use wxComboBox, not this widget.

Deft
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