SimpleDMXFixture:
Filter:
SimpleDMXControl/Classes (extension) | External Control > DMX

SimpleDMXFixture
ExtensionExtension

a DMX fixture

Description

A class to represent a DMX fixture. A fixture is e.g. an LED par or a moving light. It has a number of channels, a DMX address, and a description. It can be set to a color, or to a raw value.

NOTE: Although DMX addresses are typically documented 1-based, all SimpleDMX data structures are 0-based.

Class Methods

.new

create a new non-descript fixture.

Arguments:

dmxAddr

the starting address of the fixture (0-based).

numChannels

number of channels the fixture uses.

universeId

the id of the universe the fixture is in. This is useful for SimpleDMX devices that support multiple universes. If you are using a single universe, you should keep it at its default value (0).

desc

a Dictionary containing the description of this fixture. It may contain the following keys:

name (optional)
The name of the fixture.
type (optional)
The type of the fixture.
model (optional)
The model of the fixture.
functionality (optional)
A short description of the functionality of the fixture, e.g. "DRGBAWS".
channelTypes (recommended)
An Array of Symbolss describing the semantic of each channel. The symbols are typically one of #[r, g, b, a, white, dim, strobe, dur, x, y, z].
description (recommended)
A String explaning the functionality of the fixture in detail.
manual (recommended)
URL of the manual.
typeRanges (recommended)
A Dictionary with ranges for some channel types.
device

a SimpleDMX device (optional).

.newFor

create a new fixture for a given model.

Arguments:

model

the model of the fixture. This is a Symbol, e.g. :ax3.

mode

the mode the fixture is configured to. This is a Symbol, e.g. :'13'.

dmxAddr

the starting address of the fixture (0-based).

universeId

the id of the universe the fixture is in. This is useful for SimpleDMX devices that support multiple universes. If you are using a single universe, you should keep it at its default value (0).

device

a SimpleDMX device (optional).

.models

a dictionary containing all known models. The keys are the model names, the values are dictionaries of modes. See newFor for more details.

.printKnownModels

print all known models to the console. See newFor for more a usage example.

Instance Methods

Setting values

.set

set the value(s) of a channel (normalised).

Arguments:

key

the key of the channel to set. Either an index (Int), or one of the keys in channelTypes.

val

either a numeric normalised value or an array of normalised values. The values will be assigned to the channels subsequent to the channel specified by key.

send

if true, commits the fixture's state to its device.

.setColor

A convenience method that sets the values of the channels r, g, b and dim.

NOTE: This method works only if the fixture has a channelTypes description that contains r, g, b, and dim. The values for r, g, and b need to be next to each other and in this order.

Arguments:

color

A Color object.

send

if true, commits the fixture's state to its device.

.setRaw

set the value of a channel as raw Integers.

Arguments:

key

the key of the channel to set. Either an index (Int), or one of the keys in channelTypes.

rawVal

an integer or an array of integers. The values will be assigned to the channels subsequent to the channel specified by key.

send

if true, commits the fixture's state to its device.

.send

commits the fixture's state to its device.

Arguments:

flushDevice

if true, flush the device after sending.

.flush

flush (clear) the current state of the fixture to the DMX device.

Introspection

.dmxAddr

the DMX address of the fixture. This is a 0-based value.

.universeId

the universe Id of the fixture. This is a 0-based value. This is useful for SimpleDMX devices that support multiple universes. If you are using a single universe, you should keep it at its default value (0).

.numChannels

the number of channels the fixture uses.

.desc

a Dictionary containing the description of this fixture. See new for more details.

.state

the current state of the fixture. This is an array of integer values. The values are ordered according to the channelTypes description of the fixture. The size of the array is restricted to numChannels.

Examples