Table of Contents

Class Depletion

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Warns before a falling level runs out, by projecting its rate of fall.

public sealed class Depletion : IDisposable
Inheritance
Depletion
Implements
Inherited Members

Remarks

Knowing a tank is empty is too late; this reports how many samples remain at the current rate, so the refill can be arranged while there is still time.

Constructors

Depletion(float)

Creates an estimator counting down to a threshold.

public Depletion(float threshold)

Parameters

threshold float

The level treated as empty.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Update(float)

Records a level and estimates the samples left before the threshold.

public uint? Update(float level)

Parameters

level float

The latest measured level. One that is not a finite number is ignored.

Returns

uint?

The samples remaining: 0 once the level is at or below the threshold, the first reading included. null while the level is steady or rising, or on a first reading above the threshold, when no rate of fall is known yet.