Class RouteFinding
- Namespace
- EncDotNet.S100.Navigation
- Assembly
- EncDotNet.S100.Navigation.dll
One entry in a route's findings list (#905): what a route check found, where it is, the numbers behind it (Details), and its text as a RouteFindingFormatter rendered it.
public sealed class RouteFinding
- Inheritance
-
RouteFinding
- Inherited Members
Remarks
The checks render Title and Meta with the formatter in their options. A host can render them again in another language, depth unit or time format with Render(RouteFinding), without checking again.
Constructors
RouteFinding(string, RouteFindingCode, RouteFindingGroup?)
Creates a finding without text; render it with a RouteFindingFormatter.
public RouteFinding(string id, RouteFindingCode code, RouteFindingGroup? group = null)
Parameters
idstringStable within one result, e.g.
clearance.below_setting.2, so a selection survives a recompute that finds the same thing.codeRouteFindingCodeThe kind of finding.
groupRouteFindingGroup?What to do about it;
nullfor the code's DefaultGroup.
Properties
Category
What it's about: its code's Category.
public RouteFindingCategory Category { get; }
Property Value
Code
The kind of finding, e.g. CrossesDrying.
public RouteFindingCode Code { get; }
Property Value
Details
The numbers behind it, by kind (DangerDetails, WarningDetails, …), or null when its code says it all.
public RouteFindingDetails? Details { get; init; }
Property Value
Distance
Distance from departure to the point to show, such as the minimum in a span, or null when it isn't on the route.
public Length? Distance { get; init; }
Property Value
Feature
The feature behind it, or null.
public RouteFindingFeature? Feature { get; init; }
Property Value
Group
What to do about it.
public RouteFindingGroup Group { get; }
Property Value
Id
Stable within one result, e.g. clearance.below_setting.2, so a selection survives a recompute that finds the same thing.
public string Id { get; }
Property Value
LegIndex
The leg the finding is on (its first leg for a span), or null when it isn't tied to a leg.
public int? LegIndex { get; init; }
Property Value
- int?
Location
Where it is, or null when it has no place on the map.
public RouteFindingLocation? Location { get; init; }
Property Value
Meta
Where and why, e.g. "Leg 6 → 7 · min 0.4 m at 07:52"; empty until rendered.
public string Meta { get; init; }
Property Value
Title
One line, e.g. "Below your UKC setting for 12 min"; empty until rendered.
public string Title { get; init; }
Property Value
Methods
Sort(IEnumerable<RouteFinding>)
Sorts findings by group (MUST REVIEW, CHECK, INFO), then by distance from departure (findings not on the route last), keeping ties in order.
public static IReadOnlyList<RouteFinding> Sort(IEnumerable<RouteFinding> findings)
Parameters
findingsIEnumerable<RouteFinding>The findings.
Returns
- IReadOnlyList<RouteFinding>
The sorted list.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
WithText(string, string)
A copy of this finding with other text.
public RouteFinding WithText(string title, string meta)
Parameters
Returns
- RouteFinding
The copy.