The Light Table
Lights are digital output bits that function as on/off switches. Lights were created to provide easy control for fascia panel lights and scenery lighting. Lights can also be used for any purpose that requires an on/off switch. A light can be used, for example, to activate an electromagnetic decoupler for a pre-determined time in response to a fascia panel button, or play a layout sound via a stationary decoder.
Lights share available digital output bits with Turnouts. Either a Light or a Turnout, but not both, can control a specific digital output bit. Since Lights lack the feedback structure of Turnouts, Lights should not be used to control track switches (turnouts) on the layout; only Turnouts should be used to control track switches. For historical reasons, Signal Head appearances are defined using Turnouts, even though they may actually be physical lights. So Turnouts should be used to reference the digital output bits used with JMRI Signal Heads. Lights should be used if you need a simple mechanism to control scenery lighting or panel lights, or for other on/off tasks where the control mechanisms of Lights fit the need.
Optionally a Light may be controlled in five ways: it may be controlled by a single sensor, by two sensors, by a turnout, by the JMRI fast clock, or switched on for a specified time by a sensor. One or more of these controls may be specified when the Light is created, or when it is edit via the Light Table.
When a Light is created, or when it is read from a configuration file, the Light is 'activated'; it is set up to monitor automatically any changes in state of its control sensor(s), turnout, or fast clock. When the controlling sensor, turnout, or fast clock changes in a user-specified way, the Light is switched on or off. Lights can also be controlled by logixs, if more complicated control logic is needed.
The Light Table contains an 'Enabled' column. For a Light to be triggered by its control sensor, the fast clock, or its control turnout, it must be "enabled", that is, its check box in the 'Enabled' column must be checked. You can uncheck this box to temporarily disable a Light from being triggered, i.e. prevent it switching when its control mechanism fires.
A light may also be a variable light. This will depend on the interface and the hardware driving the light.
Switching a Light On or Off
Lights may be turned on or off by clicking the button in the State column of the Light Table. A Light may be set up to follow the state of a track switch (turnout), on when the turnout is closed, and off when it is thrown, or vice versa. A light may be set to follow the state of a block occupancy sensor, on when the sensor is active, and off when it is inactive, or vice versa. A Light may also be set by a fascia panel button if a sensor for that button is defined as the control sensor. A light may be configured to follow the JMRI fast clock, on for a specified time period, then off. A Light may be controlled by two sensors, on when either of the two sensors is active (or inactive). Two sensor control is useful in controlling layout sounds or crossing gates. A Light may also be controlled from a logix, as the action of one of its conditionals. If you need more powerful logic to control your Light, consider using a logix.
Note that enabled/disabled applies only to a Light's automated control mechanism. A 'disabled' state will not prevent a Light from being turned on or off using the button in the Light Table or from being controlled by a logix.
A variable light may also be adjusted by entering a value of 0.00 to 1.00 in the intensity column for the light. A light that does not support variable intensities will consider any non zero value as meaning on. If a light has transition effects enabled and configured the light will respond according to those options.
The status button for a variable light will also be a status indication of the variable light. When it is not on or off it will show if the last change was moving higher or lower. The intensity displayed will be the current intensity, not the target intensity, when transition effects are enabled.
Creating New LightsTo define a new light, click the Add... button the light table. This will take you to a new window for adding or editing Lights.
Saving Lights to Disk
Lights are saved in your layout configuration file, along with turnouts, sensors, signal heads, etc. To store this information on disk, use Store > in the File menu at the top of the Light Table (or other tables from the Tools menu), or select Store Panel... in the Panel menu. Note that the enabled/disabled state of each Light is not saved in the configuration file. When Lights are loaded from a configuration file, they are all enabled.