Package jmri

Interface Light

All Superinterfaces:
Comparable<NamedBean>, DigitalIO, NamedBean, PropertyChangeProvider
All Known Subinterfaces:
VariableLight
All Known Implementing Classes:
AbstractLight, AbstractVariableLight, AcelaLight, AnymaDMX_UsbLight, CbusLight, DCCppLight, IpocsLight, JMRIClientLight, LnLight, MqttLight, NceLight, OlcbLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialX10Light, SpecificInsteonLight, SpecificInsteonLight, SpecificLight, SpecificLight, SpecificX10Light, SpecificX10Light, XBeeLight, XNetLight

public interface Light
extends DigitalIO
Represent a single visible Light on the physical layout.

Each Light may have one or more control mechanisms. Control mechanism types are defined here. If a Light has any controls, the information is contained in LightControl objects, which are referenced via that Light.

Lights have a state and an intensity.

The intensity of the hardware output is represented by the range from 0.0 to 1.0, with 1.0 being brightest.

The primary states are:

  • ON, corresponding to maximum intensity
  • INTERMEDIATE, some value between maximum and minimum
  • OFF, corresponding to minimum intensity
The underlying hardware may provide just the ON/OFF two levels, or have a semi-continuous intensity setting with some number of steps.

The light has a TargetIntensity property which can be set directly. In addition, it has a CurrentIntensity property which may differ from TargetIntensity while the Light is being moved from one intensity to another.

Intensity is limited by MinIntensity and MaxIntensity parameters. Setting the state to ON sets the TargetIntensity to MinIntensity, and to OFF sets the TargetIntensity to MaxIntensity. Attempting to directly set the TargetIntensity outside the values of MinIntensity and MaxIntensity (inclusive) will result in the TargetIntensity being set to the relevant limit.

Because the actual light hardware has only finite resolution, the intensity value is mapped to the nearest setting. For example, in the special case of a two-state (on/off) Light, setting a TargetIntensity of more than 0.5 will turn the Light on, less than 0.5 will turn the light off.

Specific implementations will describe how the settings map to the particular hardware commands.

The transition rate is absolute; the intensity changes at a constant rate regardless of whether the change is a big one or a small one.


This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.