Class Warrant
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.jmrit.logix.Warrant
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.lang.Comparable<NamedBean>
,java.util.EventListener
,PropertyChangeProvider
,NamedBean
,ThrottleListener
- Direct Known Subclasses:
SCWarrant
public class Warrant extends AbstractNamedBean implements ThrottleListener, java.beans.PropertyChangeListener
A Warrant contains the operating permissions and directives needed for a train to proceed from an Origin to a Destination. There are three modes that a Warrant may execute;MODE_LEARN - Warrant is created or edited in WarrantFrame and then launched from WarrantFrame who records throttle commands from "_student" throttle. Warrant fires PropertyChanges for WarrantFrame to record when blocks are entered. "_engineer" thread is null.
MODE_RUN - Warrant may be launched from several places. An array of BlockOrders, _savedOrders, and corresponding _throttleCommands allow an "_engineer" thread to execute the throttle commands. The blockOrders establish the route for the Warrant to acquire and reserve OBlocks. The Warrant monitors block activity (entrances and exits, signals, rogue occupancy etc) and modifies speed as needed.
MODE_MANUAL - Warrant may be launched from several places. The Warrant to acquires and reserves the route from the array of BlockOrders. Throttle commands are done by a human operator. "_engineer" and "_throttleCommands" are not used. Warrant monitors block activity but does not set _stoppingBlock or _protectSignal since it cannot control speed. It does attempt to realign the route as needed, but can be thwarted.
Version 1.11 - remove setting of SignalHeads
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Warrant.SpeedState
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_message
protected int
_runMode
protected OBlock
_stoppingBlock
protected static boolean
_trace
protected java.lang.String
_trainName
static int
ABORT
(package private) static int
AT_SPEED
(package private) static float
BUFFER_DISTANCE
(package private) static java.lang.String[]
CNTRL_CMDS
static int
DEBUG
static java.lang.String
EStop
static int
ESTOP
static int
HALT
protected static int
LEARNING
static int
MODE_ABORT
static int
MODE_LEARN
static int
MODE_MANUAL
static int
MODE_NONE
static int
MODE_RUN
(package private) static java.lang.String[]
MODES
static java.lang.String
Normal
(package private) static int
RAMP_DOWN
protected static int
RAMP_HALT
(package private) static int
RAMP_UP
static int
RESUME
static int
RETRY_BKWD
static int
RETRY_FWD
(package private) static java.lang.String[]
RUN_STATE
protected static int
RUNNING
protected static int
SPEED_RESTRICTED
static int
SPEED_UP
static java.lang.String
Stop
static int
STOP
protected static int
STOP_PENDING
protected static int
WAIT_FOR_CLEAR
protected static int
WAIT_FOR_DELAYED_START
protected static int
WAIT_FOR_SENSOR
protected static int
WAIT_FOR_TRAIN
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description Warrant(java.lang.String sName, java.lang.String uName)
Create an object with no route defined.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
abortWarrant(java.lang.String msg)
protected java.lang.String
acquireThrottle()
void
addBlockOrder(BlockOrder order)
Add permanently saved BlockOrder.void
addThrottleCommand(ThrottleSetting ts)
java.lang.String
allocateRoute(boolean show, java.util.List<BlockOrder> orders)
Allocate as many blocks as possible from the start of the warrant.protected java.lang.String
checkforTrackers()
java.lang.String
checkRoute()
Report any occupied blocks in the routejava.lang.String
checkStartBlock()
Check start block for occupied for start of runboolean
controlRunTrain(int idx)
Pause and resume auto-running train or abort any allocation state User issued overriding commands during run time of warrant _engineer.abort() calls setRunMode(MODE_NONE,...) which calls deallocate all.void
deAllocate()
Deallocates blocks from the current BlockOrder listprotected boolean
debugInfo()
void
dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others.protected void
downRampBegun(int endBlockIdx)
protected void
downRampDone(boolean stop, boolean halted, java.lang.String speedType, int endBlockIdx)
boolean
equals(java.lang.Object obj)
protected void
fireRunStatus(java.lang.String property, java.lang.Object old, java.lang.Object status)
boolean
getAddTracker()
BlockOrder
getAvoidOrder()
java.lang.String
getBeanType()
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.protected OBlock
getBlockAt(int idx)
Call is only valid when in MODE_LEARN and MODE_RUN.protected Warrant
getBlockingWarrant()
protected BlockOrder
getBlockOrderAt(int index)
Call is only valid when in MODE_LEARN and MODE_RUN.java.util.List<BlockOrder>
getBlockOrders()
Return BlockOrders.java.lang.String
getCurrentBlockName()
Call is only valid when in MODE_LEARN and MODE_RUN.BlockOrder
getCurrentBlockOrder()
int
getCurrentOrderIndex()
BlockOrder
getfirstOrder()
Return permanently saved Origin.boolean
getHaltStart()
protected int
getIndexOfBlockAfter(OBlock block, int idx)
Find index of a block AFTER BlockOrder index.protected int
getIndexOfBlockBefore(int idx, OBlock block)
Find index of block BEFORE BlockOrder index.BlockOrder
getLastOrder()
Return permanently saved Destination.java.lang.String
getMessage()
boolean
getNoRamp()
protected int
getNumOrders()
boolean
getRunBlind()
int
getRunMode()
protected java.lang.String
getRunModeMessage()
protected java.lang.String
getRunningMessage()
boolean
getShareRoute()
SpeedUtil
getSpeedUtil()
int
getState()
Provide generic access to internal state.java.util.List<ThrottleSetting>
getThrottleCommands()
java.lang.String
getTrainName()
java.util.List<NamedBeanUsageReport>
getUsageReport(NamedBean bean)
Get a list of references for the specified bean.BlockOrder
getViaOrder()
Return permanently saved BlockOrder that must be included in the route.protected void
goingActive(OBlock block)
Check if this is the next block of the train moving under the warrant Learn mode assumes route is set and clear.protected void
goingInactive(OBlock block)
int
hashCode()
boolean
hasRouteSet()
Turnouts are set for the routeprotected void
incrementCurrentOrderIndex()
boolean
isAllocated()
protected boolean
isNXWarrant()
boolean
isTotalAllocated()
protected boolean
isWaitingForBlock()
protected boolean
isWaitingForSignal()
protected boolean
isWaitingForWarrant()
void
notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
No steal or share decisions made locallyvoid
notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Get notification that an attempt to request a throttle has failed.void
notifyThrottleFound(DccThrottle throttle)
Get notification that a throttle has been found as requested.void
propertyChange(java.beans.PropertyChangeEvent evt)
protected void
releaseThrottle(DccThrottle throttle)
boolean
routeIsFree()
Test if the permanent saved blocks of this warrant are free (unoccupied and unallocated)boolean
routeIsOccupied()
Test if the permanent saved blocks of this warrant are occupiedvoid
runWarrant(int mode)
Convenience routine to use from Python to start a warrant.void
setAddTracker(boolean set)
void
setAvoidOrder(BlockOrder order)
void
setBlockOrders(java.util.List<BlockOrder> orders)
void
setHaltStart(boolean set)
void
setNoRamp(boolean set)
protected void
setNXWarrant(boolean set)
java.lang.String
setRoute(boolean show, java.util.List<BlockOrder> orders)
Set the route paths and turnouts for the warrant.void
setRunBlind(boolean runBlind)
java.lang.String
setRunMode(int mode, DccLocoAddress address, LearnThrottleFrame student, java.util.List<ThrottleSetting> commands, boolean runBlind)
Sets up recording and playing back throttle commands - also cleans up afterwards.void
setShareRoute(boolean set)
void
setSpeedUtil(SpeedUtil su)
void
setState(int state)
Provide generic access to internal state.void
setThrottleCommands(java.util.List<ThrottleSetting> list)
void
setTrackSpeeds()
void
setTrainName(java.lang.String name)
void
setViaOrder(BlockOrder order)
protected void
startupWarrant()
void
stopWarrant(boolean abort, boolean turnOffFunctions)
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChange
-
-
-
-
Field Detail
-
Stop
public static final java.lang.String Stop
-
EStop
public static final java.lang.String EStop
-
Normal
public static final java.lang.String Normal
- See Also:
- Constant Field Values
-
_trainName
protected java.lang.String _trainName
-
_runMode
protected int _runMode
-
_stoppingBlock
protected OBlock _stoppingBlock
-
_message
protected java.lang.String _message
-
MODE_NONE
public static final int MODE_NONE
- See Also:
- Constant Field Values
-
MODE_LEARN
public static final int MODE_LEARN
- See Also:
- Constant Field Values
-
MODE_RUN
public static final int MODE_RUN
- See Also:
- Constant Field Values
-
MODE_MANUAL
public static final int MODE_MANUAL
- See Also:
- Constant Field Values
-
MODES
static final java.lang.String[] MODES
-
MODE_ABORT
public static final int MODE_ABORT
- See Also:
- Constant Field Values
-
STOP
public static final int STOP
- See Also:
- Constant Field Values
-
HALT
public static final int HALT
- See Also:
- Constant Field Values
-
RESUME
public static final int RESUME
- See Also:
- Constant Field Values
-
ABORT
public static final int ABORT
- See Also:
- Constant Field Values
-
RETRY_FWD
public static final int RETRY_FWD
- See Also:
- Constant Field Values
-
ESTOP
public static final int ESTOP
- See Also:
- Constant Field Values
-
RAMP_HALT
protected static final int RAMP_HALT
- See Also:
- Constant Field Values
-
SPEED_UP
public static final int SPEED_UP
- See Also:
- Constant Field Values
-
RETRY_BKWD
public static final int RETRY_BKWD
- See Also:
- Constant Field Values
-
DEBUG
public static final int DEBUG
- See Also:
- Constant Field Values
-
CNTRL_CMDS
static final java.lang.String[] CNTRL_CMDS
-
RUNNING
protected static final int RUNNING
- See Also:
- Constant Field Values
-
SPEED_RESTRICTED
protected static final int SPEED_RESTRICTED
- See Also:
- Constant Field Values
-
WAIT_FOR_CLEAR
protected static final int WAIT_FOR_CLEAR
- See Also:
- Constant Field Values
-
WAIT_FOR_SENSOR
protected static final int WAIT_FOR_SENSOR
- See Also:
- Constant Field Values
-
WAIT_FOR_TRAIN
protected static final int WAIT_FOR_TRAIN
- See Also:
- Constant Field Values
-
WAIT_FOR_DELAYED_START
protected static final int WAIT_FOR_DELAYED_START
- See Also:
- Constant Field Values
-
LEARNING
protected static final int LEARNING
- See Also:
- Constant Field Values
-
STOP_PENDING
protected static final int STOP_PENDING
- See Also:
- Constant Field Values
-
RUN_STATE
static final java.lang.String[] RUN_STATE
-
BUFFER_DISTANCE
static final float BUFFER_DISTANCE
-
_trace
protected static boolean _trace
-
AT_SPEED
static final int AT_SPEED
- See Also:
- Constant Field Values
-
RAMP_DOWN
static final int RAMP_DOWN
- See Also:
- Constant Field Values
-
RAMP_UP
static final int RAMP_UP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Warrant
public Warrant(java.lang.String sName, java.lang.String uName)
Create an object with no route defined. The list of BlockOrders is the route from an Origin to a Destination- Parameters:
sName
- system nameuName
- user name
-
-
Method Detail
-
setNXWarrant
protected void setNXWarrant(boolean set)
-
isNXWarrant
protected boolean isNXWarrant()
-
getState
public int getState()
Description copied from interface:NamedBean
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read.
-
setState
public void setState(int state)
Description copied from interface:NamedBean
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.
-
getSpeedUtil
public SpeedUtil getSpeedUtil()
-
setSpeedUtil
public void setSpeedUtil(SpeedUtil su)
-
getBlockOrders
public java.util.List<BlockOrder> getBlockOrders()
Return BlockOrders.- Returns:
- list of block orders
-
addBlockOrder
public void addBlockOrder(BlockOrder order)
Add permanently saved BlockOrder.- Parameters:
order
- block order
-
setBlockOrders
public void setBlockOrders(java.util.List<BlockOrder> orders)
-
getfirstOrder
public BlockOrder getfirstOrder()
Return permanently saved Origin.- Returns:
- origin block order
-
getLastOrder
public BlockOrder getLastOrder()
Return permanently saved Destination.- Returns:
- destination block order
-
getViaOrder
public BlockOrder getViaOrder()
Return permanently saved BlockOrder that must be included in the route.- Returns:
- via block order
-
setViaOrder
public void setViaOrder(BlockOrder order)
-
getAvoidOrder
public BlockOrder getAvoidOrder()
-
setAvoidOrder
public void setAvoidOrder(BlockOrder order)
-
getCurrentBlockOrder
public final BlockOrder getCurrentBlockOrder()
- Returns:
- block order currently at the train position
-
getCurrentOrderIndex
public final int getCurrentOrderIndex()
- Returns:
- index of block order currently at the train position
-
getNumOrders
protected int getNumOrders()
-
incrementCurrentOrderIndex
protected void incrementCurrentOrderIndex()
-
getIndexOfBlockAfter
protected int getIndexOfBlockAfter(OBlock block, int idx)
Find index of a block AFTER BlockOrder index.- Parameters:
block
- used by the warrantidx
- start index of search- Returns:
- index of block after of block order index, -1 if not found
-
getIndexOfBlockBefore
protected int getIndexOfBlockBefore(int idx, OBlock block)
Find index of block BEFORE BlockOrder index.- Parameters:
idx
- start index of searchblock
- used by the warrant- Returns:
- index of block before of block order index, -1 if not found
-
getBlockOrderAt
protected BlockOrder getBlockOrderAt(int index)
Call is only valid when in MODE_LEARN and MODE_RUN.- Parameters:
index
- index of block order- Returns:
- block order or null if not found
-
getBlockAt
protected OBlock getBlockAt(int idx)
Call is only valid when in MODE_LEARN and MODE_RUN.- Parameters:
idx
- index of block order- Returns:
- block of the block order
-
getCurrentBlockName
public java.lang.String getCurrentBlockName()
Call is only valid when in MODE_LEARN and MODE_RUN.- Returns:
- Name of OBlock currently occupied
-
getThrottleCommands
public java.util.List<ThrottleSetting> getThrottleCommands()
- Returns:
- throttle commands
-
setThrottleCommands
public void setThrottleCommands(java.util.List<ThrottleSetting> list)
-
addThrottleCommand
public void addThrottleCommand(ThrottleSetting ts)
-
setTrackSpeeds
public void setTrackSpeeds()
-
setNoRamp
public void setNoRamp(boolean set)
-
setShareRoute
public void setShareRoute(boolean set)
-
setAddTracker
public void setAddTracker(boolean set)
-
setHaltStart
public void setHaltStart(boolean set)
-
getNoRamp
public boolean getNoRamp()
-
getShareRoute
public boolean getShareRoute()
-
getAddTracker
public boolean getAddTracker()
-
getHaltStart
public boolean getHaltStart()
-
getTrainName
public java.lang.String getTrainName()
-
setTrainName
public void setTrainName(java.lang.String name)
-
getRunBlind
public boolean getRunBlind()
-
setRunBlind
public void setRunBlind(boolean runBlind)
-
fireRunStatus
protected void fireRunStatus(java.lang.String property, java.lang.Object old, java.lang.Object status)
-
isAllocated
public boolean isAllocated()
- Returns:
- true if listeners are installed enough to run
-
isTotalAllocated
public boolean isTotalAllocated()
- Returns:
- true if listeners are installed for entire route
-
hasRouteSet
public boolean hasRouteSet()
Turnouts are set for the route- Returns:
- true if turnouts are set
-
routeIsFree
public boolean routeIsFree()
Test if the permanent saved blocks of this warrant are free (unoccupied and unallocated)- Returns:
- true if route is free
-
routeIsOccupied
public boolean routeIsOccupied()
Test if the permanent saved blocks of this warrant are occupied- Returns:
- true if any block is occupied
-
getMessage
public java.lang.String getMessage()
-
isWaitingForSignal
protected boolean isWaitingForSignal()
-
isWaitingForBlock
protected boolean isWaitingForBlock()
-
isWaitingForWarrant
protected boolean isWaitingForWarrant()
-
getBlockingWarrant
protected Warrant getBlockingWarrant()
-
getRunMode
public int getRunMode()
- Returns:
- ID of run mode
-
getRunModeMessage
protected java.lang.String getRunModeMessage()
-
getRunningMessage
protected java.lang.String getRunningMessage()
-
stopWarrant
public void stopWarrant(boolean abort, boolean turnOffFunctions)
-
setRunMode
public java.lang.String setRunMode(int mode, DccLocoAddress address, LearnThrottleFrame student, java.util.List<ThrottleSetting> commands, boolean runBlind)
Sets up recording and playing back throttle commands - also cleans up afterwards. MODE_LEARN and MODE_RUN sessions must end by calling again with MODE_NONE. It is important that the route be deAllocated (remove listeners).Rule for (auto) MODE_RUN: 1. At least the Origin block must be owned (allocated) by this warrant. (block._warrant == this) and path set for Run Mode Rule for (auto) LEARN_RUN: 2. Entire Route must be allocated and Route Set for Learn Mode. i.e. this warrant has listeners on all block sensors in the route. Rule for MODE_MANUAL The Origin block must be allocated to this warrant and path set for the route
- Parameters:
mode
- run modeaddress
- DCC loco addressstudent
- throttle frame for learn mode parameterscommands
- list of throttle commandsrunBlind
- true if occupancy should be ignored- Returns:
- error message, if any
-
acquireThrottle
@CheckForNull protected java.lang.String acquireThrottle()
- Returns:
- error message if any
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle throttle)
Description copied from interface:ThrottleListener
Get notification that a throttle has been found as requested.- Specified by:
notifyThrottleFound
in interfaceThrottleListener
- Parameters:
throttle
- the throttle with the requested address
-
notifyFailedThrottleRequest
public void notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Description copied from interface:ThrottleListener
Get notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequest
in interfaceThrottleListener
- Parameters:
address
- address of the failed requestreason
- failure cause
-
notifyDecisionRequired
public void notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
No steal or share decisions made locallyGet notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.
- Specified by:
notifyDecisionRequired
in interfaceThrottleListener
- Parameters:
address
- The LocoAddress that needs the decision.question
- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
releaseThrottle
protected void releaseThrottle(DccThrottle throttle)
-
abortWarrant
protected void abortWarrant(java.lang.String msg)
-
controlRunTrain
public boolean controlRunTrain(int idx)
Pause and resume auto-running train or abort any allocation state User issued overriding commands during run time of warrant _engineer.abort() calls setRunMode(MODE_NONE,...) which calls deallocate all.- Parameters:
idx
- index of control command- Returns:
- false if command cannot be given
-
debugInfo
protected boolean debugInfo()
-
startupWarrant
protected void startupWarrant()
-
allocateRoute
public java.lang.String allocateRoute(boolean show, java.util.List<BlockOrder> orders)
Allocate as many blocks as possible from the start of the warrant. The first block must be allocated and all blocks of the route must be in service. Otherwise partial success is OK. Installs listeners for the entire route. If occupation by another train is detected, a message will be posted to the Warrant List Window. Note that warrants sharing their clearance only allocate and set paths one block in advance.- Parameters:
orders
- list of block ordersshow
- _message for use ONLY to display a temporary route) continues to allocate skipping over blocks occupied or owned by another warrant.- Returns:
- error message, if unable to allocate first block or if any block is OUT_OF_SERVICE
-
deAllocate
public void deAllocate()
Deallocates blocks from the current BlockOrder list
-
runWarrant
public void runWarrant(int mode)
Convenience routine to use from Python to start a warrant.- Parameters:
mode
- run mode
-
setRoute
public java.lang.String setRoute(boolean show, java.util.List<BlockOrder> orders)
Set the route paths and turnouts for the warrant. Only the first block must be allocated and have its path set. Partial success is OK. A message of the first subsequent block that fails allocation or path setting is written to a field that is displayed in the Warrant List window. When running with block detection, occupation by another train or block 'not in use' or Signals denying movement are reasons for such a message, otherwise only allocation to another warrant prevents total success. Note that warrants sharing their clearance only allocate and set paths one block in advance.- Parameters:
show
- If true allocateRoute returns messages for display.orders
- BlockOrder list of route. If null, use permanent warrant copy.- Returns:
- message if the first block fails allocation, otherwise null
-
checkStartBlock
public java.lang.String checkStartBlock()
Check start block for occupied for start of run- Returns:
- error message, if any
-
checkforTrackers
protected java.lang.String checkforTrackers()
-
checkRoute
public java.lang.String checkRoute()
Report any occupied blocks in the route- Returns:
- String
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
goingActive
@InvokeOnLayoutThread protected void goingActive(OBlock block)
Check if this is the next block of the train moving under the warrant Learn mode assumes route is set and clear. Run mode update conditions.Must be called on Layout thread.
- Parameters:
block
- Block in the route is going active.
-
goingInactive
@InvokeOnLayoutThread protected void goingInactive(OBlock block)
- Parameters:
block
- Block in the route is going Inactive
-
dispose
public void dispose()
Description copied from class:AbstractNamedBean
Deactivate this object, so that it releases as many resources as possible and no longer effects others.For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.
- Specified by:
dispose
in interfaceNamedBean
- Overrides:
dispose
in classAbstractNamedBean
-
getBeanType
public java.lang.String getBeanType()
Description copied from interface:NamedBean
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanType
in interfaceNamedBean
- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
downRampBegun
protected void downRampBegun(int endBlockIdx)
-
downRampDone
protected void downRampDone(boolean stop, boolean halted, java.lang.String speedType, int endBlockIdx)
-
equals
public boolean equals(java.lang.Object obj)
This implementation tests that
NamedBean.getSystemName()
is equal for this and obj.This implementation tests that
NamedBean.getSystemName()
is equal for this and obj. To allow a warrant to run with sections, DccLocoAddress is included to test equality- Overrides:
equals
in classAbstractNamedBean
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractNamedBean
- Returns:
- hash code value is based on the system name and DccLocoAddress.
-
getUsageReport
public java.util.List<NamedBeanUsageReport> getUsageReport(NamedBean bean)
Description copied from interface:NamedBean
Get a list of references for the specified bean.- Specified by:
getUsageReport
in interfaceNamedBean
- Parameters:
bean
- The bean to be checked.- Returns:
- a list of NamedBeanUsageReports or an empty ArrayList.
-
-