fixture

package
v0.0.0-...-f5beb5c Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindChannelNumberByName

func FindChannelNumberByName(fixture *Fixture, channelName string) (int, error)

func FindColor

func FindColor(myFixtureNumber int, mySequenceNumber int, color string, fixtures *Fixtures) int

FindColor takes the name of a color channel setting like "White" and returns the color number for this type of scanner.

func FindFixtureAddressByGroupAndNumber

func FindFixtureAddressByGroupAndNumber(sequenceNumber int, fixtureNumber int, fixtures *Fixtures) (int16, error)

func FindFixtureAddressByName

func FindFixtureAddressByName(fixtureName string, fixtures *Fixtures) string

func FindGobo

func FindGobo(myFixtureNumber int, mySequenceNumber int, selectedGobo string, fixtures *Fixtures) int

findGobo takes the name of a gobo channel setting like "Open" and returns the gobo number for this type of scanner.

func FindShutter

func FindShutter(myFixtureNumber int, mySequenceNumber int, shutterName string, fixtures *Fixtures) int

FindShutter takes the name of a gobo channel setting like "Open" and returns the gobo number for this type of scanner.

func FixtureReceiver

func FixtureReceiver(
	myFixtureNumber int,
	fixtureStepChannel chan common.FixtureCommand,
	eventsForLaunchpad chan common.ALight,
	guiButtons chan common.ALight,
	switchChannels []common.SwitchChannel,
	soundTriggers []*common.Trigger,
	soundConfig *sound.SoundConfig,
	dmxController *ft232.DMXController,
	fixtures *Fixtures,
	dmxInterfacePresent bool)

FixtureReceivers are created by the sequence and are used to receive step instructions. Each FixtureReceiver knows which step they belong too and when triggered they start a fade up and fade down events which get sent to the launchpad lamps and the DMX fixtures.

func GetChannelSettinsByName

func GetChannelSettinsByName(fixture *Fixture, name string, fixtures *Fixtures) ([]common.Setting, error)

func IsNumericOnly

func IsNumericOnly(str string) bool

func MapFixtures

func MapFixtures(chaser bool, hadShutterChase bool,
	mySequenceNumber int,
	displayFixture int,
	color common.Color,
	pan int, tilt int, shutter int, rotate int, program int, selectedGobo int, scannerColor int,
	fixtures *Fixtures, blackout bool, brightness int, master int, music int, strobe bool, strobeSpeed int,
	dmxController *ft232.DMXController, dmxInterfacePresent bool) (lastColor common.LastColor)

When want to light a DMX fixture we need for find it in our fuxture.yaml configuration file. This function maps the requested fixture into a DMX address.

func MapFixturesColorOnly

func MapFixturesColorOnly(sequenceNumber, selectedFixture, selectedColor int, dmxController *ft232.DMXController, fixtures *Fixtures, dmxInterfacePresent bool)

func MapFixturesGoboOnly

func MapFixturesGoboOnly(sequenceNumber, selectedFixture, selectedGobo int, fixtures *Fixtures, dmxController *ft232.DMXController,
	dmxInterfacePresent bool)

func MapSwitchFixture

func MapSwitchFixture(swiTch common.Switch,
	state common.State,
	RGBFade int,
	dmxController *ft232.DMXController,
	fixturesConfig *Fixtures, blackout bool,
	brightness int, master int, masterChanging bool, lastColor common.LastColor,
	switchChannels []common.SwitchChannel,
	SoundTriggers []*common.Trigger,
	soundConfig *sound.SoundConfig,
	dmxInterfacePresent bool,
	eventsForLaunchpad chan common.ALight,
	guiButtons chan common.ALight,
	fixtureStepChannel chan common.FixtureCommand) common.LastColor

MapSwitchFixture is repsonsible for playing out the state of a swicth. The switch is idendifed by the sequence and switch number.

func SaveFixtures

func SaveFixtures(filename string, fixtures *Fixtures) error

SaveFixtures - saves a complete list of fixtures to fixtures.yaml Returns an error.

func SetChannel

func SetChannel(index int16, data byte, dmxController *ft232.DMXController, dmxInterfacePresent bool)

