Table of Contents

Class RouteFindingFormatter

Namespace
EncDotNet.S100.Navigation
Assembly
EncDotNet.S100.Navigation.dll

Renders a RouteFinding's Title and Meta from its code and Details.

public class RouteFindingFormatter
Inheritance
RouteFindingFormatter
Inherited Members

Remarks

The default wording is English, with numbers in Culture (invariant unless given), depths in DepthUnit and times in UTC (or TimeZone). A host with its own resources subclasses it and overrides the wording; SoundCharts reads its Strings.resx. Every phrase is a virtual member, and so are the pieces that format depths, times and legs, and Title(RouteFinding) and Meta(RouteFinding) themselves.

The checks render with the formatter in their options. To show findings in another depth unit or time format, render them again with Render(RouteFinding); there is no need to check again.

Phrases that take a composite format are named …Format; their arguments are listed on each. A depth argument is already formatted with its unit (FormatDepth(Depth)), and so is a time.

Constructors

RouteFindingFormatter(CultureInfo?, DepthUnit, TimeZoneInfo?)

Creates a formatter.

public RouteFindingFormatter(CultureInfo? culture = null, DepthUnit depthUnit = DepthUnit.Metres, TimeZoneInfo? timeZone = null)

Parameters

culture CultureInfo

The culture numbers and dates are formatted in; null for the invariant culture.

depthUnit DepthUnit

The unit depths are shown in.

timeZone TimeZoneInfo

The zone times are shown in; null for UTC, marked "UTC".

Properties

AboveWater

A danger that shows above water (waterLevelEffect 1 or 2).

protected virtual string AboveWater { get; }

Property Value

string

AreaCrossesFormat

