Class AbstractLight

All Implemented Interfaces:
Comparable<NamedBean>, PropertyChangeProvider, DigitalIO, Light, NamedBean
Direct Known Subclasses:
AbstractVariableLight, AcelaLight, CbusLight, DCCppLight, IpocsLight, JMRIClientLight, LnLight, MqttLight, NceLight, OlcbLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, XBeeLight, XNetLight

public abstract class AbstractLight
extends AbstractNamedBean
implements Light
Abstract class providing partial implementation of the Light interface.

Light objects require a number of instance variables. Since Light objects are created using the standard JMRI systemName/userName concept, accessor routines are provided for setting and editing these instance variables.

Each Light may have one or more control mechanisms, of the types defined in the Light interface. A Light may also not have any control mechanisms defined.

Information for each control mechanism is held in LightControl objects, which also implement the logic for control. A list of LightControls, if any, is kept here, and activation and deactivation of LightControls is through this module.

Instance variables are divided into system-independent and system dependent categories. System independent instance variables are defined here, and their accessor routines are implemented here.

This implementation provides a notional implementation of intensity and transitions. The user can set intensity so long as it's at least the max value (default 1.0) or no more than the minimum value (default 0.0). In that case, the setTargetIntensity operations become a setState to ON or OFF. Setting a target intensity between the min and max is an error, because this type of Light does not support a true analog intensity. Transitions never happen, and setting a TransitionTime greater than 0.0 gives an exception.

Since this form of Light does not do variable intensity nor transitions, it stores both CurrentIntensity and TargetIntensity in a single location, forcing them to be the same