Class PassageSchedule
- Namespace
- EncDotNet.S100.Navigation
- Assembly
- EncDotNet.S100.Navigation.dll
Distances, durations and ETAs for a passage at a constant speed over ground on each leg. Build one with Compute(PassagePlan, RouteCheckSettings).
public sealed class PassageSchedule
- Inheritance
-
PassageSchedule
- Inherited Members
Remarks
ETAs are departure plus distance divided by the entered speed; S-111 currents are not applied (handoff decision 4). A leg with no speed has no duration, and the ETAs from its start onward are unknown.
Properties
Arrival
The arrival time, or null when any leg has no speed.
public DateTimeOffset? Arrival { get; }
Property Value
Departure
The departure time.
public DateTimeOffset Departure { get; }
Property Value
Duration
Total time under way, or null when any leg has no speed.
public TimeSpan? Duration { get; }
Property Value
Legs
Per-leg distances and times, in route order.
public IReadOnlyList<LegSchedule> Legs { get; }
Property Value
TotalDistanceMeters
Total length of the passage in metres.
public double TotalDistanceMeters { get; }
Property Value
Methods
Compute(PassagePlan, RouteCheckSettings)
Computes the schedule the checks use for a plan: it leaves at the plan's departure, or at At when the plan has none.
public static PassageSchedule Compute(PassagePlan plan, RouteCheckSettings settings)
Parameters
planPassagePlanThe plan.
settingsRouteCheckSettingsThe check settings.
Returns
- PassageSchedule
The schedule.
Exceptions
- ArgumentException
A leg has fewer than two points, or a negative or non-finite speed.
Compute(IReadOnlyList<PassageLeg>, DateTimeOffset)
Computes the schedule for legs leaving at departure.
public static PassageSchedule Compute(IReadOnlyList<PassageLeg> legs, DateTimeOffset departure)
Parameters
legsIReadOnlyList<PassageLeg>The legs in route order.
departureDateTimeOffsetThe departure time.
Returns
- PassageSchedule
The schedule.
Exceptions
- ArgumentException
A leg has fewer than two points, or a negative or non-finite speed.
EtaAt(int, double)
The ETA at a point distanceAlongLegMeters into leg
legIndex, or null when it is unknown.
public DateTimeOffset? EtaAt(int legIndex, double distanceAlongLegMeters)
Parameters
legIndexintZero-based leg index.
distanceAlongLegMetersdoubleDistance from the start of the leg, in metres.
Returns
- DateTimeOffset?
The ETA, or
null.
TimeAt(int, double)
The time a check judges a point at: its ETA, or the departure where it has none (a leg without a speed, or after one).
public DateTimeOffset TimeAt(int legIndex, double distanceAlongLegMeters)
Parameters
legIndexintZero-based leg index.
distanceAlongLegMetersdoubleDistance from the start of the leg, in metres.
Returns
- DateTimeOffset
The time.