Class ResistiveTankLevelSender
Represents a generic resistive tank level sender sensor.
Assembly: ResistiveTankLevelSender.dll
View Source
public abstract class ResistiveTankLevelSender : SamplingSensorBase<int>, IObservable<IChangeResult<int>>, ISamplingSensor<int>, ISensor<int>, ISensor, ISamplingSensor, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.ObservableBase<UNIT>
Derived:
Meadow.Foundation.Sensors.Volume.ResistiveTankLevelSender_12in_33_240
Implements:
System.IObservable<Meadow.IChangeResult<System.Int32>>
, Meadow.Peripherals.Sensors.ISamplingSensor<System.Int32>
, Meadow.Peripherals.Sensors.ISensor<System.Int32>
, Meadow.Peripherals.Sensors.ISensor
, Meadow.Peripherals.Sensors.ISamplingSensor
, System.IDisposable
Properties
IsDisposed
Gets a value indicating whether the object is disposed.
View Source
public bool IsDisposed { get; }
ResistanceToFillLevelMap
Gets the mapping of resistance (in ohms) to fill level (in 0-100 percent).
View Source
protected abstract Dictionary<int, int> ResistanceToFillLevelMap { get; }
FillLevelPercent
Gets the measured fill level percentage.
View Source
public int FillLevelPercent { get; }
Methods
ReadSensor()
Read value from sensor
View Source
protected override Task<int> ReadSensor()
Returns
System.Threading.Tasks.Task<System.Int32>
: unitized value### StartUpdating(TimeSpan?)
Starts updating the sensor on the updateInterval frequency specified
View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | updateInterval | A TimeSpan that specifies how long to |
wait between readings |
StopUpdating()
Stops sampling the sensor
View Source
public override void StopUpdating()
Dispose(bool)
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
Dispose()
Disposes the object
View Source
public void Dispose()
Events
FillLevelChanged
Occurs when the fill level changes.
View Source
public event EventHandler<int>? FillLevelChanged
Event Type
System.EventHandler<System.Int32>
Implements
System.IObservable<Meadow.IChangeResult<System.Int32>>
Meadow.Peripherals.Sensors.ISamplingSensor<System.Int32>
Meadow.Peripherals.Sensors.ISensor<System.Int32>
Meadow.Peripherals.Sensors.ISensor
Meadow.Peripherals.Sensors.ISamplingSensor
System.IDisposable