Package jmri.jmrit.logix
Class Tracker
- java.lang.Object
-
- jmri.jmrit.logix.Tracker
-
public class Tracker extends java.lang.Object
Track an occupied block to adjacent blocks becoming occupied.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
Tracker.ChooseStartBlock
(package private) static class
Tracker.PathSet
-
Field Summary
Fields Modifier and Type Field Description (package private) long
_startTime
(package private) java.lang.String
_statusMessage
-
Constructor Summary
Constructors Constructor Description Tracker(OBlock block, java.lang.String name, LocoIcon marker, TrackerTableAction tta)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<OBlock>
getBlocksOccupied()
protected OBlock
getHeadBlock()
protected java.lang.String
getStatus()
protected OBlock
getTailBlock()
protected java.lang.String
getTrainName()
protected Tracker.PathSet
hasPathInto(OBlock block)
protected java.util.List<OBlock>
makeRange()
Build array of blocks reachable from head and tail portalsprotected boolean
move(OBlock block, int state)
protected void
stop()
java.lang.String
toString()
-
-
-
Field Detail
-
_startTime
final long _startTime
-
_statusMessage
java.lang.String _statusMessage
-
-
Constructor Detail
-
Tracker
Tracker(OBlock block, java.lang.String name, LocoIcon marker, TrackerTableAction tta)
- Parameters:
block
- the starting block to trackname
- the name of the train being trackedmarker
- icon if LocoIcon was dropped on a blocktta
- TrackerTableAction that manages Trackers
-
-
Method Detail
-
getTrainName
protected java.lang.String getTrainName()
-
getHeadBlock
protected final OBlock getHeadBlock()
-
getTailBlock
protected final OBlock getTailBlock()
-
getStatus
protected java.lang.String getStatus()
-
hasPathInto
protected Tracker.PathSet hasPathInto(OBlock block) throws JmriException
- Throws:
JmriException
-
makeRange
protected java.util.List<OBlock> makeRange()
Build array of blocks reachable from head and tail portals- Returns:
- range of reachable blocks
-
getBlocksOccupied
protected java.util.List<OBlock> getBlocksOccupied()
-
stop
protected void stop()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-