Class CapStyle
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:
| Severity | Outline and hatching |
|---|---|
| Extreme | Deep violet, 0.9 mm, cross-hatched every 2 mm. |
| Severe | Red, 0.7 mm, hatched every 2.5 mm. |
| Moderate | Orange, 0.5 mm, hatched every 4 mm. |
| Minor | Ochre, 0.4 mm, hatched every 6 mm. |
| Unknown | Grey, 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
LabelScaleMinimum
The largest scale denominator labels are drawn at.
public const double LabelScaleMinimum = 3000000
Field Value
LabelToken
Colour token of the label text.
public const string LabelToken = "CAPTXT"
Field Value
Name
The style's name in the tile cache scope.
public const string Name = "CAP"
Field Value
Version
The style's version: bump it whenever its symbols, palette or rules change.
public const int Version = 1
Field Value
ViewingGroup
The viewing group of every CAP instruction.
public const int ViewingGroup = 31020
Field Value
Properties
ContentScope
The tile disk-cache content scope of the style (ApplicationContentScope).
public static string ContentScope { get; }
Property Value
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
Symbols
The hatching symbols, CAPHATCHEXT, CAPHATCHSEV, CAPHATCHMOD, CAPHATCHMIN and CAPHATCHUNK.
public static SymbolSet Symbols { get; }
Property Value
Methods
AreaFillName(CapSeverity)
The area fill of severity's hatching.
public static string AreaFillName(CapSeverity severity)
Parameters
severityCapSeverityThe severity.
Returns
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
areasIEnumerable<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
severityCapSeverityThe severity.
Returns
ResolveAreaFill(string)
Resolves a hatching area fill by name, or null.
public static AreaFill? ResolveAreaFill(string name)
Parameters
namestringThe area fill's name, e.g.
"CAPHATCHSEV".