|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Route
Routes represent a collection of Turnouts that may be set at the same time.
When a user adds a Turnout to a Route, the user specifies whether the Turnout state is to be set to CLOSED or THROWN when the Route is invoked (set).
Initially, Routes will have a fixed maximum number of sensors for simplicity of implementation. We can revise this later to use Java Collections if this becomes a problem.
To allow control via fascia panel pushbuttons, Routes may optionally be invoked by one or more Sensors (up to the maximum allowed).
A route can be enabled or not. By default it is enabled, and will act when it's specified input conditions become satisfied. When not enabled (the enabled parameter is false), the route will not act even if the specified input conditions are satisfied. When the route transitions from disabled to enabled, it may act, depending on the conditions: Edge triggered conditions will not be satisfied, but level-conditions may be.
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.
| Field Summary | |
|---|---|
static int |
MAX_CONTROL_SENSORS
|
static int |
ONACTIVE
|
static int |
ONCHANGE
|
static int |
ONCLOSED
|
static int |
ONINACTIVE
|
static int |
ONTHROWN
|
static int |
TOGGLE
|
static int |
VETOACTIVE
|
static int |
VETOCLOSED
|
static int |
VETOINACTIVE
|
static int |
VETOTHROWN
|
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| Method Summary | |
|---|---|
void |
activateRoute()
Activate the Route. |
boolean |
addOutputSensor(String systemName,
int state)
Add an output Sensor to this Route. |
boolean |
addOutputTurnout(String systemName,
int state)
Add an output Turnout to this Route. |
boolean |
addSensorToRoute(String sensorSystemName,
int mode)
Method to add a Sensor to the list of control Sensors for this Route. |
boolean |
canLock()
Has at least one lockable turnout. |
void |
clearOutputSensors()
Delete all output Sensors from this Route. |
void |
clearOutputTurnouts()
Delete all output Turnouts from this Route. |
void |
clearRouteSensors()
Method to delete all control Sensors from this Route. |
void |
deActivateRoute()
Deactivate the Route. |
String |
getControlTurnout()
Method to get the SystemName of a control Turnout for this Route. |
int |
getControlTurnoutState()
Method to get the State of control Turnout that fires this Route. |
boolean |
getEnabled()
Get enabled status |
String |
getLockControlTurnout()
Method to get the SystemName of a lock control Turnout for this Route. |
int |
getLockControlTurnoutState()
Method to get the State of the lock control Turnout that locks this Route. |
boolean |
getLocked()
Get locked status. |
int |
getNumOutputSensors()
|
int |
getNumOutputTurnouts()
|
String |
getOutputScriptName()
Get name of script file to be run when Route is fired. |
Sensor |
getOutputSensor(int k)
Get the 'k'th output Sensor of the Route. |
String |
getOutputSensorByIndex(int index)
Get an output Sensor system name by Index. |
int |
getOutputSensorSetState(String systemName)
Method to get the Set State of an output Sensor. |
int |
getOutputSensorState(int k)
Get the desired state of 'k'th Sensor of the Route. |
String |
getOutputSoundName()
Get name of sound file to be played when Route is fired. |
Turnout |
getOutputTurnout(int k)
Method to get the 'k'th output Turnout of the Route. |
String |
getOutputTurnoutByIndex(int index)
Get an output Turnout system name by Index. |
int |
getOutputTurnoutSetState(String systemName)
Method to get the Set State of an output Turnout. |
int |
getOutputTurnoutState(int k)
Method to get the desired state of 'k'th Turnout of the Route. |
int |
getRouteCommandDelay()
Method to get delay (milliseconds) between issuing Turnout commands. |
int |
getRouteSensorMode(int index)
Method to get the mode of a particular Sensor in this Route. |
String |
getRouteSensorName(int index)
Method to get the SystemName of a control Sensor in this Route. |
String |
getTurnoutsAlignedSensor()
Method to get system name of turnouts aligned sensor. |
boolean |
isOutputSensorIncluded(String systemName)
Inquire if a Sensor is included in this Route as an output. |
boolean |
isOutputTurnoutIncluded(String systemName)
Inquire if a Turnout is included in this Route as an output. |
void |
setControlTurnout(String turnoutSystemName)
Method to set the SystemName of a control Turnout for this Route. |
void |
setControlTurnoutState(int turnoutState)
Method to set the State of control Turnout that fires this Route. |
void |
setEnabled(boolean state)
Set enabled status. |
void |
setLockControlTurnout(String turnoutSystemName)
Method to set the SystemName of a lock control Turnout for this Route. |
void |
setLockControlTurnoutState(int turnoutState)
Method to set the State of the lock control Turnout that locks this Route. |
void |
setLocked(boolean state)
Set locked status. |
void |
setOutputScriptName(String filename)
Set name of script file to be run when Route is fired. |
void |
setOutputSoundName(String filename)
Set name of sound file to be played when Route is fired. |
void |
setRoute()
Method to set the Route. |
void |
setRouteCommandDelay(int delay)
Method to set delay (milliseconds) between issuing Turnout commands. |
void |
setTurnoutsAlignedSensor(String sensorSystemName)
Method to set turnouts aligned sensor |
| Field Detail |
|---|
static final int TOGGLE
static final int MAX_CONTROL_SENSORS
static final int ONACTIVE
static final int ONINACTIVE
static final int VETOACTIVE
static final int VETOINACTIVE
static final int ONCHANGE
static final int ONCLOSED
static final int ONTHROWN
static final int VETOCLOSED
static final int VETOTHROWN
| Method Detail |
|---|
void setEnabled(boolean state)
boolean getEnabled()
void setLocked(boolean state)
boolean getLocked()
boolean canLock()
boolean addOutputTurnout(String systemName,
int state)
systemName - The turnout system namestate - must be Turnout.CLOSED, Turnout.THROWN, or Route.TOGGLE,
which determines how the Turnout is to be switched when this Route is setvoid clearOutputTurnouts()
int getNumOutputTurnouts()
boolean isOutputTurnoutIncluded(String systemName)
int getOutputTurnoutSetState(String systemName)
String getOutputTurnoutByIndex(int index)
Turnout getOutputTurnout(int k)
int getOutputTurnoutState(int k)
boolean addOutputSensor(String systemName,
int state)
systemName - The sensor system namestate - must be Sensor.ACTIVE, Sensor.INACTIVE, or Route.TOGGLE,
which determines how the Sensor is to be switched when this Route is setvoid clearOutputSensors()
int getNumOutputSensors()
boolean isOutputSensorIncluded(String systemName)
int getOutputSensorSetState(String systemName)
String getOutputSensorByIndex(int index)
Sensor getOutputSensor(int k)
int getOutputSensorState(int k)
void setOutputScriptName(String filename)
String getOutputScriptName()
void setOutputSoundName(String filename)
String getOutputSoundName()
void setTurnoutsAlignedSensor(String sensorSystemName)
String getTurnoutsAlignedSensor()
boolean addSensorToRoute(String sensorSystemName,
int mode)
void clearRouteSensors()
String getRouteSensorName(int index)
index - The index in the Sensor array of the requested
Sensor.
int getRouteSensorMode(int index)
index - The index in the Sensor array of the requested
Sensor.
void setControlTurnout(String turnoutSystemName)
String getControlTurnout()
void setControlTurnoutState(int turnoutState)
int getControlTurnoutState()
void setLockControlTurnout(String turnoutSystemName)
String getLockControlTurnout()
void setLockControlTurnoutState(int turnoutState)
int getLockControlTurnoutState()
void setRouteCommandDelay(int delay)
int getRouteCommandDelay()
void setRoute()
Sets all Route Turnouts to the state shown in the Route definition.
void activateRoute()
This starts route processing by connecting to inputs, etc. A Route must be activated before it will fire.
void deActivateRoute()
This disconnects the Route from all other objects and stops it from processing. A Route must be deactivated before it's input and output definitions are changed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||