plates.ts 3.2 KB

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