plates.ts 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. // `preset_defining` marks the ones that *are* the picked process preset —
  50. // layer height and first layer height — which must not be carried over an
  51. // explicit preset pick without the user asking. Also offered, never
  52. // pre-selected.
  53. export interface DesignOverride {
  54. key: string;
  55. value: unknown;
  56. printer_coupled: boolean;
  57. preset_defining: boolean;
  58. }
  59. export interface ArchivePlatesResponse extends EmbeddedPresets {
  60. archive_id: number;
  61. filename: string;
  62. plates: PlateMetadata[];
  63. is_multi_plate: boolean;
  64. has_gcode?: boolean;
  65. }
  66. export interface LibraryFilePlatesResponse extends EmbeddedPresets {
  67. file_id: number;
  68. filename: string;
  69. plates: PlateMetadata[];
  70. is_multi_plate: boolean;
  71. }
  72. export interface ViewerPlateSelectionState {
  73. selected_plate_id: number | null;
  74. }
  75. export interface PlateAssignment {
  76. object_id: string;
  77. plate_id: number | null;
  78. }