Types

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGeometryReferencePointers

func CreateGeometryReferencePointers[T GeometryReferenceCreation](refPointers *ReferencePointers, source *[]T, parentPrefix string)

func CreateReferencePointers

func CreateReferencePointers[T ReferenceCreation](refPointers *ReferencePointers, source *[]T)

func CreateReferencePointersMap

func CreateReferencePointersMap[T ReferenceCreation](refPointers *ReferencePointers, source *map[string]T)

func GenerateMeshes

func GenerateMeshes[T MeshGenerator](source *[]T, parentTransformation MeshTypes.Matrix) *MeshTypes.Mesh

func ResolveReferences

func ResolveReferences[T ReferenceResolver](refPointers *ReferencePointers, source *[]T)

func ResolveReferencesMap

func ResolveReferencesMap[T ReferenceResolver](refPointers *ReferencePointers, source *map[string]T)

Types

type ActivationGroup

type ActivationGroup struct {
	Name       string
	Attributes []*Attribute
}

func (*ActivationGroup) CreateReferencePointer

func (obj *ActivationGroup) CreateReferencePointer(refPointers *ReferencePointers)

type AnimationSystem

type AnimationSystem struct {
	P1      []float32
	P2      []float32
	P3      []float32
	Radiues float32
}

type ArtNet

type ArtNet struct {
	Maps []*Map
}

key: artnet value, value: dmx value

type Attribute

type Attribute struct {
	Name             string
	Pretty           string
	ActivationGroup  NodeReference[ActivationGroup]
	Feature          NodeReference[Feature]
	MainAttribute    NodeReference[Attribute]
	PhysicalUnit     string
	Color            ColorCIE
	SubPhysicalUnits *[]*SubPhysicalUnit
}

func (*Attribute) CreateReferencePointer

func (obj *Attribute) CreateReferencePointer(refPointers *ReferencePointers)

func (*Attribute) ResolveReference

func (obj *Attribute) ResolveReference(refPointers *ReferencePointers)

type AttributeDefinitions

type AttributeDefinitions struct {
	ActivationGroups []*ActivationGroup
	FeatureGroups    []*FeatureGroup
	Attributes       []*Attribute
}

func (*AttributeDefinitions) CreateReferencePointer

func (obj *AttributeDefinitions) CreateReferencePointer(refPointers *ReferencePointers)

func (*AttributeDefinitions) ResolveReference

func (obj *AttributeDefinitions) ResolveReference(refPointers *ReferencePointers)

type Axis

type Axis struct {
	GeometryBase
}

type Beam

type Beam struct {
	GeometryBase
	LampType         string
	PowerConsumption float32
	LuminousFlux     float32
	ColorTemperature float32
	BeamAngle        float32
	FieldAngle       float32
	ThrowRatio       float32
	RectangleRatio   float32
	BeamRadius       float32
	BeamType         string
	CRI              uint
	EmitterSpectrum  NodeReference[Emitter]
}

func (*Beam) ResolveReference

func (obj *Beam) ResolveReference(refPointers *ReferencePointers)

type Break

type Break struct {
	DMXOffset DMXAddress
	DMXBreak  uint
}

type CITP

type CITP struct {
}

type CRI

type CRI struct {
	CES string
	CRI uint
}

type CRIGroup

type CRIGroup struct {
	ColorTemperature float32
	CRIs             []*CRI
}

type ChannelFunction

type ChannelFunction struct {
	Name              string
	Attribute         NodeReference[Attribute]
	OriginalAttribute string
	DMXFrom           DMXValue
	Default           DMXValue
	PhysicalFrom      float32
	PhysicalTo        float32
	RealFade          float32
	RealAcceleration  float32
	Wheel             NodeReference[Wheel]
	Emitter           NodeReference[Emitter]
	Filter            NodeReference[Filter]
	ColorSpace        NodeReference[ColorSpace]
	Gamut             NodeReference[Gamut]
	ModeMaster        string //TODO: reference to dmx channel or other channel function
	ModeFrom          DMXValue
	ModeTo            DMXValue
	DMXProfile        NodeReference[DMXProfile]
	Min               float32 // Fallback to PhysicalFrom if 0.0
	Max               float32 // Fallback to PhysicalTo if 0.0
	CustomName        string  // Default: Node Name of the Channel function Example: Head_Dimmer.Dimmer.Dimmer
	ChannelSets       []*ChannelSet
	SubChannelSets    []*SubChannelSet
}

