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
cultureCultureInfoThe culture numbers and dates are formatted in;
nullfor the invariant culture.depthUnitDepthUnitThe unit depths are shown in.
timeZoneTimeZoneInfoThe zone times are shown in;
nullfor UTC, marked "UTC".
Properties
AboveWater
A danger that shows above water (waterLevelEffect 1 or 2).
protected virtual string AboveWater { get; }
Property Value
AreaCrossesFormat
Title when the track crosses any other area ({0}: the area's name or kind).
protected virtual string AreaCrossesFormat { get; }
Property Value
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
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
AreaKindOff
The title of AreaKindOff: the S-101
alert catalogue's ProhAreHighlightOffMsg.
protected virtual string AreaKindOff { get; }
Property Value
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
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
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
Awash
A danger that is awash (waterLevelEffect 5).
protected virtual string Awash { get; }
Property Value
BelowDistanceFormat
Title below your UKC setting, without ETAs ({0}: nautical miles).
protected virtual string BelowDistanceFormat { get; }
Property Value
BelowKeelFormat
The draft + squat + required UKC threshold fired ({0}).
protected virtual string BelowKeelFormat { get; }
Property Value
BelowMinutesFormat
Title below your UKC setting, with ETAs ({0}: whole minutes).
protected virtual string BelowMinutesFormat { get; }
Property Value
BelowSafetyContourFormat
The safety-contour threshold fired ({0}).
protected virtual string BelowSafetyContourFormat { get; }
Property Value
BelowSafetyDepthFormat
The safety-depth threshold fired ({0}).
protected virtual string BelowSafetyDepthFormat { get; }
Property Value
ChartedDepthFromS101
The title of ChartedDepthFromS101.
protected virtual string ChartedDepthFromS101 { get; }
Property Value
CoversAndUncovers
A danger that covers and uncovers (waterLevelEffect 4).
protected virtual string CoversAndUncovers { get; }
Property Value
CrossesDrying
The title of CrossesDrying.
protected virtual string CrossesDrying { get; }
Property Value
CrossesLand
The title of CrossesLand.
protected virtual string CrossesLand { get; }
Property Value
CrossesS102Shoal
The title of CrossesS102Shoal.
protected virtual string CrossesS102Shoal { get; }
Property Value
CrossesSafetyContour
The title of CrossesSafetyContour.
protected virtual string CrossesSafetyContour { get; }
Property Value
Culture
The culture numbers and dates are formatted in.
public CultureInfo Culture { get; }
Property Value
DangerInCorridorFormat
The title of DangerInCorridor: the danger's kind ({0}, such as Wreck).
protected virtual string DangerInCorridorFormat { get; }
Property Value
DangerNearRouteFormat
The title of DangerNearRoute: the danger's kind ({0}).
protected virtual string DangerNearRouteFormat { get; }
Property Value
DangerSafetyContourFormat
A danger's safety-contour threshold fired ({0}): a danger at the contour counts too.
protected virtual string DangerSafetyContourFormat { get; }
Property Value
DatumMismatch
The title of DatumMismatch.
protected virtual string DatumMismatch { get; }
Property Value
DatumUnconfirmed
The title of DatumUnconfirmed.
protected virtual string DatumUnconfirmed { get; }
Property Value
DatumUnconfirmedMetaFormat
The meta of DatumUnconfirmed ({0}: nautical miles).
protected virtual string DatumUnconfirmedMetaFormat { get; }
Property Value
Default
English, invariant culture, metres, UTC.
public static RouteFindingFormatter Default { get; }
Property Value
DepthUnit
The unit depths are shown in.
public DepthUnit DepthUnit { get; }
Property Value
DepthUnknown
A danger of unknown depth.
protected virtual string DepthUnknown { get; }
Property Value
DryingInCorridor
The title of DryingInCorridor.
protected virtual string DryingInCorridor { get; }
Property Value
FromFormat
A date range with no end ({0} start).
protected virtual string FromFormat { get; }
Property Value
HazardInCorridorFormat
The title of a hazard elsewhere in the corridor: its kind ({0}).
protected virtual string HazardInCorridorFormat { get; }
Property Value
HazardNearRouteFormat
The title of a hazard near the route: its kind ({0}).
protected virtual string HazardNearRouteFormat { get; }
Property Value
HazardOnTrackFormat
The title of a hazard on the track (#1127): its kind ({0}, from HazardKind(string)).
protected virtual string HazardOnTrackFormat { get; }
Property Value
IucnCategoryFormat
An IUCN category of a marine protected area ({0}: the category, such as IV).
protected virtual string IucnCategoryFormat { get; }
Property Value
LandInCorridor
The title of LandInCorridor.
protected virtual string LandInCorridor { get; }
Property Value
LeastDepthFormat
The least of several charted depths ({0}).
protected virtual string LeastDepthFormat { get; }
Property Value
LegFormat
A leg, from its first waypoint number ({0}) to its last ({1}).
protected virtual string LegFormat { get; }
Property Value
LegsFormat
Several legs, from the first waypoint number ({0}) to the last ({1}).
protected virtual string LegsFormat { get; }
Property Value
LengthFormat
A length in nautical miles ({0}), as a chart finding's span.
protected virtual string LengthFormat { get; }
Property Value
ListSeparator
Joins several restrictions or categories.
protected virtual string ListSeparator { get; }
Property Value
MinAtFormat
The least clearance ({0}) and when ({1}).
protected virtual string MinAtFormat { get; }
Property Value
MinFormat
The least clearance ({0}) without an ETA.
protected virtual string MinFormat { get; }
Property Value
NoChartedDepth
The title of NoChartedDepth.
protected virtual string NoChartedDepth { get; }
Property Value
NoDepthSource
Why there's no charted depth.
protected virtual string NoDepthSource { get; }
Property Value
NoValue
A clearance that isn't known.
protected virtual string NoValue { get; }
Property Value
NoWaterLevelCoverage
The title of NoWaterLevelCoverage.
protected virtual string NoWaterLevelCoverage { get; }
Property Value
Obstruction
The kind of an Obstruction, in a danger's title.
protected virtual string Obstruction { get; }
Property Value
OnTrack
A danger the track passes over.
protected virtual string OnTrack { get; }
Property Value
OutsideChartCoverage
The title of OutsideChartCoverage.
protected virtual string OutsideChartCoverage { get; }
Property Value
OutsideS102Format
The meta of ChartedDepthFromS101 ({0}: nautical miles).
protected virtual string OutsideS102Format { get; }
Property Value
OverheadOverTrackFormat
The title of an overhead feature over the track: its kind ({0}).
protected virtual string OverheadOverTrackFormat { get; }
Property Value
RangeFormat
A season, date range or span of ETAs with both ends ({0} start, {1} end).
protected virtual string RangeFormat { get; }
Property Value
Rock
The kind of an UnderwaterAwashRock, in a danger's title.
protected virtual string Rock { get; }
Property Value
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
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
S102ShoalInCorridor
The title of S102ShoalInCorridor.
protected virtual string S102ShoalInCorridor { get; }
Property Value
SafetyContourInCorridor
The title of SafetyContourInCorridor.
protected virtual string SafetyContourInCorridor { get; }
Property Value
Separator
Joins the parts of a meta line.
protected virtual string Separator { get; }
Property Value
SoundingCountFormat
A sounding count ({0}).
protected virtual string SoundingCountFormat { get; }
Property Value
SoundingsBelowSafetyContour
The title of SoundingsBelowSafetyContour.
protected virtual string SoundingsBelowSafetyContour { get; }
Property Value
StretchFromFormat
When a gap starts ({0}: the time).
protected virtual string StretchFromFormat { get; }
Property Value
StretchLengthFormat
A stretch's length ({0}: nautical miles).
protected virtual string StretchLengthFormat { get; }
Property Value
TideNotApplied
The water level isn't applied.
protected virtual string TideNotApplied { get; }
Property Value
TideNotAppliedForFormat
The water level isn't applied for a length ({0}: nautical miles).
protected virtual string TideNotAppliedForFormat { get; }
Property Value
TimeZone
The zone times are shown in, or null for UTC.
public TimeZoneInfo? TimeZone { get; }
Property Value
ToPortFormat
How far a danger is to port of the track, in metres ({0}).
protected virtual string ToPortFormat { get; }
Property Value
ToStarboardFormat
How far a danger is to starboard of the track, in metres ({0}).
protected virtual string ToStarboardFormat { get; }
Property Value
UnknownCodeFormat
A code with no label ({0}: the code).
protected virtual string UnknownCodeFormat { get; }
Property Value
UntilFormat
A date range with no start ({0} end).
protected virtual string UntilFormat { get; }
Property Value
ValidityFromFormat
A validity range with no end ({0} start).
protected virtual string ValidityFromFormat { get; }
Property Value
ValidityOpen
The validity when the part gives no range.
protected virtual string ValidityOpen { get; }
Property Value
ValidityRangeFormat
A validity range with both ends ({0} start, {1} end).
protected virtual string ValidityRangeFormat { get; }
Property Value
ValidityUntilFormat
A validity range with no start ({0} end).
protected virtual string ValidityUntilFormat { get; }
Property Value
WarningCancelledFormat
Title when the warning is cancelled by then ({0}: the warning's number).
protected virtual string WarningCancelledFormat { get; }
Property Value
WarningCancelledStatus
The meta line's status when cancelled.
protected virtual string WarningCancelledStatus { get; }
Property Value
WarningCrossesLineFormat
Title when the route crosses the warning's line ({0}: the warning's number).
protected virtual string WarningCrossesLineFormat { get; }
Property Value
WarningInForceAtFormat
The meta line's status when in force ({0}: the time).
protected virtual string WarningInForceAtFormat { get; }
Property Value
WarningInsideAreaFormat
Title when the route goes through the warning's area ({0}: the warning's number).
protected virtual string WarningInsideAreaFormat { get; }
Property Value
WarningNearFormat
Title when the warning is near the route ({0}: the warning's number).
protected virtual string WarningNearFormat { get; }
Property Value
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
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
WarningNotInForceAtFormat
The meta line's status when not in force ({0}: the time).
protected virtual string WarningNotInForceAtFormat { get; }
Property Value
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
WaterLevelEnds
The title of WaterLevelEnds.
protected virtual string WaterLevelEnds { get; }
Property Value
WaterLevelNoData
The title of WaterLevelNoData.
protected virtual string WaterLevelNoData { get; }
Property Value
WaterLevelStartsLate
The title of WaterLevelStartsLate.
protected virtual string WaterLevelStartsLate { get; }
Property Value
Wreck
The kind of a Wreck, in a danger's title.
protected virtual string Wreck { get; }
Property Value
Methods
AlertAreaKindLabel(int)
A kind of prohibited area or area with special conditions (RouteAreaKinds), in words.
protected virtual string AlertAreaKindLabel(int kind)
Parameters
kindintThe 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
kindRouteAreaKindThe 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
findingRouteFindingThe finding.
offAreaKindOffDetailsIts 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
findingRouteFindingThe finding.
areaAreaDetailsIts details.
Returns
- string
The meta line.
AreaTitle(RouteFinding, AreaDetails)
The title of an area finding.
protected virtual string AreaTitle(RouteFinding finding, AreaDetails area)
Parameters
findingRouteFindingThe finding.
areaAreaDetailsIts 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
kindRouteAreaKindThe area's kind.
codeintThe 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
findingRouteFindingThe finding.
Returns
- string
The meta line.
ChartTitle(RouteFinding)
The title of a chart or depth finding.
protected virtual string ChartTitle(RouteFinding finding)
Parameters
findingRouteFindingThe 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
findingRouteFindingThe 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
findingRouteFindingThe 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
featureTypestringThe feature type.
Returns
- string
The kind.
Format(string, params object?[])
Formats a phrase in Culture.
protected string Format(string format, params object?[] args)
Parameters
Returns
- string
The text.
FormatDate(DateOnly)
A day of a fixed date range: d MMM yyyy.
protected virtual string FormatDate(DateOnly date)
Parameters
dateDateOnlyThe day.
Returns
- string
The text.
FormatDayOfYear(int, int)
A day of a season: d MMM.
protected virtual string FormatDayOfYear(int month, int day)
Parameters
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
depthDepthThe 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
timeDateTimeOffsetThe 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
depthDepthThe 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
timeDateTimeOffsetThe 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
featureTypestringThe 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
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
findingRouteFindingThe 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
findingRouteFindingThe 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
findingsIEnumerable<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
codeintThe code.
Returns
- string
The label.
Title(RouteFinding)
A finding's title, e.g. "Crosses drying ground".
public virtual string Title(RouteFinding finding)
Parameters
findingRouteFindingThe 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
warningWarningDetailsIts 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
findingRouteFindingThe finding.
warningWarningDetailsIts details.
Returns
- string
The title.