Skip to content

Creality: sync CFS filaments into the project (C6) - #619

Draft
aceRage wants to merge 8 commits into
cursor/creality-cfs-send-d523from
cursor/creality-cfs-sync-d523
Draft

aceRage wants to merge 8 commits into
cursor/creality-cfs-send-d523from
cursor/creality-cfs-sync-d523

Conversation

@aceRage

@aceRage aceRage commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Description

Depends on #625 (merge #625 first) via #616. Merge #616 after #625.

#625 adoption: this PR has no send-dialog mapping of its own. It carries the CFS map panel from #616. Sidebar sync still uses MixedFilamentManager (not filament_is_mixed).

Phase 3 of the Creality send-gap stack (research C6). Sidebar “Sync filaments” on a CFS-capable Creality host reads CFS boxsInfo and applies it through EdgeSlicer’s existing sync path (apply_machine_filament_sync / MixedFilamentManager). The IPrinterAgent framework is not ported (research X1).

Stacked on Phase 2 (cursor/creality-cfs-send-d523). Merge Phase 1 then Phase 2 first.

Does not affect Snapmaker printers (U1 sync is still show_sync_filament_dialog). Needs a Creality K2+CFS hardware smoke. Not a U1 check.

Review 1/3 (B1, F11–F13)

  • B1: sync no longer locks the app. /info is checked first (deadline-bound), boxsInfo uses CrealityWsClient, and the progress dialog has a working Cancel.
  • F11: the progress title is CFS, not CANVAS.
  • F12: the sync button shows only for CFS-capable / K1-family / K2-family models.
  • F13: normalize_filament_type maps PCTG → PC and PLA-CF → PLA.

Re-review 1/3 (F20; B3 via #618)

  • F20: Cancel aborts the in-flight WebSocket (CrealityWsClient::cancel()). query_boxes_info accepts an optional session pointer. The worker join() waits under a wxBusyCursor.

Re-review 2/3 (B5 via #618, B4 via #616, F24)

  • B5: cancel() from this progress dialog is now only an atomic store + net::post(cancel_socket) on the client ioc.
  • F24: the cancellable session is constructed after fetch_info so the boxsInfo budget is not spent on HTTP. Step and total timeouts are timeout_s * 1000.

Upstream sources

  • OrcaSlicer CrealityPrintAgent::parse_cfs_response / normalize_filament_type / match_filament_preset.
  • EdgeSlicer Elegoo CANVAS sync (show_canvas_sync_dialog → FilamentData → apply_machine_filament_sync).

What was adapted

  • match_filament_preset takes a FilamentPresetRef list so Catch2 can score it without PresetCollection / IPrinterAgent.
  • Sidebar::show_cfs_sync_dialog checks /info, then query_boxes_info, skips the external holder, builds FilamentData, then apply_machine_filament_sync.
  • Button tooltip: “Sync filaments from CFS”.
  • Never uses filament_is_mixed.

Expected conflicts

Untested

  • No Creality hardware.
  • Catch2 was not compiled here. New sections cover normalize_filament_type and match_filament_preset scoring only.

Tests

Catch2 v2 in printhost_devices_tests.cpp: PLA Silk → PLA, PLA-CF → PLA, PCTG → PC, Hyper PLA wins over Generic PLA. Also carries #616's color_match_from_positions identity test.

Smoke checklist (Creality hardware)

  1. K2 + CFS: Sync filaments from CFS → project matches the boxes. Progress title says CFS; Cancel aborts the socket (F20) after /info without a zero boxsInfo budget (F24).
  2. Empty CFS: “no loaded slots”; project unchanged.
  3. Unreachable printer: /info fails fast; the app stays usable.
  4. U1 / Bambu / Elegoo CANVAS sync unchanged.
Open in Web Open in Cursor 

cursoragent and others added 5 commits October 19, 2026 01:39
Reuse upstream parse_cfs_response and match_filament_preset inside the
existing sidebar sync path. The CFS list becomes FilamentData and goes
through apply_machine_filament_sync / MixedFilamentManager, the same
route as the Elegoo CANVAS sync. The IPrinterAgent framework is not ported.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
…-sync-d523

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Check /info first, read boxsInfo through the deadline helper, and give
the progress dialog a working cancel plus a CFS title. Show the sync
button only on CFS-capable models. Map PCTG to PC and PLA-CF to PLA.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
…-sync-d523

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
query_boxes_info can take a session the progress dialog cancel()s, and
the join waits under a busy cursor so the UI does not look frozen while
the worker drains.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
cursoragent and others added 2 commits October 19, 2026 02:14
…-sync-d523

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Construct the cancellable WebSocket session only after fetch_info so
the boxsInfo budget is not spent on HTTP, and size that budget from
timeout_s.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
…-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>

This branch has not been deployed

No deployments
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.

2 participants