Skip to main content

Class SimulatedSensorBase

Contains the base logic form simple simulated sensors

Assembly: Meadow.Foundation.dll
View Source
Declaration
public abstract class SimulatedSensorBase : ISimulatedSensor

Derived:
Meadow.Foundation.Sensors.SimulatedAnalogInputPort

Implements:
Meadow.Peripherals.Sensors.ISimulatedSensor

Properties

SimulationBehavior

The currently set behavior for the sensor

View Source
Declaration
protected SimulationBehavior SimulationBehavior { get; }

SupportedBehaviors

Gets an array of supported simulation behaviors for the sensor.

View Source
Declaration
public virtual SimulationBehavior[] SupportedBehaviors { get; }

ValueType

Gets the type of the sensor's value.

View Source
Declaration
public abstract Type ValueType { get; }

Methods

SetSensorValue(object)

Sets the simulated value for the sensor.

View Source
Declaration
public abstract void SetSensorValue(object value)
Parameters
TypeNameDescription
System.ObjectvalueThe value to set for the sensor.

StartSimulation(SimulationBehavior)

Starts the simulation with the specified behavior.

View Source
Declaration
public virtual void StartSimulation(SimulationBehavior behavior)
Parameters
TypeNameDescription
Meadow.Peripherals.Sensors.SimulationBehaviorbehaviorThe simulation behavior to start.

GetRandomDouble(double, double)

Generates a random double value between the two provided values

View Source
Declaration
protected double GetRandomDouble(double minValue, double maxValue)
Returns

System.Double

Parameters
TypeNameDescription
System.DoubleminValueInclusive lower bound value
System.DoublemaxValueExclusive upper bound value

Implements

  • Meadow.Peripherals.Sensors.ISimulatedSensor