plates.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. }
  40. export interface ArchivePlatesResponse extends EmbeddedPresets {
  41. archive_id: number;
  42. filename: string;
  43. plates: PlateMetadata[];
  44. is_multi_plate: boolean;
  45. has_gcode?: boolean;
  46. }
  47. export interface LibraryFilePlatesResponse extends EmbeddedPresets {
  48. file_id: number;
  49. filename: string;
  50. plates: PlateMetadata[];
  51. is_multi_plate: boolean;
  52. }
  53. export interface ViewerPlateSelectionState {
  54. selected_plate_id: number | null;
  55. }
  56. export interface PlateAssignment {
  57. object_id: string;
  58. plate_id: number | null;
  59. }