Class 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 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.
      • 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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.