Interface LightControl
- 
- All Known Implementing Classes:
- DefaultLightControl
 
 public interface LightControl Each LightControl object is linked to a specific Light, and provides one of the controls available for switching the Light ON/OFF in response to time or events occurring on the layout.Each LightControl holds the information for one control of the parent Light. Each Light may have as many controls as desired by the user. It is the user's responsibility to ensure that the various control mechanisms do not conflict with one another. Available control types are those defined in the Light.java interface. Control types: SENSOR_CONTROL FAST_CLOCK_CONTROL TURNOUT_STATUS_CONTROL TIMED_ON_CONTROL TWO_SENSOR_CONTROL 
 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. 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateLightControl()Activates a Light Control by control type.booleanareFollowerTimesFaulty(java.util.List<LightControl> compareList)Check to see if we have the FastClock Follower has unique times for a single Light.voiddeactivateLightControl()Deactivates a LightControl by control type.java.lang.StringgetControlSensor2Name()Get the Second Sensor name.java.lang.StringgetControlSensorName()Get the Sensor 1 name for 1 and 2 Sensor Control Types.intgetControlSensorSense()Get the Sensor State used by the 1 Sensor Controljava.lang.StringgetControlTimedOnSensorName()Get the Timed On Trigger Sensor name.java.lang.StringgetControlTurnoutName()Get the LightControl Turnout Name.intgetControlTurnoutState()Get the LightControl Turnout Name.intgetControlType()Get the control type used by the Controljava.lang.StringgetDescriptionText(java.lang.String lightName)Get a Textual Description eg.intgetFastClockOffCombined()Get the Fast Clock Off Hours and Minutes Combined Convenience method of separate getFastClockOnHour() and getFastClockOnMin()intgetFastClockOffHour()Get the Fast Clock Off Hour.intgetFastClockOffMin()Get the Fast Clock Off Minute.intgetFastClockOnCombined()Get the Fast Clock On Hours and Minutes Combined Convenience method of separate getFastClockOnHour() and getFastClockOnMin()intgetFastClockOnHour()Get the Fast Clock On Hour.intgetFastClockOnMin()Get the Fast Clock On Minute.intgetTimedOnDuration()Get the Timed On Control Durationjava.lang.StringgetTimedSensorName()Get the Timed On Trigger Sensor name.booleanonOffTimesFaulty()Check to see if we have the FastClock Follower has unique times for a single Light Control.voidsetControlSensor2Name(java.lang.String sensorName)Set Sensor 2 used by the 2 Sensor Control Does NOT update any changelistenersvoidsetControlSensorName(java.lang.String sensorName)Set Sensor 1 used by the 1 Sensor and 2 Sensor Control Does NOT update any changelisteners If Sensor not present and name not empty, is provided by the SensorManager when #activateLightControl() is calledvoidsetControlSensorSense(int sense)Set the Sensor State used by the Control Does NOT update any changelistenersvoidsetControlTimedOnSensorName(java.lang.String sensorName)Set Sensor used by the Timed On Control Does NOT update any changelistenersvoidsetControlTurnout(java.lang.String turnoutName)Set the Turnout used by the Control Does NOT update any changelistenersvoidsetControlTurnoutState(int state)Set the Turnout State used by the Control Does NOT update any changelistenersvoidsetControlType(int type)Set the control type used by the Control Does NOT update any changelistenersvoidsetFastClockControlSchedule(int onHour, int onMin, int offHour, int offMin)Set a Fast Clock LightControl Schedule.voidsetParentLight(Light l)Set Light to control Does NOT update any changelistenersvoidsetTimedOnDuration(int duration)Set Duration used by the Timed On Control Does NOT update any changeListeners
 
- 
- 
- 
Method Detail- 
getControlTypeint getControlType() Get the control type used by the Control- Returns:
- the Control Type, eg. FAST_CLOCK_CONTROL
 
 - 
setControlTypevoid setControlType(int type) Set the control type used by the Control Does NOT update any changelisteners- Parameters:
- type- the Control Type, eg. FAST_CLOCK_CONTROL
 
 - 
setControlSensorNamevoid setControlSensorName(java.lang.String sensorName) Set Sensor 1 used by the 1 Sensor and 2 Sensor Control Does NOT update any changelisteners If Sensor not present and name not empty, is provided by the SensorManager when #activateLightControl() is called- Parameters:
- sensorName- the Sensor name
 
 - 
getControlSensorSenseint getControlSensorSense() Get the Sensor State used by the 1 Sensor Control- Returns:
- Sensor.ACTIVE or Sensor.INACTIVE
 
 - 
getControlSensorNamejava.lang.String getControlSensorName() Get the Sensor 1 name for 1 and 2 Sensor Control Types.- Returns:
- If a Sensor is registered, returns the Sensor.getName() else the Sensor Name as set by #setControlSensorName
 
 - 
setControlSensorSensevoid setControlSensorSense(int sense) Set the Sensor State used by the Control Does NOT update any changelisteners- Parameters:
- sense- The state to react to, eg. Sensor.ACTIVE or Sensor.INACTIVE
 
 - 
getFastClockOnHourint getFastClockOnHour() Get the Fast Clock On Hour.- Returns:
- On Hour value
 
 - 
