Class RouteChecker
- Namespace
- EncDotNet.S100.Navigation
- Assembly
- EncDotNet.S100.Navigation.dll
Checks a PassagePlan against one set of loaded data with every check, and returns one RouteCheckReport: the findings, the verdict and whether each check ran.
public sealed class RouteChecker
- Inheritance
-
RouteChecker
- Inherited Members
Remarks
The built-in checks are ChartCheck, AreaCheck, WarningCheck and ClearanceCheck, run in that order. Each one says when it can't run, with a reason, rather than finding nothing.
Create one checker per RouteCheckSources and keep it while the data is loaded: its checks keep what the last run computed and reuse it. Moving a waypoint resamples only the legs that changed; changing the departure re-evaluates the clearance and re-judges the times of areas and warnings without sweeping the charts or sampling the depths again.
Check(PassagePlan, RouteCheckSettings, CancellationToken) may be called from several threads at once.
This is an aid for exploring the data. It isn't for navigation.
Constructors
RouteChecker(RouteCheckSources, RouteCheckOptions?, IEnumerable<IRouteCheck>?)
Creates a checker with the built-in checks and any of the host's own.
public RouteChecker(RouteCheckSources sources, RouteCheckOptions? options = null, IEnumerable<IRouteCheck>? additionalChecks = null)
Parameters
sourcesRouteCheckSourcesThe loaded data.
optionsRouteCheckOptionsTuning, or
nullfor Default.additionalChecksIEnumerable<IRouteCheck>Checks to run after the built-in ones, or
null.
RouteChecker(RouteCheckSources, IEnumerable<IRouteCheck>, RouteCheckOptions?)
Creates a checker that runs exactly checks, in order.
public RouteChecker(RouteCheckSources sources, IEnumerable<IRouteCheck> checks, RouteCheckOptions? options = null)
Parameters
sourcesRouteCheckSourcesThe loaded data.
checksIEnumerable<IRouteCheck>The checks, such as only a ClearanceCheck.
optionsRouteCheckOptionsTuning, or
nullfor Default.
Exceptions
- ArgumentException
A check is null, or two have the same name.
Properties
Checks
The checks, in the order they run.
public IReadOnlyList<IRouteCheck> Checks { get; }
Property Value
Methods
Check(PassagePlan, RouteCheckSettings, CancellationToken)
Checks a plan. Synchronous and CPU-bound; the token cancels cooperatively.
public RouteCheckReport Check(PassagePlan plan, RouteCheckSettings settings, CancellationToken cancellationToken = default)
Parameters
planPassagePlanThe plan.
settingsRouteCheckSettingsThe settings for this run.
cancellationTokenCancellationTokenCancels the check, for example when the route changes again.
Returns
- RouteCheckReport
The report.
Exceptions
- ArgumentException
A leg has fewer than two points, or a negative or non-finite speed.