mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-22 03:49:18 +02:00
fix(virtual-printer): queue mode pins per-slot type+color so scheduler can match colour (#1188)
Edward's diagnosis was exact: the manual /print-queue/ POST extracts filament requirements from the 3MF and writes required_filament_types + filament_overrides + ams_mapping onto the queue item, but the VP queue-mode write path skipped all of that. Net effect: scheduler reached its model-only-matching fallback and auto-dispatched onto whatever printer was free regardless of loaded colour. Extract the scheduler's existing _get_filament_requirements 3MF parser into a shared helper so the VP path can reuse it. VP's _add_to_print_queue now populates required_filament_types unconditionally (cheap; helps the scheduler reject obvious type mismatches) and writes filament_overrides with force_color_match: true per consumed slot when a new per-VP queue_force_color_match toggle is on. Default off to preserve current behaviour for upgraders. UI: new toggle on VirtualPrinterCard, mode-gated to print_queue, mirroring the existing auto-dispatch toggle. i18n: en + de translated, other 6 locales seeded with English copy. Schema: one nullable column on virtual_printers (queue_force_color_match BOOLEAN, default 0/FALSE). 11 new backend tests (8 for the extracted parser, 3 for the VP write path) + 6 new frontend tests (toggle render gating, default state, click posts queue_force_color_match in update body). Existing scheduler tests pass against the refactored helper. README, CHANGELOG, website features page, and wiki virtual-printer page all updated.
This commit is contained in:
@@ -5710,6 +5710,7 @@ export interface VirtualPrinterConfig {
|
||||
serial: string;
|
||||
target_printer_id: number | null;
|
||||
auto_dispatch: boolean;
|
||||
queue_force_color_match: boolean;
|
||||
tailscale_disabled: boolean;
|
||||
bind_ip: string | null;
|
||||
remote_interface_ip: string | null;
|
||||
@@ -5735,6 +5736,7 @@ export const multiVirtualPrinterApi = {
|
||||
access_code?: string;
|
||||
target_printer_id?: number;
|
||||
auto_dispatch?: boolean;
|
||||
queue_force_color_match?: boolean;
|
||||
bind_ip?: string;
|
||||
remote_interface_ip?: string;
|
||||
}) =>
|
||||
@@ -5751,6 +5753,7 @@ export const multiVirtualPrinterApi = {
|
||||
access_code?: string;
|
||||
target_printer_id?: number;
|
||||
auto_dispatch?: boolean;
|
||||
queue_force_color_match?: boolean;
|
||||
tailscale_disabled?: boolean;
|
||||
bind_ip?: string;
|
||||
remote_interface_ip?: string;
|
||||
|
||||
Reference in New Issue
Block a user