getFastClockOnMinint getFastClockOnMin() Get the Fast Clock On Minute.- Returns:
- On Minute value
 
 - 
getFastClockOnCombinedint getFastClockOnCombined() Get the Fast Clock On Hours and Minutes Combined Convenience method of separate getFastClockOnHour() and getFastClockOnMin()- Returns:
- Total combined Minute value
 
 - 
getFastClockOffHourint getFastClockOffHour() Get the Fast Clock Off Hour.- Returns:
- Off Hour value
 
 - 
getFastClockOffMinint getFastClockOffMin() Get the Fast Clock Off Minute.- Returns:
- Off Minute value
 
 - 
getFastClockOffCombinedint getFastClockOffCombined() Get the Fast Clock Off Hours and Minutes Combined Convenience method of separate getFastClockOnHour() and getFastClockOnMin()- Returns:
- Total combined Minute value
 
 - 
setFastClockControlSchedulevoid setFastClockControlSchedule(int onHour, int onMin, int offHour, int offMin) Set a Fast Clock LightControl Schedule.- Parameters:
- onHour- Hour the Light should switch On
- onMin- Minute the Light should switch On
- offHour- Hour the Light should switch Off
- offMin- Minute the Light should switch Off *
 
 - 
getControlTurnoutNamejava.lang.String getControlTurnoutName() Get the LightControl Turnout Name.- Returns:
- The Turnout name
 
 - 
setControlTurnoutvoid setControlTurnout(java.lang.String turnoutName) Set the Turnout used by the Control Does NOT update any changelistenersA Turnout of this name is provided by the TurnoutManager on LightControl Initialisation - Parameters:
- turnoutName- The Turnout name
 
 - 
getControlTurnoutStateint getControlTurnoutState() Get the LightControl Turnout Name.- Returns:
- The Turnout name
 
 - 
setControlTurnoutStatevoid setControlTurnoutState(int state) Set the Turnout State used by the Control Does NOT update any changelisteners- Parameters:
- state- Turnout state to act on, eg. Turnout.CLOSED or Turnout.THROWN
 
 - 
getTimedSensorNamejava.lang.String getTimedSensorName() Get the Timed On Trigger Sensor name.- Returns:
- The Sensor Name as set by #setControlTimedOnSensorName
 
 - 
getControlTimedOnSensorNamejava.lang.String getControlTimedOnSensorName() Get the Timed On Trigger Sensor name.- Returns:
- If a Sensor is registered, returns the Sensor.getName() else the Sensor Name as set by #setControlTimedOnSensorName
 
 - 
setControlTimedOnSensorNamevoid setControlTimedOnSensorName(java.lang.String sensorName) Set Sensor used by the Timed On Control Does NOT update any changelisteners- Parameters:
- sensorName- the Sensor name to be used for the On Trigger
 
 - 
getTimedOnDurationint getTimedOnDuration() Get the Timed On Control Duration- Returns:
- duration in ms
 
 - 
setTimedOnDurationvoid setTimedOnDuration(int duration) Set Duration used by the Timed On Control Does NOT update any changeListeners- Parameters:
- duration- in ms following the Sensor On Trigger
 
 - 
getControlSensor2Namejava.lang.String getControlSensor2Name() Get the Second Sensor name. as used in the 2 Sensor Control Group.- Returns:
- If a 2nd Sensor is registered, returns the Sensor.getName() else the 2nd Sensor Name as set by #setControlSensor2Name
 
 - 
setControlSensor2Namevoid setControlSensor2Name(java.lang.String sensorName) Set Sensor 2 used by the 2 Sensor Control Does NOT update any changelisteners- Parameters:
- sensorName- the Sensor 2 name
 
 - 
setParentLightvoid setParentLight(Light l) Set Light to control Does NOT update any changelisteners- Parameters:
- l- the Light object to control
 
 - 
getDescriptionTextjava.lang.String getDescriptionText(java.lang.String lightName) Get a Textual Description eg. Light Control TestLight ON when TestSensor is Active eg. Light Control ON at 14:00, OFF at 15:00.- Parameters:
- lightName- the Light Name, can be empty.
- Returns:
- An I18N full-text description of thiscontrol
 
 - 
activateLightControlvoid activateLightControl() Activates a Light Control by control type. This method tests the control type, and set up a control mechanism, appropriate for the control type. Adds PropertyChangeListeners to Sensors / Turnout / Fast Clock as necessary
 - 
onOffTimesFaultyboolean onOffTimesFaulty() Check to see if we have the FastClock Follower has unique times for a single Light Control.Hour / Minute combination must be unique for each Light to avoid flicker. - Returns:
- true if the clock on time equals the off time, otherwise false.
 
 - 
areFollowerTimesFaultyboolean areFollowerTimesFaulty(java.util.List<LightControl> compareList) Check to see if we have the FastClock Follower has unique times for a single Light.Hour / Minute combination must be unique for each Light to avoid flicker. - Parameters:
- compareList- the ArrayList of other Light Controls to compare against
- Returns:
- true if there are multiple exact same times
 
 - 
deactivateLightControlvoid deactivateLightControl() Deactivates a LightControl by control type. This method tests the control type, and deactivates the control mechanism, appropriate for the control type.
 
- 
 
-