Package jmri.jmrit.etcs
Class TrackCondition
- java.lang.Object
-
- jmri.jmrit.etcs.TrackCondition
-
- Direct Known Subclasses:
StationTrackCondition
@API(status=EXPERIMENTAL) public class TrackCondition extends java.lang.Object
Class to represent DMI Track Points of Interest, i.e. Announcements and Orders.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
descript
-
Constructor Summary
Constructors Modifier Constructor Description protected
TrackCondition(int distance, boolean order, java.lang.String ordSmlPath, java.lang.String notOrdSmlPath, java.lang.String ordLrgPath, java.lang.String notOrdLrgPath, java.lang.String description, java.lang.String command)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TrackCondition
airConClose(int distance, boolean order)
Get a new Close Air Conditioning Track Condition.static TrackCondition
airConOpen(int distance, boolean order)
Get a new Open Air Conditioning Track Condition.boolean
equals(java.lang.Object o)
java.lang.String
getAckString()
If this is an order, get the acknowledgement String for when the driver clicks the button.int
getColumnNum()
Get the Column Number for a Condition in the PASP Planning area.java.lang.String
getDescription()
Get Description of Track Condition.int
getDistanceFromStart()
Get the Distance to the start of the Track Condition.boolean
getIsOrder()
Get if the Track Condition is an order, i.e. the Condition requires an acknowledgement from driver.javax.swing.ImageIcon
getLargeIcon(boolean isOrder)
Get a larger image to display in a button.java.awt.image.BufferedImage
getSmlImage()
Get a small icon to display in the Planning area?int
hashCode()
static TrackCondition
inhibitEddyCurrentBrake(int distance, boolean order)
Get an Inhibit Eddy Current Brake Track Condition.static TrackCondition
inhibitMagShoeBrake(int distance, boolean order)
Get an Inhibit Magnetic Shoe Brake Track Condition.static TrackCondition
inhibitRegenerativeBrake(int distance, boolean order)
Get an Inhibit Regenerative Brake Track Condition.static TrackCondition
levelCrossing(int distance)
Get a new Level Crossing Track Condition.static TrackCondition
neutralSection(int distance, boolean order)
Get a Start of Neutral Section Track Condition.static TrackCondition
neutralSectionEnd(int distance, boolean order)
Get an End of Neutral Section Track Condition.static TrackCondition
nonStoppingArea(int distance, boolean order)
Get a Non Stopping Area Track Condition.static TrackCondition
pantographIsLowered()
Get a new Radio Hole Track Condition.static TrackCondition
pantographLower(int distance, boolean order)
Get a new Lower Pantograph Track Condition.static TrackCondition
pantographRaise(int distance, boolean order)
Get a new Raise Pantograph Track Condition.static TrackCondition
radioHole(int distance)
Get a new Radio Hole Track Condition.void
setColumnNum(int newCol)
Set the Column Number for the PASP column.protected void
setDistanceFromStart(int distance)
static TrackCondition
soundHorn(int distance)
Get a new Radio Hole Track Condition.java.lang.String
toString()
static TrackCondition
tractionChange0(int distance, boolean order)
Get a No Traction Track Condition.static TrackCondition
tractionChange1500(int distance, boolean order)
Get a Traction Change to 1.5kV Track Condition.static TrackCondition
tractionChange15000(int distance, boolean order)
Get a Traction Change to 25kV Track Condition.static TrackCondition
tractionChange25000(int distance, boolean order)
Get a Traction Change to 25kV Track Condition.static TrackCondition
tractionChange3000(int distance, boolean order)
Get a Traction Change to 3kV DC Track Condition.static TrackCondition
tractionChange750(int distance, boolean order)
Get a Traction Change to 600V or 750V Track Condition.
-
-
-
Field Detail
-
descript
protected final java.lang.String descript
-
-
Constructor Detail
-
TrackCondition
protected TrackCondition(int distance, boolean order, java.lang.String ordSmlPath, java.lang.String notOrdSmlPath, java.lang.String ordLrgPath, java.lang.String notOrdLrgPath, java.lang.String description, java.lang.String command)
-
-
Method Detail
-
getIsOrder
public boolean getIsOrder()
Get if the Track Condition is an order, i.e. the Condition requires an acknowledgement from driver.- Returns:
- true if order, else false if informational.
-
getDistanceFromStart
public int getDistanceFromStart()
Get the Distance to the start of the Track Condition.- Returns:
- the distance.
-
setDistanceFromStart
protected void setDistanceFromStart(int distance)
-
getSmlImage
public java.awt.image.BufferedImage getSmlImage()
Get a small icon to display in the Planning area?- Returns:
- small icon.
-
getLargeIcon
@CheckForNull public javax.swing.ImageIcon getLargeIcon(boolean isOrder)
Get a larger image to display in a button.- Parameters:
isOrder
- true if requires acknowledgement, false if informational.- Returns:
- Large image.
-
getDescription
public java.lang.String getDescription()
Get Description of Track Condition.- Returns:
- if is driver action or informational, along with description.
-
getAckString
public java.lang.String getAckString()
If this is an order, get the acknowledgement String for when the driver clicks the button. These can be listened for via adding a changeListener to DmiPanel.- Returns:
- the Acknowledgement String for the Condition.
-
getColumnNum
public int getColumnNum()
Get the Column Number for a Condition in the PASP Planning area.- Returns:
- column number, 0 if unset.
-
setColumnNum
public void setColumnNum(int newCol)
Set the Column Number for the PASP column.- Parameters:
newCol
- column number.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
levelCrossing
public static TrackCondition levelCrossing(int distance)
Get a new Level Crossing Track Condition. No acknowledgement element.- Parameters:
distance
- distance until the Track Condition.- Returns:
- a Level Crossing Track Condition.
-
radioHole
public static TrackCondition radioHole(int distance)
Get a new Radio Hole Track Condition. No acknowledgement element.- Parameters:
distance
- distance until the Track Condition.- Returns:
- a Radio Hole Track Condition.
-
soundHorn
public static TrackCondition soundHorn(int distance)
Get a new Radio Hole Track Condition. Always contains acknowledgement element.- Parameters:
distance
- distance until the Track Condition.- Returns:
- a Radio Hole Track Condition.
-
pantographIsLowered
public static TrackCondition pantographIsLowered()
Get a new Radio Hole Track Condition. No acknowledgement element. No distance element as used for displaying symbol.- Returns:
- a Radio Hole Track Condition.
-
pantographLower
public static TrackCondition pantographLower(int distance, boolean order)
Get a new Lower Pantograph Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Lower Pantograph Track Condition.
-
pantographRaise
public static TrackCondition pantographRaise(int distance, boolean order)
Get a new Raise Pantograph Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Raise Pantograph Track Condition.
-
airConClose
public static TrackCondition airConClose(int distance, boolean order)
Get a new Close Air Conditioning Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Close Air Conditioning Track Condition.
-
airConOpen
public static TrackCondition airConOpen(int distance, boolean order)
Get a new Open Air Conditioning Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- an Open Air Conditioning Track Condition.
-
neutralSection
public static TrackCondition neutralSection(int distance, boolean order)
Get a Start of Neutral Section Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a start of Neutral Section Track Condition.
-
neutralSectionEnd
public static TrackCondition neutralSectionEnd(int distance, boolean order)
Get an End of Neutral Section Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- an end of Neutral Section Track Condition.
-
nonStoppingArea
public static TrackCondition nonStoppingArea(int distance, boolean order)
Get a Non Stopping Area Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false. Always true when used in a TrackSection- Returns:
- a Non Stopping Area Track Condition.
-
inhibitMagShoeBrake
public static TrackCondition inhibitMagShoeBrake(int distance, boolean order)
Get an Inhibit Magnetic Shoe Brake Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- an Inhibit Magnetic Shoe Brake Track Condition.
-
inhibitEddyCurrentBrake
public static TrackCondition inhibitEddyCurrentBrake(int distance, boolean order)
Get an Inhibit Eddy Current Brake Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- an Inhibit Eddy Current Brake Track Condition.
-
inhibitRegenerativeBrake
public static TrackCondition inhibitRegenerativeBrake(int distance, boolean order)
Get an Inhibit Regenerative Brake Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- an Inhibit Regenerative Brake Track Condition.
-
tractionChange0
public static TrackCondition tractionChange0(int distance, boolean order)
Get a No Traction Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a No Traction Track Condition.
-
tractionChange25000
public static TrackCondition tractionChange25000(int distance, boolean order)
Get a Traction Change to 25kV Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Traction Change to 25kV Track Condition.
-
tractionChange15000
public static TrackCondition tractionChange15000(int distance, boolean order)
Get a Traction Change to 25kV Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Traction Change to 25kV Track Condition.
-
tractionChange3000
public static TrackCondition tractionChange3000(int distance, boolean order)
Get a Traction Change to 3kV DC Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Traction Change to 3kV DC Track Condition.
-
tractionChange1500
public static TrackCondition tractionChange1500(int distance, boolean order)
Get a Traction Change to 1.5kV Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Traction Change to 1.5kV Track Condition.
-
tractionChange750
public static TrackCondition tractionChange750(int distance, boolean order)
Get a Traction Change to 600V or 750V Track Condition.- Parameters:
distance
- distance until the Track Condition.order
- true if acknowledgement required, else false.- Returns:
- a Traction Change to 750V Track Condition.
-
-