Package jmri
Class TransitSectionAction
java.lang.Object
jmri.TransitSectionAction
This class holds information and options for a Action to be applied when an
automated train enters, exits, or is inside of a Section in a Transit.
A TransitSection holds specified TrainsitSectionActions. A TransitSection may have as many TransitSectionActions as appropriate. Each TransitSectionAction belongs to one and only one TransitSection.
TransitSectionActions are specified in two parts: 1. The "When" part specifies when after the automated train enters the Section the action is to be initiated. Optionally, each "when" may be delayed by a specified time (in milliseconds). 2. The "What" part specified what action is to occur.
TransitSectionActions are created and edited in the Transit Table, when Transits are defined.
This class provides support for SENSORACTIVE and SENSORINACTIVE "when"'s.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intConstants representing the "when" (when the action is to be initiated) of the Action.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intConstants designating the "what" (the action to be taken) of the Action.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionTransitSectionAction(int when, int what) Create a TransitSectionAction.TransitSectionAction(int when, int what, int dataWhen, int dataWhat1, int dataWhat2, String sWhen, String sWhat) Create a TransitSectionAction.TransitSectionAction(int when, int what, int dataWhen, int dataWhat1, int dataWhat2, String sWhen, String sWhat, String sWhat2) Create a TransitSectionAction. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()voidintfloatintfloatintbooleanbooleanbooleanintintvoidInitialize all operational instance variables (not saved between runs).voidsetDataWhat1(int n) voidsetDataWhat1Float(float n) voidsetDataWhat2(int n) voidsetDataWhat2Float(float n) voidsetDataWhen(int n) voidvoidvoidvoidvoidvoidsetThreadObject(Object threadObj) voidvoidsetWaitingForBlock(boolean w) voidsetWaitingForSectionExit(boolean w) voidsetWaitingForSensor(boolean w) voidvoidsetWhatCode(int n) voidsetWhenCode(int n)
-
Field Details
-
NUM_WHENS
Constants representing the "when" (when the action is to be initiated) of the Action. TODO: Convert to ENUM- See Also:
-
SELECTWHEN
- See Also:
-
ENTRY
- See Also:
-
EXIT
- See Also:
-
BLOCKENTRY
- See Also:
-
BLOCKEXIT
- See Also:
-
TRAINSTOP
- See Also:
-
TRAINSTART
- See Also:
-
SENSORACTIVE
- See Also:
-
SENSORINACTIVE
- See Also:
-
PRESTARTDELAY
- See Also:
-
PRESTARTACTION
- See Also:
-
SELECTWHAT
Constants designating the "what" (the action to be taken) of the Action. TODO: Convert to ENUM- See Also:
-
PAUSE
- See Also:
-
SETMAXSPEED
- See Also:
-
SETCURRENTSPEED
- See Also:
-
RAMPTRAINSPEED
- See Also:
-
TOMANUALMODE
- See Also:
-
SETLIGHT
- See Also:
-
STARTBELL
- See Also:
-
STOPBELL
- See Also:
-
SOUNDHORN
- See Also:
-
SOUNDHORNPATTERN
- See Also:
-
LOCOFUNCTION
- See Also:
-
SETSENSORACTIVE
- See Also:
-
SETSENSORINACTIVE
- See Also:
-
HOLDSIGNAL
- See Also:
-
RELEASESIGNAL
- See Also:
-
ESTOP
- See Also:
-
PRESTARTRESUME
- See Also:
-
TERMINATETRAIN
- See Also:
-
LOADTRAININFO
- See Also:
-
FORCEALLOCATEPASSSAFESECTION
- See Also:
-
NUM_WHATS
- See Also:
-
LOCOADDRESSTYPEDEFAULT
- See Also:
-
LOCOADDRESSTYPEROSTER
- See Also:
-
LOCOADDRESSTYPENUMBER
- See Also:
-
LOCOADDRESSTYPECURRENT
- See Also:
-
-
Constructor Details
-
TransitSectionAction
Create a TransitSectionAction.- Parameters:
when- one ofENTRY,EXIT,BLOCKENTRY,BLOCKEXIT,TRAINSTOP,TRAINSTART,SENSORACTIVE,SENSORINACTIVE,PRESTARTRESUMEwhat- one ofPAUSE,SETMAXSPEED,SETCURRENTSPEED,RAMPTRAINSPEED,TOMANUALMODE,SETLIGHT,STARTBELL,STOPBELL,SOUNDHORN,SOUNDHORNPATTERN,LOCOFUNCTION,SETSENSORACTIVE,SETSENSORINACTIVE,HOLDSIGNAL,RELEASESIGNAL
-
TransitSectionAction
public TransitSectionAction(int when, int what, int dataWhen, int dataWhat1, int dataWhat2, String sWhen, String sWhat) Create a TransitSectionAction.- Parameters:
when- one ofENTRY,EXIT,BLOCKENTRY,BLOCKEXIT,TRAINSTOP,TRAINSTART,SENSORACTIVE,SENSORINACTIVEwhat- one ofPAUSE,SETMAXSPEED,SETCURRENTSPEED,RAMPTRAINSPEED,TOMANUALMODE,SETLIGHT,STARTBELL,STOPBELL,SOUNDHORN,SOUNDHORNPATTERN,LOCOFUNCTION,SETSENSORACTIVE,SETSENSORINACTIVE,HOLDSIGNAL,RELEASESIGNALdataWhen- a data element for whendataWhat1- a data element for whatdataWhat2- a data element for whatsWhen- typically a readable description of when or the name of the triggering sensorssWhat- typically a readable description of what
-
TransitSectionAction
public TransitSectionAction(int when, int what, int dataWhen, int dataWhat1, int dataWhat2, String sWhen, String sWhat, String sWhat2) Create a TransitSectionAction.- Parameters:
when- one ofENTRY,EXIT,BLOCKENTRY,BLOCKEXIT,TRAINSTOP,TRAINSTART,SENSORACTIVE,SENSORINACTIVEwhat- one ofPAUSE,SETMAXSPEED,SETCURRENTSPEED,RAMPTRAINSPEED,TOMANUALMODE,SETLIGHT,STARTBELL,STOPBELL,SOUNDHORN,SOUNDHORNPATTERN,LOCOFUNCTION,SETSENSORACTIVE,SETSENSORINACTIVE,HOLDSIGNAL,RELEASESIGNALdataWhen- a data element for whendataWhat1- a data element for whatdataWhat2- a data element for whatsWhen- typically a readable description of when or the name of the triggering sensorssWhat- typically a readable description of what or data such as TrainInfo File NamesWhat2- typically a second string parameter for the action such as DCCAddress or roster entry.
-
-
Method Details
-
setThreadObject
-
getThreadObject
-
getWhenCode
-
setWhenCode
-
getWhatCode
-
setWhatCode
-
getDataWhen
-
setDataWhen
-
getDataWhat1Float
-
setDataWhat1Float
-
getDataWhat2Float
-
setDataWhat2Float
-
getDataWhat1
-
setDataWhat1
-
getDataWhat2
-
setDataWhat2
-
getStringWhen
-
setStringWhen
-
getStringWhat
-
setStringWhat
-
getStringWhat2
-
setStringWhat2
-
initialize
Initialize all operational instance variables (not saved between runs). -
getWaitingThread
-
setWaitingThread
-
getWaitingForSectionExit
-
setWaitingForSectionExit
-
getTargetTransitSection
-
setTargetTransitSection
-
getWaitingForBlock
-
setWaitingForBlock
-
getWaitingForSensor
-
setWaitingForSensor
-
getTriggerSensor
-
setTriggerSensor
-
getSensorListener
-
setSensorListener
-
disposeSensorListener
-
dispose
-