plates.ts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. export interface PlateFilament {
  2. slot_id: number;
  3. type: string;
  4. color: string;
  5. used_grams: number;
  6. used_meters: number;
  7. // True when this AMS slot is consumed by the picked plate. False
  8. // means the slot is configured project-wide but the picked plate
  9. // doesn't paint with it. Sliced 3MFs (.gcode.3mf) report only used
  10. // filaments — the field is true for every entry. Unsliced project
  11. // files report ALL project slots; SliceModal disables the unused
  12. // rows so the user only interacts with the dropdowns that matter,
  13. // while the backend still passes the complete list to the slicer
  14. // CLI to prevent silent fallback to embedded defaults.
  15. used_in_plate?: boolean;
  16. }
  17. export interface PlateMetadata {
  18. index: number;
  19. name: string | null;
  20. objects: string[];
  21. object_count?: number;
  22. has_thumbnail: boolean;
  23. thumbnail_url: string | null;
  24. print_time_seconds: number | null;
  25. filament_used_grams: number | null;
  26. filaments: PlateFilament[];
  27. // Per-plate build plate type so multi-plate prints can show the right
  28. // plate at scheduling time (#1281). Falls back to null for older 3MFs
  29. // that don't carry curr_bed_type in slice_info.config.
  30. bed_type?: string | null;
  31. }
  32. // Printer / process preset names the source 3MF was prepared with, read from
  33. // its project_settings.config. Used by the SliceModal to default its printer
  34. // and process dropdowns (#1325). Null / absent when the file carries no
  35. // embedded slicer config (STL, plain model 3MF, parse failure).
  36. interface EmbeddedPresets {
  37. embedded_printer?: string | null;
  38. embedded_process?: string | null;
  39. // Process settings the designer changed away from the stock preset, read
  40. // from the 3MF's own `different_settings_to_system` (#2622). Offered in the
  41. // SliceModal so a re-slice for another printer can carry them instead of
  42. // losing them to the picked process profile. Empty for STL, OrcaSlicer
  43. // files, and older exports that predate the field.
  44. design_overrides?: DesignOverride[];
  45. }
  46. // One process setting the designer deviated on. `printer_coupled` marks the
  47. // values that only make sense on the machine they were tuned for (speeds,
  48. // accelerations, prime-tower geometry) — offered, but never pre-selected.
  49. export interface DesignOverride {
  50. key: string;
  51. value: unknown;
  52. printer_coupled: boolean;
  53. }
  54. export interface ArchivePlatesResponse extends EmbeddedPresets {
  55. archive_id: number;
  56. filename: string;
  57. plates: PlateMetadata[];
  58. is_multi_plate: boolean;
  59. has_gcode?: boolean;
  60. }
  61. export interface LibraryFilePlatesResponse extends EmbeddedPresets {
  62. file_id: number;
  63. filename: string;
  64. plates: PlateMetadata[];
  65. is_multi_plate: boolean;
  66. }
  67. export interface ViewerPlateSelectionState {
  68. selected_plate_id: number | null;
  69. }
  70. export interface PlateAssignment {
  71. object_id: string;
  72. plate_id: number | null;
  73. }