Table of Contents

Struct CoverageStepWindow

Namespace
EncDotNet.S100.Datasets.Pipelines.Query
Assembly
EncDotNet.S100.Core.dll

The first and last sample times of a site, with the tolerance (one time-step interval) within which a request beyond either end still counts as in range.

public readonly record struct CoverageStepWindow : IEquatable<CoverageStepWindow>
Implements
Inherited Members

Constructors

CoverageStepWindow(DateTime, DateTime, TimeSpan)

The first and last sample times of a site, with the tolerance (one time-step interval) within which a request beyond either end still counts as in range.

public CoverageStepWindow(DateTime First, DateTime Last, TimeSpan Tolerance)

Parameters

First DateTime

First time step (UTC).

Last DateTime

Last time step (UTC).

Tolerance TimeSpan

How far beyond either end a requested time still counts as in range.

Properties

First

First time step (UTC).

public DateTime First { get; init; }

Property Value

DateTime

Last

Last time step (UTC).

public DateTime Last { get; init; }

Property Value

DateTime

Tolerance

How far beyond either end a requested time still counts as in range.

public TimeSpan Tolerance { get; init; }

Property Value

TimeSpan

Methods

Covers(DateTime)

Whether time is within the window, allowing Tolerance at either end.

public bool Covers(DateTime time)

Parameters

time DateTime

Returns

bool

DistanceTo(DateTime)

How far time lies outside First..Last; zero inside.

public TimeSpan DistanceTo(DateTime time)

Parameters

time DateTime

Returns

TimeSpan

FromStation(DateTime, DateTime, TimeSpan, IReadOnlyList<DateTime>)

The window of a station's series: its sample times when it lists them, otherwise its start and end. The tolerance is the record interval, or the smallest gap between sample times when the interval is not set.

public static CoverageStepWindow FromStation(DateTime start, DateTime end, TimeSpan interval, IReadOnlyList<DateTime> sampleTimes)

Parameters

start DateTime
end DateTime
interval TimeSpan
sampleTimes IReadOnlyList<DateTime>

Returns

CoverageStepWindow

FromSteps(IEnumerable<DateTime>)

The window of a set of time steps, with the smallest gap between them as the tolerance.

public static CoverageStepWindow FromSteps(IEnumerable<DateTime> steps)

Parameters

steps IEnumerable<DateTime>

The time steps, in any order; at least one.

Returns

CoverageStepWindow