Skip to main content

Class SwitchingRainGauge

Represents a simple switching rain gauge

Assembly: RainGauge.dll
View Source
public class SwitchingRainGauge : SamplingSensorBase<Length>, IObservable<IChangeResult<Length>>, ISamplingSensor<Length>, ISensor<Length>, ISensor, ISamplingSensor, IDisposable

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT> -> Meadow.Foundation.SamplingSensorBase<UNIT>

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Length>>, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Length>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Length>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, System.IDisposable

Properties

ClickCount

The number of times the rain tilt sensor has triggered This count is multiplied by the depth per click to calculate the rain depth

View Source
public int ClickCount { get; protected set; }

RainDepth

The total accumulated rain depth

View Source
public Length RainDepth { get; }

DepthPerClick

The amount of rain recorded per rain-gauge event

View Source
public Length DepthPerClick { get; set; }

IsDisposed

Is the object disposed

View Source
public bool IsDisposed { get; }

Methods

Reset()

Reset the rain height

View Source
public void Reset()

StartUpdating(TimeSpan?)

Start the sensor

View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
TypeName
System.Nullable<System.TimeSpan>updateInterval

StopUpdating()

Stops sampling the sensor

View Source
public override void StopUpdating()

ReadSensor()

Convenience method to get the current rain depth

View Source
protected override Task<Length> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Length>

Dispose()

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

View Source
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Length>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Length>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Length>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • System.IDisposable