Added Configuration from Item and Plate
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// Configuration links a plate and item with layout spacing for maximum packing.
|
||||
type Configuration struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name,omitempty"`
|
||||
PlateID string `json:"plate_id"`
|
||||
ItemID string `json:"item_id"`
|
||||
SpacingMM float64 `json:"spacing_mm"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// LayoutPosition is the top-left corner of one item on the plate (mm).
|
||||
type LayoutPosition struct {
|
||||
XMM float64 `json:"x_mm"`
|
||||
YMM float64 `json:"y_mm"`
|
||||
}
|
||||
|
||||
// LayoutPreview describes how many items fit on a plate.
|
||||
type LayoutPreview struct {
|
||||
PlateID string `json:"plate_id"`
|
||||
ItemID string `json:"item_id"`
|
||||
SpacingMM float64 `json:"spacing_mm"`
|
||||
PlateWidthMM float64 `json:"plate_width_mm"`
|
||||
PlateHeightMM float64 `json:"plate_height_mm"`
|
||||
PrintableXMM float64 `json:"printable_x_mm"`
|
||||
PrintableYMM float64 `json:"printable_y_mm"`
|
||||
PrintableWMM float64 `json:"printable_width_mm"`
|
||||
PrintableHMM float64 `json:"printable_height_mm"`
|
||||
CellWidthMM float64 `json:"cell_width_mm"`
|
||||
CellHeightMM float64 `json:"cell_height_mm"`
|
||||
FootprintWMM float64 `json:"footprint_width_mm"`
|
||||
FootprintHMM float64 `json:"footprint_height_mm"`
|
||||
Columns int `json:"columns"`
|
||||
Rows int `json:"rows"`
|
||||
Count int `json:"count"`
|
||||
Positions []LayoutPosition `json:"positions"`
|
||||
}
|
||||
Reference in New Issue
Block a user