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

SimpleDMX
ExtensionExtension

an abstract DMX interface

Description

barebones DMX interface. Not intended to be used directly, but rather to be subclassed by a class that implements the actual DMX interface. For serial-based hardware, see SimpleAbstractSerialDMX.

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

Class Methods

.new

create a new SimpleDMX object

Arguments:

universeSizes

An array of integers, one for each universe, specifying the number of channels in each universe. If not specified, defaults to 512 channels per universe.

cmdperiod

if true, the serial port will be closed on command-period.

Instance Methods

.latency

amount of time to wait before sending DMX data, in seconds. Defaults to nil.

State handling

.add

add the current state of a SimpleDMXFixture to the internal DMX state. Since the fixture knows its universe, it is added to the respective universe. Fails silently if the fixture does not have known universeId. See getUniverse for details.

Arguments:

fixture

the SimpleDMXFixture to add.

.addChannelVals

add values to the internal DMX state. The values are added to the respective universe.

Arguments:

channel

the index where to start inserting values.

vals

an array of values to add.

universeId

the universeId of the universe to add values to. Fails silently if the universe corresponding to universeId does not exist.

.setState

set state(s) of the specified universe. See SimpleDMXUniverse: state for details.

Arguments:

state

an array of values to set. If an array, it is assumed to be an array of values to set.

universeId

the universeId of the universe to set the state of. If not specified, all universes will be set. Fails silently if the universe corresponding to universeId does not exist.

.blackout

.flush

set all channels in a universe to 0.

Arguments:

universeId

the universeId of the universe to blackout. Fails silently if the universe corresponding to universeId does not exist.

.blackoutAll

.flushAll

set all channels in all universes to 0.

Introspection

.universes

an array of SimpleDMXUniverse objects.

.getUniverse

returns the SimpleDMXUniverse with the given universeId. If no such universe exists, returns nil.

Arguments:

id

the universeId of the universe to return.

.trace

if true, debugging information will be printed to the console.

Sending DMX data

.sendDMX

send the current DMX state to the hardware.

Arguments:

universeId

the universeId of the universe to send. If not specified, all universes will be sent. Fails silently if the universe corresponding to universeId does not exist.

Examples