Table of Contents

Class PortrayalTimeInterval

Namespace
EncDotNet.S100.Pipelines.Vector
Assembly
EncDotNet.S100.Core.dll

A time interval a drawing instruction is valid in: one entry of its TimeValid list, from a Date/Time/DateTime command and the TimeValid command that follows it (S-100 Part 9a §9a-11.2.6).

public sealed record PortrayalTimeInterval : IEquatable<PortrayalTimeInterval>
Inheritance
PortrayalTimeInterval
Implements
Inherited Members

Remarks

Bounds are kept as the portrayal emitted them. A missing bound is unbounded. A date bound may be truncated (S-100 Part 1 S100_TruncatedDate): a periodic range such as ----03-- to ----10-- compares only the month, so it holds from March to the end of October every year, and one whose begin is later than its end (November to February) runs over the year end. Times of day wrap over midnight the same way.

Intervals compare by value, so a host can collect the distinct intervals of a display list cheaply.

Constructors

PortrayalTimeInterval(PortrayalTimeKind, string?, string?, TimeIntervalClosure)

A time interval a drawing instruction is valid in: one entry of its TimeValid list, from a Date/Time/DateTime command and the TimeValid command that follows it (S-100 Part 9a §9a-11.2.6).

public PortrayalTimeInterval(PortrayalTimeKind Kind, string? Begin, string? End, TimeIntervalClosure Closure)

Parameters

Kind PortrayalTimeKind

What the bounds are.

Begin string

The begin bound as emitted, or null for none.

End string

The end bound as emitted, or null for none.

Closure TimeIntervalClosure

Which bounds apply and whether they're included.

Remarks

Bounds are kept as the portrayal emitted them. A missing bound is unbounded. A date bound may be truncated (S-100 Part 1 S100_TruncatedDate): a periodic range such as ----03-- to ----10-- compares only the month, so it holds from March to the end of October every year, and one whose begin is later than its end (November to February) runs over the year end. Times of day wrap over midnight the same way.

Intervals compare by value, so a host can collect the distinct intervals of a display list cheaply.

Properties

Begin

The begin bound as emitted, or null for none.

public string? Begin { get; init; }

Property Value

string

Closure

Which bounds apply and whether they're included.

public TimeIntervalClosure Closure { get; init; }

Property Value

TimeIntervalClosure

End

The end bound as emitted, or null for none.

public string? End { get; init; }

Property Value

string

Kind

What the bounds are.

public PortrayalTimeKind Kind { get; init; }

Property Value

PortrayalTimeKind

Methods

Contains(DateTimeOffset, TimeZoneInfo)

Whether the interval holds at time, with dates read in zone.

public bool Contains(DateTimeOffset time, TimeZoneInfo zone)

Parameters

time DateTimeOffset

The instant to test.

zone TimeZoneInfo

The time zone dates and times of day are read in.

Returns

bool

true when the interval holds.

Overlaps(PortrayalTime)

Whether the interval holds at any time in time: at its instant, or anywhere in its range.

public bool Overlaps(PortrayalTime time)

Parameters

time PortrayalTime

The time the map shows.

Returns

bool

true when the interval holds then.

TryParseClosure(string?, out TimeIntervalClosure)

Parses a TimeValid closure name (case-insensitive).

public static bool TryParseClosure(string? value, out TimeIntervalClosure closure)

Parameters

value string

The name, e.g. closedInterval.

closure TimeIntervalClosure

The closure, when the name is known.

Returns

bool

true when the name is known.