func (*ChannelFunction) ResolveReference

func (obj *ChannelFunction) ResolveReference(refPointers *ReferencePointers)

type ChannelSet

type ChannelSet struct {
	Name         string
	DMXFrom      DMXValue
	PhysicalFrom float32
	PhysicalTo   float32
	WheelSlot    NodeReference[WheelSlot]
}

func (*ChannelSet) ResolveReference

func (obj *ChannelSet) ResolveReference(refPointers *ReferencePointers)

type ColorCIE

type ColorCIE struct {
	X  float32
	Y  float32
	Y2 float32
}

format xyY (X,Y,Y2)

type ColorSpace

type ColorSpace struct {
	Name       string
	Mode       string //enum + TODO: default data (see https://www.gdtf.eu/gdtf/file-spec/physical-descriptions/#table-20-color-space-attributes)
	Red        ColorCIE
	Green      ColorCIE
	Blue       ColorCIE
	WhitePoint ColorCIE
}

type Connector

type Connector struct {
	Name     string
	Type     string
	DMXBreak uint    // obsolete (see https://www.gdtf.eu/gdtf/file-spec/physical-descriptions/#table-27-connector-attributes)
	Gender   int     // obsolete
	Length   float32 // obsolete
}

type DMXAddress

type DMXAddress struct {
	Address  int16 // 0 indexed
	Universe int   // 0 indexed
}

type DMXChannel

type DMXChannel struct {
	DMXBreak        int
	Offset          []int
	InitialFunction NodeReference[ChannelFunction] //TODO:
	Highlight       DMXValue
	Geometry        string
	LogicalChannels []*LogicalChannel
}

func (DMXChannel) GetName

func (element DMXChannel) GetName() string

func (*DMXChannel) ResolveReference

func (obj *DMXChannel) ResolveReference(refPointers *ReferencePointers, mode *DMXMode)

type DMXMode

type DMXMode struct {
	Name        string
	Description string
	Geometry    NodeReference[GeometryNodeReference]
	DMXChannels []*DMXChannel
	Relations   []*Relation
	FTMacros    []*FTMacro
}

func (*DMXMode) CreateReferencePointer

func (obj *DMXMode) CreateReferencePointer(refPointers *ReferencePointers)

func (*DMXMode) ResolveReference

func (obj *DMXMode) ResolveReference(refPointers *ReferencePointers)

type DMXProfile

type DMXProfile struct {
	Name   string
	Points []*Point
}

func (*DMXProfile) CreateReferencePointer

func (obj *DMXProfile) CreateReferencePointer(refPointers *ReferencePointers)

type Display

type Display struct {
	GeometryBase
	Texture FileReference
}

type Emitter

type Emitter struct {
	Name               string
	Color              ColorCIE
	DominantWaveLength float32
	DiodePart          string
	Measurements       []*Measurement
}

func (*Emitter) CreateReferencePointer

func (obj *Emitter) CreateReferencePointer(refPointers *ReferencePointers)

type FTMacro

type FTMacro struct {
	Name            string
	ChannelFunction NodeReference[ChannelFunction]
	MacroDMXs       []*MacroDMX
}

func (*FTMacro) ResolveReference

func (obj *FTMacro) ResolveReference(refPointers *ReferencePointers)

type Feature

type Feature struct {
	Name       string
	Attributes []*Attribute
}

type FeatureGroup

type FeatureGroup struct {
	Name     string
	Pretty   string
	Features []*Feature
}

func (*FeatureGroup) CreateReferencePointer

func (obj *FeatureGroup) CreateReferencePointer(refPointers *ReferencePointers)

type FileReference

type FileReference = string // without extension and without path

type Filter

type Filter struct {
	Name         string
	Color        ColorCIE
	Measurements []*Measurement
}

func (*Filter) CreateReferencePointer

func (obj *Filter) CreateReferencePointer(refPointers *ReferencePointers)

type FilterBeam

