models

package
v0.0.0-...-3473728 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ProjectFileType = "file"
View Source
const ProjectImageType = "image"
View Source
const ProjectModelType = "model"
View Source
const ProjectSliceType = "slice"

Variables

View Source
var ImageExtensions = []string{".png", ".jpg", ".jpeg", ".gif", ".bmp"}
View Source
var ModelExtensions = []string{".stl"}
View Source
var SliceExtensions = []string{".gcode"}

Functions

This section is empty.

Types

type Filament

type Filament struct {
	Length float64 `json:"length" toml:"length" form:"length" query:"length"`
	Mass   float64 `json:"mass" toml:"mass" form:"mass" query:"mass"`
	Weight float64 `json:"weight" toml:"weight" form:"weight" query:"weight"`
}

type Project

type Project struct {
	UUID             string                   `json:"uuid" toml:"uuid" form:"uuid" query:"uuid"`
	Name             string                   `json:"name" toml:"name" form:"name" query:"name"`
	Description      string                   `json:"description" toml:"description" form:"description" query:"description"`
	Path             string                   `json:"path" toml:"path" form:"path" query:"path"`
	ExternalLink     string                   `json:"external_link" toml:"external_link" form:"external_link" query:"external_link"`
	Assets           map[string]*ProjectAsset `json:"-" toml:"-" form:"assets" query:"assets"`
	Tags             []string                 `json:"tags" toml:"tags" form:"tags" query:"tags"`
	DefaultImagePath string                   `json:"default_image_path" toml:"default_image_path" form:"default_image_path" query:"default_image_path"`
	Initialized      bool                     `json:"initialized" toml:"initialized" form:"initialized" query:"initialized"`
}

func NewProject

func NewProject() *Project

func NewProjectFromPath

func NewProjectFromPath(path string) *Project

type ProjectAsset

type ProjectAsset struct {
	SHA1         string        `json:"sha1" toml:"sha1" form:"sha1" query:"sha1"`
	Name         string        `json:"name" toml:"name" form:"name" query:"name"`
	ProjectUUID  string        `json:"project_uuid" toml:"project_uuid" form:"project_uuid" query:"project_uuid"`
	Path         string        `json:"path" toml:"path" form:"path" query:"path"`
	AssetType    string        `json:"asset_type" toml:"asset_type" form:"asset_type" query:"asset_type"`
	Extension    string        `json:"extension" toml:"extension" form:"extension" query:"extension"`
	MimeType     string        `json:"mime_type" toml:"mime_type" form:"mime_type" query:"mime_type"`
	Model        *ProjectModel `json:"model" toml:"model" form:"model" query:"model"`
	ProjectImage *ProjectImage `json:"project_image" toml:"project_image" form:"project_image" query:"project_image"`
	ProjectFile  *ProjectFile  `json:"project_file" toml:"project_file" form:"project_file" query:"project_file"`
	Slice        *ProjectSlice `json:"slice" toml:"slice" form:"slice" query:"slice"`
}

func NewProjectAsset

func NewProjectAsset(fileName string, project *Project, file *os.File) (*ProjectAsset, error)

type ProjectFile

type ProjectFile struct {
	*ProjectAsset
}

func NewProjectFile

func NewProjectFile(fileName string, asset *ProjectAsset, project *Project, file *os.File) (*ProjectFile, error)

func (ProjectFile) MarshalJSON

func (p ProjectFile) MarshalJSON() ([]byte, error)

type ProjectImage

type ProjectImage struct {
	*ProjectAsset
}

func NewProjectImage

func NewProjectImage(fileName string, asset *ProjectAsset, project *Project, file *os.File) (*ProjectImage, error)

func (ProjectImage) MarshalJSON

func (p ProjectImage) MarshalJSON() ([]byte, error)

type ProjectModel

type ProjectModel struct {
	*ProjectAsset
	ImageSha1 string `json:"image_sha1"`
}

func NewProjectModel

func NewProjectModel(fileName string, asset *ProjectAsset, project *Project, file *os.File) (*ProjectModel, error)

func (ProjectModel) MarshalJSON

func (p ProjectModel) MarshalJSON() ([]byte, error)

type ProjectSlice

type ProjectSlice struct {
	*ProjectAsset
	Image      *ProjectAsset `json:"image" toml:"image" form:"image" query:"image"`
	Slicer     string        `json:"slicer" toml:"slicer" form:"slicer" query:"slicer"`
	Filament   *Filament     `json:"filament" toml:"filament" form:"filament" query:"filament"`
	Cost       float64       `json:"cost" toml:"cost" form:"cost" query:"cost"`
	LayerCount int           `json:"layer_count" toml:"layer_count" form:"layer_count" query:"layer_count"`
	Duration   string        `json:"duration" toml:"duration" form:"duration" query:"duration"`
}

func NewProjectSlice

func NewProjectSlice(fileName string, asset *ProjectAsset, project *Project, file *os.File) (*ProjectSlice, error)

func (ProjectSlice) MarshalJSON

func (p ProjectSlice) MarshalJSON() ([]byte, error)

func (*ProjectSlice) ParseGcode

func (s *ProjectSlice) ParseGcode(project *Project) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL