Table of Contents

Class CapStyle

Namespace
EncDotNet.S100.Datasets.Cap
Assembly
EncDotNet.S100.Datasets.Cap.dll

The code-defined drawing of CAP warnings (design note docs/design/weather-sources.md ยง6.1), built with the portrayal toolkit (EncDotNet.S100.Portrayals.Application): each area is hatched and outlined by severity and labelled with its event.

public static class CapStyle
Inheritance
CapStyle
Inherited Members

Remarks

By severity:

SeverityOutline and hatching
ExtremeDeep violet, 0.9 mm, cross-hatched every 2 mm.
SevereRed, 0.7 mm, hatched every 2.5 mm.
ModerateOrange, 0.5 mm, hatched every 4 mm.
MinorOchre, 0.4 mm, hatched every 6 mm.
UnknownGrey, 0.4 mm dashed, hatched every 6 mm.

The spacing differs as well as the colour, so the severities stay apart without colour vision and in the Night palette. More severe areas are drawn above less severe ones (a higher drawing priority). The label is the CAP event (for example "Gale Warning"), an ordinary text instruction, so it follows the text scale and the renderer's label declutter; it isn't drawn at scales smaller than 1:3,000,000 (LabelScaleMinimum). Everything is in viewing group ViewingGroup.

Fields

HaloToken

Colour token of the label halo.

public const string HaloToken = "CAPHALO"

Field Value

string

LabelScaleMinimum

The largest scale denominator labels are drawn at.

public const double LabelScaleMinimum = 3000000

Field Value

double

LabelToken

Colour token of the label text.

public const string LabelToken = "CAPTXT"

Field Value

string

Name

The style's name in the tile cache scope.

public const string Name = "CAP"

Field Value

string

Version

The style's version: bump it whenever its symbols, palette or rules change.

public const int Version = 1

Field Value

int

ViewingGroup

The viewing group of every CAP instruction.

public const int ViewingGroup = 31020

Field Value

int

Properties

ContentScope

The tile disk-cache content scope of the style (ApplicationContentScope).

public static string ContentScope { get; }

Property Value

string

Palette

The palette: one ink per severity (CAPEXT, CAPSEV, CAPMOD, CAPMIN, CAPUNK) plus the label text and halo. Night colours stay dim.

public static ApplicationPalette Palette { get; }

Property Value

ApplicationPalette

Symbols

The hatching symbols, CAPHATCHEXT, CAPHATCHSEV, CAPHATCHMOD, CAPHATCHMIN and CAPHATCHUNK.

public static SymbolSet Symbols { get; }

Property Value

SymbolSet

Methods

AreaFillName(CapSeverity)

The area fill of severity's hatching.

public static string AreaFillName(CapSeverity severity)

Parameters

severity CapSeverity

The severity.

Returns

string

BuildInstructions(IEnumerable<CapWarningArea>)

The drawing instructions of areas: per area a hatch fill, an outline and an event label, referencing each area's Id.

public static IReadOnlyList<DrawingInstruction> BuildInstructions(IEnumerable<CapWarningArea> areas)

Parameters

areas IEnumerable<CapWarningArea>

The areas to draw, usually DrawnAt(DateTimeOffset?).

Returns

IReadOnlyList<DrawingInstruction>

The instructions.

ColorToken(CapSeverity)

The colour token of severity's outline and hatching.

public static string ColorToken(CapSeverity severity)

Parameters

severity CapSeverity

The severity.

Returns

string

ResolveAreaFill(string)

Resolves a hatching area fill by name, or null.

public static AreaFill? ResolveAreaFill(string name)

Parameters

name string

The area fill's name, e.g. "CAPHATCHSEV".

Returns

AreaFill