type FilterBeam struct {
	GeometryBase
}

type FilterColor

type FilterColor struct {
	GeometryBase
}

type FilterGobo

type FilterGobo struct {
	GeometryBase
}

type FilterShaper

type FilterShaper struct {
	GeometryBase
}

type FixtureType

type FixtureType struct {
	FixtureTypeID    string
	Name             string
	ShortName        string
	LongName         string
	Manufacturer     string
	Description      string
	Thumbnail        NodeReference[image.Image]
	ThumbnailOffsetX int
	ThumbnailOffsetY int
	CanHaveChildren  bool
	RefFT            *string

	AttributeDefinitions AttributeDefinitions
	Wheels               []*Wheel
	PhysicalDescriptions []*PhysicalDescription
	Models               []*Model
	Geometries           Geometries
	DMXModes             map[string]*DMXMode
	Revisions            []*Revision
	FTPresets            *[]string
	Protocols            Protocol
}

func (*FixtureType) CreateReferencePointer

func (obj *FixtureType) CreateReferencePointer(refPointers *ReferencePointers)

func (*FixtureType) ResolveReference

func (obj *FixtureType) ResolveReference(refPointers *ReferencePointers)

type GDTF

type GDTF struct {
	DataVersion string
	FixtureType FixtureType
}

func (*GDTF) BuildMesh

func (obj *GDTF) BuildMesh(dmxMode string) (*MeshTypes.Mesh, error)

Assemble a mesh based on entire geometry

func (*GDTF) CreateReferencePointer

func (obj *GDTF) CreateReferencePointer(refPointers *ReferencePointers)

func (*GDTF) ResolveReference

func (obj *GDTF) ResolveReference(refPointers *ReferencePointers)

type Gamut

type Gamut struct {
	Name   string
	Points []*ColorCIE
}

func (*Gamut) CreateReferencePointer

func (obj *Gamut) CreateReferencePointer(refPointers *ReferencePointers)

type Geometries

type Geometries struct {
	GeometryList          []*Geometry
	AxisList              []*Axis
	FilterBeamList        []*FilterBeam
	FilterColorList       []*FilterColor
	FilterGoboList        []*FilterGobo
	FilterShaperList      []*FilterShaper
	BeamList              []*Beam
	MediaServerLayerList  []*MediaServerLayer
	MediaServerCameraList []*MediaServerCamera
	MediaServerMasterList []*MediaServerMaster
	DisplayList           []*Display
	LaserList             []*Laser
	GeometryReferenceList []*GeometryReference
	WiringObjectList      []*WiringObject
	InventoryList         []*Inventory
	StructureList         []*Structure
	SupportList           []*Support
	MagnetList            []*Magnet

	Parent *GeometryNodeReference
}

func (*Geometries) CreateGeometryReferencePointer

func (obj *Geometries) CreateGeometryReferencePointer(refPointers *ReferencePointers, parentPrefix string)

func (*Geometries) GenerateMesh

func (obj *Geometries) GenerateMesh(parentTransformation MeshTypes.Matrix) *MeshTypes.Mesh

func (*Geometries) ResolveReference

func (obj *Geometries) ResolveReference(refPointers *ReferencePointers)

type Geometry

type Geometry struct {
	GeometryBase
}

type GeometryBase

type GeometryBase struct {
	Name     string
	Model    NodeReference[Model]
	Position Matrix
	Geometries
}

func (*GeometryBase) CreateGeometryReferencePointer

func (obj *GeometryBase) CreateGeometryReferencePointer(refPointers *ReferencePointers, parentPrefix string)

func (*GeometryBase) GenerateMesh

func (obj *GeometryBase) GenerateMesh(parentTransformation MeshTypes.Matrix) *MeshTypes.Mesh

func (*GeometryBase) ResolveReference

func (obj *GeometryBase) ResolveReference(refPointers *ReferencePointers)

type GeometryNodeReference

type GeometryNodeReference struct {
	Ptr  any
	Type string
}

type GeometryReference

type GeometryReference struct {
	Name        string
	Model       NodeReference[Model]
	Position    Matrix
	GeometryRef NodeReference[GeometryNodeReference] // only top level geometries allowed to be referenced
	Breaks      []*Break
}

