Package jmri.jmrit.etcs
Class MovementAuthority
- java.lang.Object
-
- jmri.jmrit.etcs.MovementAuthority
-
@API(status=EXPERIMENTAL) public class MovementAuthority extends java.lang.Object
Class to represent a Movement Authority which is passed to the DMI to authorise a route.
-
-
Constructor Summary
Constructors Constructor Description MovementAuthority(java.util.List<TrackSection> sectionList)
Create a new MovementAuthority from a List of TrackSections.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<MovementAuthority>
advanceForward(java.util.List<MovementAuthority> list, int distance)
Advance forward a List of Movement Authorities.static java.util.List<TrackSection>
getTrackSectionList(java.util.List<MovementAuthority> completeList, boolean isSpeed)
Aggregates a list of DmiMovementAuthorities into a list of DmiTrackSections, based on either speed changes or gradient changes.java.util.List<TrackSection>
getTrackSections()
Get the list of TrackSections.
-
-
-
Constructor Detail
-
MovementAuthority
public MovementAuthority(java.util.List<TrackSection> sectionList)
Create a new MovementAuthority from a List of TrackSections.- Parameters:
sectionList
- the list of TrackSections.
-
-
Method Detail
-
getTrackSections
public java.util.List<TrackSection> getTrackSections()
Get the list of TrackSections.- Returns:
- Unmodifiable list of TrackSections.
-
getTrackSectionList
@Nonnull public static java.util.List<TrackSection> getTrackSectionList(@Nonnull java.util.List<MovementAuthority> completeList, boolean isSpeed)
Aggregates a list of DmiMovementAuthorities into a list of DmiTrackSections, based on either speed changes or gradient changes.- Parameters:
completeList
- The list of MovementAuthority objects to process.isSpeed
- True to aggregate based on speed changes, False to aggregate based on gradient changes.- Returns:
- A list of aggregated DmiTrackSection77 objects.
-
advanceForward
@Nonnull public static java.util.List<MovementAuthority> advanceForward(@Nonnull java.util.List<MovementAuthority> list, int distance)
Advance forward a List of Movement Authorities. The length of the nearest TrackSection(s) are reduced by the distance. Unused Track Sections are removed from the List. Track Section announcements are also advanced.- Parameters:
list
- the list to advance.distance
- the distance to advance.- Returns:
- the modified List of Movement Authorities.
-
-