Toolchanger printers with 4 tools were incorrectly treated as dual-nozzle (IDEX-style) printers in AMS Sync. So I was locked to just tool 1/2.
Adjusted AMS Sync to use dual-nozzle logic only for true 2-nozzle setups (nozzle_nums == 2 and filament_map in {1,2}), and route 3+ tool toolchangers through the generic mapping flow so all tool IDs are handled correctly.
Before:
<img width="2276" height="1738" alt="image" src="https://github.com/user-attachments/assets/ccebc020-37cf-4af6-8568-a9f331f6c08c" />
After:
<img width="2236" height="1662" alt="image" src="https://github.com/user-attachments/assets/030f49c3-463d-4355-95ba-ba8f95a01ecd" />
Tested on / with:
- Snamaker U1
- ARM macOS
# Description
Fixes the Setup Wizard getting stuck on the "Loading......" screen when
running on Wayland sessions.
**Root Cause:** When OrcaSlicer runs under XWayland (Wayland sessions
with `GDK_BACKEND=x11`), WebKit2GTK's compositing mode can fail
silently, causing the Setup Wizard WebView to freeze or render blank.
The JavaScript signal from C++ (`userguide_profile_load_finish`) either
fails to execute or its rendering result never displays, leaving users
permanently stuck.
**Solution:**
1. Set `WEBKIT_DISABLE_COMPOSITING_MODE=1` environment variable to force
software rendering for WebKit2GTK - this is the same fix used by
BambuStudio
2. Enable the 20-second timeout fallback in `load.js` so the wizard
proceeds automatically even if the C++ → JavaScript communication fails
**Files changed:**
- `src/OrcaSlicer.cpp` - Added `WEBKIT_DISABLE_COMPOSITING_MODE` env var
(4 lines)
- `resources/web/guide/0/load.js` - Enabled timeout fallback (2 lines)
# Screenshots/Recordings/Graphs
N/A - This is a Linux/Wayland-specific fix that addresses a rendering
issue. The visual result is simply that the Setup Wizard proceeds past
"Loading......" as expected.
## Tests
1. **On Wayland session (e.g., GNOME on Wayland):**
- Remove existing config (`~/.config/OrcaSlicer/`) to simulate first
launch
- Launch OrcaSlicer
- Verify Setup Wizard proceeds past "Loading......" to the actual wizard
page
2. **On X11 session:**
- Same test as above to verify no regression
3. **Verify env var is set:**
- Check that `WEBKIT_DISABLE_COMPOSITING_MODE=1` is in the process
environment on Linux builds
# Description
This PR lays the groundwork for future OrcaSlicer ↔ printer connectivity
enhancements by modularizing the network agent architecture. It also
adds experimental filament info sync from printers that have a material
station or multi-tool system.
## Architecture Changes
- **Introduce `IPrinterAgent` interface** — an abstraction layer that
allows per-machine printer agent switching at runtime, decoupling
printer communication from the monolithic `NetworkAgent`
- **Introduce `ICloudServiceAgent` interface** — separates cloud service
logic from printer-level communication
- **Extract `OrcaCloudServiceAgent`** — moves Orca cloud service logic
into its own implementation behind `ICloudServiceAgent`
- **Extract `OrcaPrinterAgent`** — wraps the existing BBL printer
communication behind `IPrinterAgent`
- **Add `NetworkAgentFactory`** — factory for creating the appropriate
printer agent per machine
- **Refactor `NetworkAgent`** — slimmed down from monolithic class to a
thinner coordination layer
## New Printer Agents
- **`MoonrakerPrinterAgent`** — Klipper/Moonraker-based printers
- **`QidiPrinterAgent`** — Qidi printers (with Qidi filament box
support)
- **`SnapmakerPrinterAgent`** — Snapmaker printers with filament sync
## Filament Sync (Experimental)
Syncs filament information from printers equipped with AMS-style
material systems or multi-tool changers:
- Qidi printers with Qidi box
- Armored Turtle (AFC) box via Moonraker
- Snapmaker material station
For Qidi printers with Qidi box:
<img width="1200" height="762" alt="Screenshot 2026-01-27 at 20 30 55"
src="https://github.com/user-attachments/assets/155a164f-cd08-40b0-b62b-c3ab7378224e"
/>
Armored Turtle box:
<img width="1135" height="805" alt="Screenshot 2026-01-27 at 20 32 58"
src="https://github.com/user-attachments/assets/50f6618e-eb54-46db-8e01-1197a005fbf0"
/>
# Screenshots/Recordings/Graphs
[filasync.webm](https://github.com/user-attachments/assets/e6bb7f04-8312-4014-b237-6bd3ef792215)
## Tests
<!-- Please describe the tests that you have conducted to verify the
changes made in this PR. -->
When running under XWayland (Wayland sessions with GDK_BACKEND=x11),
WebKit2GTK's compositing mode can fail silently, causing the Setup
Wizard WebView to freeze or render blank. This leaves users stuck on
the "Loading......" screen indefinitely.
Changes:
- Set WEBKIT_DISABLE_COMPOSITING_MODE=1 to force software rendering,
matching the fix used by BambuStudio
- Enable the 20-second timeout fallback in load.js so the wizard
proceeds even if the C++ -> JavaScript signal fails
* Fix active filament preset not matching wizard selection on first run
After completing the setup wizard with only a non-PLA filament selected
(e.g. Generic ABS), the active filament preset defaulted to Generic PLA
instead of the user's selection. This happened because load_presets()
falls back to Generic PLA when the initial printer differs from the
preferred printer, and the first_added_filament override was disabled.
Add post-load correction in apply_config() that switches the active
filament to the first compatible wizard-selected filament when the
current active filament is not in the wizard selection. Also fix the
guide JS (22.js, 23.js) to use the filalist attribute for building
the filament array, and add platform-specific build test commands to
CLAUDE.md.
* Replace @System filaments with vendor-specific overrides in wizard
When the wizard selects a generic filament like "Generic ABS @System",
check if a vendor-specific override exists (e.g. BBL "Generic ABS")
and use that instead. This ensures printer-tuned profiles are preferred,
preventing load_installed_filaments from adding unwanted BBL defaults.
When printers from the default bundle are also selected, both variants
are kept since those printers need the @System version.
Also adds diagnostic logging for filament loading in LoadProfileFamily.
* Guard against persisting presets for Default Printer and fix filament override logic
Prevent export_selections from saving stale preset settings for the
built-in "Default Printer" placeholder, which is only the initial state
before a real printer is loaded. Also require a non-default vendor printer
to be selected before replacing @System filaments with vendor-specific
overrides in the wizard, avoiding incorrect filament substitution when
only the default bundle is present.
layer_height_profile_adaptive() was using object_print_z_height()
(shrinkage-compensated) to bound the profile, but
update_layer_height_profile() validates against
object_print_z_uncompensated_max. When shrinkage compensation is
active, the mismatch causes the adaptive profile to be silently
cleared every frame and replaced with flat layers.
Use object_print_z_uncompensated_height() instead, matching both
the validator and the existing layer_height_profile_from_ranges()
implementation which already uses the uncompensated value.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>