func (*GeometryReference) GenerateMesh

func (obj *GeometryReference) GenerateMesh(parentTransformation MeshTypes.Matrix) *MeshTypes.Mesh

func (*GeometryReference) ResolveReference

func (obj *GeometryReference) ResolveReference(refPointers *ReferencePointers)

type GeometryReferenceCreation

type GeometryReferenceCreation interface {
	CreateGeometryReferencePointer(refPointers *ReferencePointers, parentPrefix string)
}

type Hex

type Hex = int

type Inventory

type Inventory struct {
	GeometryBase
	Count int
}

type Laser

type Laser struct {
	GeometryBase
	ColorType         string  // enum
	Color             float32 // Required if ColorType is “SingleWaveLength”; Unit:nm (nanometers)
	OutputStrength    float32
	Emitter           NodeReference[Emitter]
	BeamDiameter      float32
	BeamDivergenceMin float32
	BeamDivergenceMax float32
	ScanAnglePan      float32
	ScanAngleTilt     float32
	ScanSpeed         float32
	Protocols         []*LaserProtocol
}

func (*Laser) ResolveReference

func (obj *Laser) ResolveReference(refPointers *ReferencePointers)

type LaserProtocol

type LaserProtocol struct {
	Name string
}

type LegHeight

type LegHeight struct {
	Value float32
}

type LogicalChannel

type LogicalChannel struct {
	Attribute          NodeReference[Attribute]
	Snap               string // enum
	Master             string // enum
	MibFade            float32
	DMXChangeTimeLimit float32
	ChannelFunctions   []*ChannelFunction
}

func (*LogicalChannel) ResolveReference

func (obj *LogicalChannel) ResolveReference(refPointers *ReferencePointers)

type MacroDMX

type MacroDMX struct {
	Steps []*MacroDMXStep
}

func (*MacroDMX) ResolveReference

func (obj *MacroDMX) ResolveReference(refPointers *ReferencePointers)

type MacroDMXStep

type MacroDMXStep struct {
	Duration  float32
	DMXValues []*MacroDMXValue
}

func (*MacroDMXStep) ResolveReference

func (obj *MacroDMXStep) ResolveReference(refPointers *ReferencePointers)

type MacroDMXValue

type MacroDMXValue struct {
	Value      DMXValue
	DMXChannel NodeReference[DMXChannel]
}

func (*MacroDMXValue) ResolveReference

func (obj *MacroDMXValue) ResolveReference(refPointers *ReferencePointers)

type Magnet

type Magnet struct {
	GeometryBase
}

type Map

type Map struct {
	Key   uint // Art-Net value
	Value uint // DMX value
}

type Matrix

type Matrix [4][4]float64

The transformation matrix consists 4 x 4 floats. Stored in a row-major order. For example, each row of the matrix is stored as a 4- component vector. The mathematical definition of the matrix is in a column-major order. For example, the matrix rotation is stored in the first three columns, and the translation is stored in the 4th column. The metric system consists of the Right- handed Cartesian Coordinates XYZ:

X – from left (-X) to right (+X),
Y – from the outside of the monitor (-Y) to the inside of the monitor (+Y),
Z – from bottom (-Z) to top (+Z). 0,0,0 – center base.

type Measurement

type Measurement struct {
	Phyiscal          float32
	LuminousIntensity float32
	Transmission      float32
	InterpolationTo   string
	MeasurementPoints []*MeasurementPoint
}

type MeasurementPoint

type MeasurementPoint struct {
	WaveLength float32
	Energy     float32
}

type MediaServerCamera

type MediaServerCamera struct {
	GeometryBase
}

type MediaServerLayer

type MediaServerLayer struct {
	GeometryBase
}

type MediaServerMaster

type MediaServerMaster struct {
	GeometryBase
}

type MeshGenerator

type MeshGenerator interface {
	GenerateMesh(parentTransformation MeshTypes.Matrix) *MeshTypes.Mesh
}

type Model

type Model struct {
	Name            string
	Length          float32 // in meter
	Width           float32 // in meter
	Height          float32 // in meter
	PrimitiveType   string  // enum
	File            *string
	SVGOffsetX      float32
	SVGOffsetY      float32
	SVGSideOffsetX  float32
	SVGSideOffsetY  float32
	SVGFrontOffsetX float32
	SVGFrontOffsetY float32
	Mesh            *MeshTypes.Mesh
}