Title when the track crosses any other area ({0}: the area's name or kind).

protected virtual string AreaCrossesFormat { get; }

Property Value

string

AreaEntersFormat

Title when the track enters an area where entry is prohibited or restricted ({0}: the area's name or kind).

protected virtual string AreaEntersFormat { get; }

Property Value

string

AreaInCorridorFormat

Title when the area only reaches inside the cross-track limits ({0}: the area's name or kind).

protected virtual string AreaInCorridorFormat { get; }

Property Value

string

AreaKindOff

The title of AreaKindOff: the S-101 alert catalogue's ProhAreHighlightOffMsg.

protected virtual string AreaKindOff { get; }

Property Value

string

AreaKindOffFormat

The meta line's count of areas of a kind that's off ({0}: the kind; {1}: how many).

protected virtual string AreaKindOffFormat { get; }

Property Value

string

AreaNotInForceAtFormat

Title when the area isn't in force at the fallback time ({0}: the area's name or kind; {1}: the time).

protected virtual string AreaNotInForceAtFormat { get; }

Property Value

string

AreaNotInForceFormat

Title when the area isn't in force while the vessel is there, judged at ETAs ({0}: the area's name or kind).

protected virtual string AreaNotInForceFormat { get; }

Property Value

string

Awash

A danger that is awash (waterLevelEffect 5).

protected virtual string Awash { get; }

Property Value

string

BelowDistanceFormat

Title below your UKC setting, without ETAs ({0}: nautical miles).

protected virtual string BelowDistanceFormat { get; }

Property Value

string

BelowKeelFormat

The draft + squat + required UKC threshold fired ({0}).

protected virtual string BelowKeelFormat { get; }

Property Value

string

BelowMinutesFormat

Title below your UKC setting, with ETAs ({0}: whole minutes).

protected virtual string BelowMinutesFormat { get; }

Property Value

string

BelowSafetyContourFormat

The safety-contour threshold fired ({0}).

protected virtual string BelowSafetyContourFormat { get; }

Property Value

string

BelowSafetyDepthFormat

The safety-depth threshold fired ({0}).

protected virtual string BelowSafetyDepthFormat { get; }

Property Value

string

ChartedDepthFromS101

The title of ChartedDepthFromS101.

protected virtual string ChartedDepthFromS101 { get; }

Property Value

string

CoversAndUncovers

A danger that covers and uncovers (waterLevelEffect 4).

protected virtual string CoversAndUncovers { get; }

Property Value

string

CrossesDrying

The title of CrossesDrying.

protected virtual string CrossesDrying { get; }

Property Value

string

CrossesLand

The title of CrossesLand.

protected virtual string CrossesLand { get; }

Property Value

string

CrossesS102Shoal

The title of CrossesS102Shoal.

protected virtual string CrossesS102Shoal { get; }

Property Value

string

CrossesSafetyContour

The title of CrossesSafetyContour.

protected virtual string CrossesSafetyContour { get; }

Property Value

string

Culture

The culture numbers and dates are formatted in.

public CultureInfo Culture { get; }

Property Value

CultureInfo

DangerInCorridorFormat

The title of DangerInCorridor: the danger's kind ({0}, such as Wreck).

protected virtual string DangerInCorridorFormat { get; }

Property Value

string

DangerNearRouteFormat

The title of DangerNearRoute: the danger's kind ({0}).

protected virtual string DangerNearRouteFormat { get; }

Property Value

string

DangerSafetyContourFormat

A danger's safety-contour threshold fired ({0}): a danger at the contour counts too.

protected virtual string DangerSafetyContourFormat { get; }

Property Value

string

DatumMismatch

The title of DatumMismatch.

protected virtual string DatumMismatch { get; }

Property Value

string

DatumUnconfirmed

The title of DatumUnconfirmed.

protected virtual string DatumUnconfirmed { get; }

Property Value

string

DatumUnconfirmedMetaFormat

The meta of DatumUnconfirmed ({0}: nautical miles).

protected virtual string DatumUnconfirmedMetaFormat { get; }

Property Value

string

Default

English, invariant culture, metres, UTC.

public static RouteFindingFormatter Default { get; }

Property Value

RouteFindingFormatter

DepthUnit

The unit depths are shown in.

public DepthUnit DepthUnit { get; }

Property Value

DepthUnit

DepthUnknown

A danger of unknown depth.

protected virtual string DepthUnknown { get; }

Property Value

string

DryingInCorridor

The title of DryingInCorridor.

protected virtual string DryingInCorridor { get; }

Property Value

string

FromFormat

A date range with no end ({0} start).

protected virtual string FromFormat { get; }

Property Value

string

HazardInCorridorFormat

The title of a hazard elsewhere in the corridor: its kind ({0}).

protected virtual string HazardInCorridorFormat { get; }

Property Value

string

HazardNearRouteFormat

The title of a hazard near the route: its kind ({0}).

protected virtual string HazardNearRouteFormat { get; }

Property Value

string

HazardOnTrackFormat

The title of a hazard on the track (#1127): its kind ({0}, from HazardKind(string)).

protected virtual string HazardOnTrackFormat { get; }

Property Value

string

IucnCategoryFormat

An IUCN category of a marine protected area ({0}: the category, such as IV).

protected virtual string IucnCategoryFormat { get; }

Property Value

string

LandInCorridor

The title of LandInCorridor.

protected virtual string LandInCorridor { get; }

Property Value

string

LeastDepthFormat

The least of several charted depths ({0}).

protected virtual string LeastDepthFormat { get; }

Property Value

string

LegFormat

A leg, from its first waypoint number ({0}) to its last ({1}).

protected virtual string LegFormat { get; }

Property Value

string

LegsFormat

Several legs, from the first waypoint number ({0}) to the last ({1}).

protected virtual string LegsFormat { get; }

Property Value

string

LengthFormat

A length in nautical miles ({0}), as a chart finding's span.

protected virtual string LengthFormat { get; }

Property Value

string

ListSeparator

Joins several restrictions or categories.

protected virtual string ListSeparator { get; }

Property Value

string

MinAtFormat

The least clearance ({0}) and when ({1}).

protected virtual string MinAtFormat { get; }

Property Value

string

MinFormat

The least clearance ({0}) without an ETA.

protected virtual string MinFormat { get; }

Property Value

string

NoChartedDepth

The title of NoChartedDepth.

protected virtual string NoChartedDepth { get; }

Property Value

string

NoDepthSource

Why there's no charted depth.

protected virtual string NoDepthSource { get; }

Property Value

string

NoValue

A clearance that isn't known.

protected virtual string NoValue { get; }

Property Value

string

NoWaterLevelCoverage

The title of NoWaterLevelCoverage.

protected virtual string NoWaterLevelCoverage { get; }

Property Value

string

Obstruction

The kind of an Obstruction, in a danger's title.

protected virtual string Obstruction { get; }

Property Value

string

OnTrack

A danger the track passes over.

protected virtual string OnTrack { get; }

Property Value

string

OutsideChartCoverage

The title of OutsideChartCoverage.

protected virtual string OutsideChartCoverage { get; }

Property Value

string

OutsideS102Format

The meta of ChartedDepthFromS101 ({0}: nautical miles).

protected virtual string OutsideS102Format { get; }

Property Value

string

OverheadOverTrackFormat

The title of an overhead feature over the track: its kind ({0}).

protected virtual string OverheadOverTrackFormat { get; }

Property Value

string

RangeFormat

A season, date range or span of ETAs with both ends ({0} start, {1} end).

protected virtual string RangeFormat { get; }

Property Value

string

Rock

The kind of an UnderwaterAwashRock, in a danger's title.

protected virtual string Rock { get; }

Property Value

string

S102CellFormat

An S-102 depth ({0}) without an uncertainty, and its grid cell ({2}) in a dataset ({3}).

protected virtual string S102CellFormat { get; }

Property Value

string

S102CellWithUncertaintyFormat

An S-102 depth ({0}) with its uncertainty ({1}), and its grid cell ({2}, as row,col) in a dataset ({3}).

protected virtual string S102CellWithUncertaintyFormat { get; }

Property Value

string

S102ShoalInCorridor

The title of S102ShoalInCorridor.

protected virtual string S102ShoalInCorridor { get; }

Property Value

string

SafetyContourInCorridor

protected virtual string SafetyContourInCorridor { get; }

Property Value

string

Separator

Joins the parts of a meta line.

protected virtual string Separator { get; }

Property Value

string

SoundingCountFormat

A sounding count ({0}).

protected virtual string SoundingCountFormat { get; }

Property Value

string

SoundingsBelowSafetyContour

protected virtual string SoundingsBelowSafetyContour { get; }

Property Value

string

StretchFromFormat

When a gap starts ({0}: the time).

protected virtual string StretchFromFormat { get; }

Property Value

string

StretchLengthFormat

A stretch's length ({0}: nautical miles).

protected virtual string StretchLengthFormat { get; }

Property Value

string

TideNotApplied

The water level isn't applied.

protected virtual string TideNotApplied { get; }

Property Value

string

TideNotAppliedForFormat

The water level isn't applied for a length ({0}: nautical miles).

protected virtual string TideNotAppliedForFormat { get; }

Property Value

string

TimeZone

The zone times are shown in, or null for UTC.

public TimeZoneInfo? TimeZone { get; }

Property Value

TimeZoneInfo

ToPortFormat

How far a danger is to port of the track, in metres ({0}).

protected virtual string ToPortFormat { get; }

Property Value

string

ToStarboardFormat

How far a danger is to starboard of the track, in metres ({0}).

protected virtual string ToStarboardFormat { get; }

Property Value

string

UnknownCodeFormat

A code with no label ({0}: the code).

protected virtual string UnknownCodeFormat { get; }

Property Value

string

UntilFormat

A date range with no start ({0} end).

protected virtual string UntilFormat { get; }

Property Value

string

ValidityFromFormat

A validity range with no end ({0} start).

protected virtual string ValidityFromFormat { get; }

Property Value

string

ValidityOpen

The validity when the part gives no range.

protected virtual string ValidityOpen { get; }

Property Value

string

ValidityRangeFormat

A validity range with both ends ({0} start, {1} end).

protected virtual string ValidityRangeFormat { get; }

Property Value

string

ValidityUntilFormat

A validity range with no start ({0} end).

protected virtual string ValidityUntilFormat { get; }

Property Value

string

WarningCancelledFormat

Title when the warning is cancelled by then ({0}: the warning's number).

protected virtual string WarningCancelledFormat { get; }

Property Value

string

WarningCancelledStatus

The meta line's status when cancelled.

protected virtual string WarningCancelledStatus { get; }

Property Value

string

WarningCrossesLineFormat

Title when the route crosses the warning's line ({0}: the warning's number).

protected virtual string WarningCrossesLineFormat { get; }

Property Value

string

WarningInForceAtFormat

The meta line's status when in force ({0}: the time).

protected virtual string WarningInForceAtFormat { get; }

Property Value

string

WarningInsideAreaFormat

Title when the route goes through the warning's area ({0}: the warning's number).

protected virtual string WarningInsideAreaFormat { get; }

Property Value

string

WarningNearFormat

Title when the warning is near the route ({0}: the warning's number).

protected virtual string WarningNearFormat { get; }

Property Value

string

WarningNotInBulletinFormat

Title when the latest in-force bulletin leaves the warning out ({0}: the warning's number, {1}: the bulletin's series and number).

protected virtual string WarningNotInBulletinFormat { get; }

Property Value

string

WarningNotInBulletinStatusFormat

The meta line's status when the latest in-force bulletin leaves it out ({0}: the bulletin).

protected virtual string WarningNotInBulletinStatusFormat { get; }

Property Value

string

WarningNotInForceAtFormat

The meta line's status when not in force ({0}: the time).

protected virtual string WarningNotInForceAtFormat { get; }

Property Value

string

WarningNotInForceFormat

Title when the warning isn't in force while the vessel is there ({0}: the warning's number).

protected virtual string WarningNotInForceFormat { get; }

Property Value

string

WaterLevelEnds

The title of WaterLevelEnds.

protected virtual string WaterLevelEnds { get; }

Property Value

string

WaterLevelNoData

The title of WaterLevelNoData.

protected virtual string WaterLevelNoData { get; }

Property Value

string

WaterLevelStartsLate

The title of WaterLevelStartsLate.

protected virtual string WaterLevelStartsLate { get; }

Property Value

string

Wreck

The kind of a Wreck, in a danger's title.

protected virtual string Wreck { get; }

Property Value

string

Methods

AlertAreaKindLabel(int)

A kind of prohibited area or area with special conditions (RouteAreaKinds), in words.

protected virtual string AlertAreaKindLabel(int kind)

Parameters

kind int

The kind.

Returns

string

The label.

AreaKindLabel(RouteAreaKind)

What an area is, in a title or meta line: "restricted area", "caution area", ….

protected virtual string AreaKindLabel(RouteAreaKind kind)

Parameters

kind RouteAreaKind

The kind.

Returns

string

The label.

AreaKindOffMeta(RouteFinding, AreaKindOffDetails)

The meta line of AreaKindOff: the leg, the kind and how many areas of it.

protected virtual string AreaKindOffMeta(RouteFinding finding, AreaKindOffDetails off)

Parameters

finding RouteFinding

The finding.

off AreaKindOffDetails

Its details.

Returns

string

The meta line.

AreaMeta(RouteFinding, AreaDetails)

The meta line of an area finding: "Leg 1 → 2 · S-122 marine protected area · speed restricted · seal sanctuary · IUCN IV · 1 Mar–31 May · 06:11–06:14".

protected virtual string AreaMeta(RouteFinding finding, AreaDetails area)

Parameters

finding RouteFinding

The finding.

area AreaDetails

Its details.

Returns

string

The meta line.

AreaTitle(RouteFinding, AreaDetails)

The title of an area finding.

protected virtual string AreaTitle(RouteFinding finding, AreaDetails area)

Parameters

finding RouteFinding

The finding.

area AreaDetails

Its details.

Returns

string

The title.

CategoryLabel(RouteAreaKind, int)

A category code's label: categoryOfMilitaryPracticeArea, categoryOfAnchorage or categoryOfRestrictedArea, by the area's kind (from the S-101 Edition 2.0.0 Feature Catalogue).

protected virtual string CategoryLabel(RouteAreaKind kind, int code)

Parameters

kind RouteAreaKind

The area's kind.

code int

The code.

Returns

string

The label.

ChartMeta(RouteFinding)

The meta line of a chart or depth finding: the leg, the span's length, the feature type, and what fired.

protected virtual string ChartMeta(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

string

The meta line.

ChartTitle(RouteFinding)

The title of a chart or depth finding.

protected virtual string ChartTitle(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

string

The title.

ClearanceMeta(RouteFinding)

The meta line of a clearance, confidence or data finding of the clearance check.

protected virtual string ClearanceMeta(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

string

The meta line.

ClearanceTitle(RouteFinding)

The title of a clearance, confidence or data finding of the clearance check.

protected virtual string ClearanceTitle(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

string

The title.

DangerKind(string)

A danger's kind in its title, from its feature type.

protected virtual string DangerKind(string featureType)

Parameters

featureType string

The feature type.

Returns

string

The kind.

Format(string, params object?[])

Formats a phrase in Culture.

protected string Format(string format, params object?[] args)

Parameters

format string

The composite format.

args object[]

Its arguments.

Returns

string

The text.

FormatDate(DateOnly)

A day of a fixed date range: d MMM yyyy.

protected virtual string FormatDate(DateOnly date)

Parameters

date DateOnly

The day.

Returns

string

The text.

FormatDayOfYear(int, int)

A day of a season: d MMM.

protected virtual string FormatDayOfYear(int month, int day)

Parameters

month int

The month.

day int

The day.

Returns

string

The text.

FormatDepth(Depth)

A depth with its unit, to a tenth: "7.6 m", "24.9 ft".

protected virtual string FormatDepth(Depth depth)

Parameters

depth Depth

The depth.

Returns

string

The text.

FormatEta(DateTimeOffset)

When the vessel is somewhere: an ETA, or the time a finding is judged at. FormatTime(DateTimeOffset) by default; a host can show it more compactly against the departure.

protected virtual string FormatEta(DateTimeOffset time)

Parameters

time DateTimeOffset

The time.

Returns

string

The text.

FormatSetting(Depth)

A setting's depth with its unit, without a trailing zero: "10 m", "12.5 m".

protected virtual string FormatSetting(Depth depth)

Parameters

depth Depth

The depth.

Returns

string

The text.

FormatTime(DateTimeOffset)

A time, such as a validity or an ETA: yyyy-MM-dd HH:mm UTC, or in TimeZone.

protected virtual string FormatTime(DateTimeOffset time)

Parameters

time DateTimeOffset

The time.

Returns

string

The text.

HazardKind(string)

The kind of a hazard in its title (#1127): its feature type in words, such as "Lateral buoy" for LateralBuoy and "Virtual AIS aid to navigation" for VirtualAISAidToNavigation.

protected virtual string HazardKind(string featureType)

Parameters

featureType string

The S-101 feature type.

Returns

string

The kind.

LegLabel(int, int)

"Leg 6 → 7", or "Legs 5 → 7" for a span over more than one leg.

protected virtual string LegLabel(int firstLeg, int lastLeg)

Parameters

firstLeg int

The first leg's index.

lastLeg int

The last leg's index.

Returns

string

The label.

Meta(RouteFinding)

A finding's meta line: where and why, e.g. "Leg 2 → 3 · 0.10 NM · DepthArea".

public virtual string Meta(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

string

The meta line.

Render(RouteFinding)

A copy of a finding with its title and meta line rendered by this formatter.

public RouteFinding Render(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

RouteFinding

The copy.

Render(IEnumerable<RouteFinding>)

Copies of findings with their text rendered by this formatter, in the same order.

public IReadOnlyList<RouteFinding> Render(IEnumerable<RouteFinding> findings)

Parameters

findings IEnumerable<RouteFinding>

The findings.

Returns

IReadOnlyList<RouteFinding>

The copies.

RestrictionLabel(int)

A restriction code's label (from the S-101 Edition 2.0.0 Feature Catalogue).

protected virtual string RestrictionLabel(int code)

Parameters

code int

The code.

Returns

string

The label.

Title(RouteFinding)

A finding's title, e.g. "Crosses drying ground".

public virtual string Title(RouteFinding finding)

Parameters

finding RouteFinding

The finding.

Returns

string

The title.

WarningMeta(WarningDetails)

The meta line of an S-124 finding: "NAVAREA I 012/26 · Dover Strait · 1 Mar 05:00–08:00 · In force at 06:08".

protected virtual string WarningMeta(WarningDetails warning)

Parameters

warning WarningDetails

Its details.

Returns

string

The meta line.

WarningTitle(RouteFinding, WarningDetails)

The title of an S-124 finding.

protected virtual string WarningTitle(RouteFinding finding, WarningDetails warning)

Parameters

finding RouteFinding

The finding.

warning WarningDetails

Its details.

Returns

string

The title.