Class TrackSection

java.lang.Object
jmri.jmrit.etcs.TrackSection

@API(status=EXPERIMENTAL) public class TrackSection extends Object
Class to represent DMI Track Points of Interest, i.e. Announcements and Orders.
  • Constructor Details

    • TrackSection

      public TrackSection(int sectionLength, int sectionSpeed, int sectionGradient)
      Create a new TrackSection.
      Parameters:
      sectionLength - the Section Length.
      sectionSpeed - the Section Speed.
      sectionGradient - the Section Gradient.
  • Method Details

    • getLength

      public int getLength()
      Get the Section Length.
      Returns:
      section length.
    • setLength

      protected void setLength(int newLength)
    • getSpeed

      public int getSpeed()
      Get the maximum speed for Section.
      Returns:
      maximum speed.
    • getGradient

      public int getGradient()
      Get the Section Gradient.
      Returns:
      gradient percentage for the Track Section.
    • addAnnouncement

      Add an Announcement to the Track Section.
      Parameters:
      ac - the Announcement to add.
      Throws:
      IllegalArgumentException - if the Announcement does not fit into the TrackSection.
    • getAnnouncements

      Get the List of Announcements for the Section.
      Returns:
      List of Announcements related to the TrackSection.
    • advanceAnnouncements

      protected void advanceAnnouncements(int distance)
    • toString

      public String toString()
      Overrides:
      toString in class Object