func (*Model) CreateReferencePointer

func (obj *Model) CreateReferencePointer(refPointers *ReferencePointers)

type NodeReference

type NodeReference[T any] struct {
	String string
	Ptr    *T
}

type OpenSoundControl

type OpenSoundControl struct {
}

type OperatingTemperature

type OperatingTemperature struct {
	Low  float32
	High float32
}

type PhysicalDescription

type PhysicalDescription struct {
	Emitters              []*Emitter
	Filters               []*Filter
	ColorSpace            *ColorSpace
	AdditionalColorSpaces []*ColorSpace
	Gamuts                []*Gamut
	DMXProfiles           []*DMXProfile
	CRIs                  []*CRIGroup
	Connectors            []*Connector
	Properties            *Properties
}

func (*PhysicalDescription) CreateReferencePointer

func (obj *PhysicalDescription) CreateReferencePointer(refPointers *ReferencePointers)

type PinPatch

type PinPatch struct {
	ToWiringObject NodeReference[WiringObject]
	FromPin        int
	ToPin          int
}

func (*PinPatch) ResolveReference

func (obj *PinPatch) ResolveReference(refPointers *ReferencePointers)

type Point

type Point struct {
	DMXPercentage float32
	CFC0          float32
	CFC1          float32
	CFC2          float32
	CFC3          float32
}

type PosiStageNet

type PosiStageNet struct {
}

type PrismFacet

type PrismFacet struct {
	Color    ColorCIE
	Rotation Rotation
}

type Properties

type Properties struct {
	OperatingTemperature *OperatingTemperature
	Weight               *Weight
	PowerConsumption     any
	LegHeight            *LegHeight
}

type Protocol

type Protocol struct {
	RDM              []*RDM
	ArtNet           []*ArtNet
	SACN             []*SACN
	PosiStageNet     []*PosiStageNet
	OpenSoundControl []*OpenSoundControl
	CITP             []*CITP
}

func (*Protocol) ResolveReference

func (obj *Protocol) ResolveReference(refPointers *ReferencePointers)

type RDM

type RDM struct {
	ManufacturerID   Hex
	DeviceModelID    Hex
	SoftwareVersions []*RDMSoftwareVersion
}

func (*RDM) ResolveReference

func (obj *RDM) ResolveReference(refPointers *ReferencePointers)

type RDMDMXPersonality

type RDMDMXPersonality struct {
	Value   Hex
	DMXMode NodeReference[DMXMode] // reference to DMX Mode
}

func (*RDMDMXPersonality) ResolveReference

func (obj *RDMDMXPersonality) ResolveReference(refPointers *ReferencePointers)

type RDMSoftwareVersion

type RDMSoftwareVersion struct {
	Value            Hex
	DMXPersonalities []*RDMDMXPersonality
}

func (*RDMSoftwareVersion) ResolveReference

func (obj *RDMSoftwareVersion) ResolveReference(refPointers *ReferencePointers)

type ReferenceCreation

type ReferenceCreation interface {
	CreateReferencePointer(refPointers *ReferencePointers)
}

type ReferencePointers

type ReferencePointers struct {
	ActivationGroups map[string]*ActivationGroup
	Features         map[string]*Feature
	Attributes       map[string]*Attribute
	Wheels           map[string]*Wheel
	WheelSlots       map[string]*WheelSlot
	Emitters         map[string]*Emitter
	Filters          map[string]*Filter
	ColorSpaces      map[string]*ColorSpace // TODO: find example since spec sheet is not specific enough
	Gamuts           map[string]*Gamut
	DMXProfiles      map[string]*DMXProfile
	DMXModes         map[string]*DMXMode
	DMXChannels      map[string]*DMXChannel
	SubPhysicalUnits map[string]*SubPhysicalUnit //TODO: find example since spec sheet is not specific enough
	WiringObjects    map[string]*WiringObject    //TODO: find example since spec sheet is not specific enough
	ChannelFunctions map[string]*ChannelFunction
	Geometries       map[string]*GeometryNodeReference
	Models           map[string]*Model
}

