universe

package
v0.0.0-...-eb599cc Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader struct {
	ServiceName string
	Universe    *Universe
}

Loader loads device metadata and instantiates fixtures

func (*Loader) FetchDevices

func (l *Loader) FetchDevices(ctx context.Context) error

FetchDevices loads devices from the device registry, creates fixtures, and adds them to the universe.

type Universe

type Universe struct {
	Number uint8
	// contains filtered or unexported fields
}

Universe represents a set of fixtures in a 512 channel space

func New

func New(number uint8) *Universe

New returns an initialised universe

func (*Universe) AddFixture

func (u *Universe) AddFixture(f domain.Fixture)

AddFixture adds the given fixture to the universe if it does not already exist

func (*Universe) DMXValues

func (u *Universe) DMXValues(override domain.Fixture) [512]byte

DMXValues returns the value of all channels in the universe The given fixture will override the locally held version.

func (*Universe) Find

func (u *Universe) Find(id string) domain.Fixture

Find returns the fixture with the given ID

func (*Universe) Save

func (u *Universe) Save(f domain.Fixture)

Save adds the given fixture to the universe replacing any existing fixture with the same ID

func (*Universe) Valid

func (u *Universe) Valid() bool

Valid returns false if any fixtures have overlapping channel ranges

Jump to

Keyboard shortcuts

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