Add print options to reprint modal and fix AMS mapping for multi-color prints

Features:
  - Add print options UI to reprint modal (bed leveling, flow calibration,
    vibration calibration, first layer inspection, timelapse)
  - Collapsible "Print Options" section with toggle switches
  - Default values: bed leveling=on, vibration_cali=on, others=off

  Fixes:
  - Fix AMS mapping format to match Bambu Studio exactly
    - Use slot_id from 3MF to position tray IDs correctly
    - Fill unused slots with -1 placeholder
    - Add ams_mapping2 with detailed {ams_id, slot_id} pairs
  - Fix print command format for proper printer recognition
    - Add auto_bed_leveling, cfg, extrude_cali_flag, nozzle_offset_cali
    - Use American spelling "bed_leveling" (not British "bed_levelling")
    - Match sequence_id format from official apps
  - Prevent duplicate tray assignment in filament matching

  This resolves the "stuck at filament change" issue on multi-color reprints
  affecting X1C and other multi-AMS printer configurations.
This commit is contained in:
maziggy
2026-01-08 16:27:29 +01:00
parent 63c08c8154
commit 000ef632d8
11 changed files with 416 additions and 153 deletions
+18 -2
View File
@@ -1707,10 +1707,26 @@ export const api = {
used_meters: number;
}>;
}>(`/archives/${archiveId}/filament-requirements`),
reprintArchive: (archiveId: number, printerId: number) =>
reprintArchive: (
archiveId: number,
printerId: number,
options?: {
ams_mapping?: number[];
timelapse?: boolean;
bed_levelling?: boolean;
flow_cali?: boolean;
vibration_cali?: boolean;
layer_inspect?: boolean;
use_ams?: boolean;
}
) =>
request<{ status: string; printer_id: number; archive_id: number; filename: string }>(
`/archives/${archiveId}/reprint?printer_id=${printerId}`,
{ method: 'POST' }
{
method: 'POST',
headers: options ? { 'Content-Type': 'application/json' } : undefined,
body: options ? JSON.stringify(options) : undefined,
}
),
uploadArchive: async (file: File, printerId?: number): Promise<Archive> => {
const formData = new FormData();