Types

type Action

type Action struct {
	Name        string `yaml:"name"`
	Number      int
	Colors      []string `yaml:"colors"`
	Mode        string   `yaml:"mode"`
	Fade        string   `yaml:"fade"`
	Size        string   `yaml:"size"`
	Speed       string   `yaml:"speed"`
	Rotate      string   `yaml:"rotate"`
	RotateSpeed string   `yaml:"rotatespeed"`
	Program     string   `yaml:"program"`
	Strobe      string   `yaml:"strobe"`
}

type ActionConfig

type ActionConfig struct {
	Name          string
	Colors        []common.Color
	Fade          int
	NumberSteps   int
	Size          int
	Speed         time.Duration
	TriggerState  bool
	RotateSpeed   int
	Rotatable     bool
	Clockwise     bool
	AntiClockwise bool
	Auto          bool
	Program       int
	Music         int
	MusicTrigger  bool
	Strobe        bool
	StrobeSpeed   int
}

type Channel

type Channel struct {
	Number     int16     `yaml:"number"`
	Name       string    `yaml:"name"`
	Value      *int16    `yaml:"value,omitempty"`
	MaxDegrees *int      `yaml:"maxdegrees,omitempty"`
	Offset     *int      `yaml:"offset,omitempty"` // Offset allows you to position the fixture.
	Comment    string    `yaml:"comment,omitempty"`
	Settings   []Setting `yaml:"settings,omitempty"`
}

type Color

type Color struct {
	R int `yaml:"red"`
	G int `yaml:"green"`
	B int `yaml:"blue"`
	W int `yaml:"white"`
}

type Fixture

type Fixture struct {
	ID                 int       `yaml:"id"`
	Name               string    `yaml:"name"`
	Label              string    `yaml:"label,omitempty"`
	Number             int       `yaml:"number"`
	Description        string    `yaml:"description"`
	Type               string    `yaml:"type"`
	Group              int       `yaml:"group"`
	Address            int16     `yaml:"address"`
	Channels           []Channel `yaml:"channels"`
	States             []State   `yaml:"states,omitempty"`
	MultiFixtureDevice bool      `yaml:"-"` // Calulated internally.
	NumberSubFixtures  int       `yaml:"-"` // Calulated internally.
	UseFixture         string    `yaml:"use_fixture,omitempty"`
}

func GetFixtureDetailsById

func GetFixtureDetailsById(id int, fixtures *Fixtures) (Fixture, error)

GetFixtureDetailsById - find a fixture in the fixtures config. Returns details of the fixture. Returns an error.

func GetFixtureDetailsByLabel

func GetFixtureDetailsByLabel(label string, fixtures *Fixtures) (Fixture, error)

GetFixtureDetailsByLabel - find a fixture in the fixtures config. Returns details of the fixture. Returns an error.

type FixtureInfo

type FixtureInfo struct {
	HasRotate     bool
	HasGobo       bool
	HasColorWheel bool
}

func FindFixtureInfo

func FindFixtureInfo(thisFixture Fixture) FixtureInfo

type Fixtures

type Fixtures struct {
	Fixtures []Fixture `yaml:"fixtures"`
}

func LoadFixtures

func LoadFixtures(filename string) (fixtures *Fixtures, err error)

LoadFixtures opens the fixtures config file. Returns a pointer to the fixtures config. Returns an error.

type Setting

type Setting struct {
	Name    string `yaml:"name"`
	Label   string `yaml:"labe,omitempty"`
	Number  int    `yaml:"number"`
	Channel string `yaml:"channel,omitempty"`
	Value   string `yaml:"value"`
}

type State

type State struct {
	Name        string    `yaml:"name"`
	Number      int16     `yaml:"number"`
	Label       string    `yaml:"label"`
	ButtonColor string    `yaml:"buttoncolor"`
	Master      int       `yaml:"master"`
	Actions     []Action  `yaml:"actions,omitempty"`
	Settings    []Setting `yaml:"settings,omitempty"`
	Flash       bool      `yaml:"flash"`
}

Jump to

Keyboard shortcuts

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