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. Originally developed for use with C/MRI, Lights currently are also implemented on Loconet (Digitrax) and Oaktree systems.
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 one of four ways: it may be controlled by a sensor, by a turnout, by the JMRI fast clock, or switched on for a specified time by a sensor. 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, turnout, or fast clock. When the controlling sensor, turnout, or 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.
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 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.
Lights are saved in your layout configuration file, along with turnouts, sensors, signal heads, etc. To store this information on disk, use Store Configuration... 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.