Class SimulatedSensor
A sensor that invents plausible readings.
public sealed class SimulatedSensor : IDisposable
- Inheritance
-
SimulatedSensor
- Implements
- Inherited Members
Remarks
Simulated devices matter more from a binding than from Rust: someone writing against the SDK in C# can put a sensor, an actuator, and a lossy link into a unit test and find out what their code does when a reading drifts or a packet vanishes, without owning the device.
Constructors
SimulatedSensor(float, float, float, uint)
Creates a sensor that reads around a baseline.
public SimulatedSensor(float baseline, float driftPerRead = 0, float noise = 0, uint seed = 0)
Parameters
baselinefloatThe value it reads before drift and noise.
driftPerReadfloatHow much the baseline moves each read.
noisefloatThe amplitude of the wobble around it.
seeduintThe seed for that wobble, so a run repeats.
Exceptions
- PamojaException
The native sensor could not be created.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
ReadAsync()
Takes the next reading.
public Task<float> ReadAsync()
Returns
Exceptions
- PamojaException
The native call failed.