func CreateRefPointersMap added in v0.2.0

func CreateRefPointersMap() *ReferencePointers

type ReferenceResolver

type ReferenceResolver interface {
	ResolveReference(refPointers *ReferencePointers)
}

type Relation

type Relation struct {
	Name     string
	Master   *DMXChannel
	Follower *DMXChannel
	Type     string //enum with "Multiply" or "Override"
}

type Revision

type Revision struct {
	Text       string
	Date       time.Time
	UserID     uint
	ModifiedBy string
}

type Rotation

type Rotation [3][3]float32

Rotation matrix, consist of 3*3 floats. Stored as row-major matrix, i.e. each row of the matrix is stored as a 3-component vector. Mathematical definition of the matrix is column-major, i.e. the matrix rotation is stored in the three columns. Metric system, right-handed Cartesian coordinates XYZ:

X – from left (-X) to right (+X),
Y – from the outside of the monitor (-Y) to the inside of the monitor (+Y),
Z – from the bottom (-Z) to the top (+Z).

type SACN

type SACN struct {
	Maps []*Map
}

type Structure

type Structure struct {
	GeometryBase
	LinkedGeometry            string // for now (analyse if this can be a NodeReference instead)
	StructureType             string // enum
	CrossSectionType          string // enum
	CrossSectionHeight        float32
	CrossSectionWallThickness float32
	TrussCrossSection         string
}

type SubChannelSet

type SubChannelSet struct {
	Name            string
	PhysicalFrom    float32
	PhysicalTo      float32
	SubPhysicalUnit NodeReference[SubPhysicalUnit]
	DMXProfile      NodeReference[DMXProfile]
}

func (*SubChannelSet) ResolveReference

func (obj *SubChannelSet) ResolveReference(refPointers *ReferencePointers)

type SubPhysicalUnit

type SubPhysicalUnit struct {
	Type         string
	PhysicalUnit string
	PhysicalFrom float32
	PhysicalTo   float32
}

type Support

type Support struct {
	GeometryBase
	SupportType      string //enum
	RopeCrossSection string
	RopeOffset       Vector3
	CapacityX        float32
	CapacityY        float32
	CapacityZ        float32
	CapacityXX       float32
	CapacityYY       float32
	CapacityZZ       float32
	ResistanceX      float32
	ResistanceY      float32
	ResistanceZ      float32
	ResistanceXX     float32
	ResistanceYY     float32
	ResistanceZZ     float32
}

type Vector3

type Vector3 struct {
	X float32
	Y float32
	Z float32
}

type Weight

type Weight struct {
	Value float32
}

type Wheel

type Wheel struct {
	Name       string
	WheelSlots []*WheelSlot
}

func (*Wheel) CreateReferencePointer

func (obj *Wheel) CreateReferencePointer(refPointers *ReferencePointers)

func (*Wheel) ResolveReference

func (obj *Wheel) ResolveReference(refPointers *ReferencePointers)

type WheelSlot

type WheelSlot struct {
	Name             string
	Color            ColorCIE
	Filter           NodeReference[Filter] // ref to Physical/Filter
	MediaFileName    *string
	PrismFacets      []*PrismFacet
	AnimationSystems []*AnimationSystem
}

func (*WheelSlot) ResolveReference

func (obj *WheelSlot) ResolveReference(refPointers *ReferencePointers)

type WiringObject

type WiringObject struct {
	GeometryBase
	ConnectorType     string
	ComponentType     string //enum
	SignalType        string
	PinCount          int
	ElectricalPayLoad float32
	VoltageRangeMax   float32
	VoltageRangeMin   float32
	FrequencyRangeMax float32
	FrequencyRangeMin float32
	MaxPayLoad        float32
	Voltage           float32
	SignalLayer       int
	CosPhi            float32
	FuseCurrent       float32 // in ampere
	FuseRating        string  //enum
	Orientation       string  //enum
	WireGroup         string
	PinPatches        []*PinPatch
}

func (*WiringObject) ResolveReference

func (obj *WiringObject) ResolveReference(refPointers *ReferencePointers)

Jump to

Keyboard shortcuts

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