Package jmri.jmrit.etcs
Class MovementAuthority
java.lang.Object
jmri.jmrit.etcs.MovementAuthority
Class to represent a Movement Authority which is passed to the DMI
to authorise a route.
-
Constructor Summary
ConstructorsConstructorDescriptionMovementAuthority(List<TrackSection> sectionList) Create a new MovementAuthority from a List of TrackSections. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<MovementAuthority>advanceForward(List<MovementAuthority> list, int distance) Advance forward a List of Movement Authorities.static List<TrackSection>getTrackSectionList(List<MovementAuthority> completeList, boolean isSpeed) Aggregates a list of DmiMovementAuthorities into a list of DmiTrackSections, based on either speed changes or gradient changes.Get the list of TrackSections.
-
Constructor Details
-
MovementAuthority
Create a new MovementAuthority from a List of TrackSections.- Parameters:
sectionList- the list of TrackSections.
-
-
Method Details
-
getTrackSections
Get the list of TrackSections.- Returns:
- Unmodifiable list of TrackSections.
-
getTrackSectionList
@Nonnull public static List<TrackSection> getTrackSectionList(@Nonnull 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 List<MovementAuthority> advanceForward(@Nonnull 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.
-