Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::SimpleSensorSampler Class Reference

Sampler for simple sensors, those that are simply sampled by calling the sample() method. More...

#include <SensorSampler.h>

Inheritance diagram for Boardcore::SimpleSensorSampler:
Collaboration diagram for Boardcore::SimpleSensorSampler:

Public Member Functions

 SimpleSensorSampler (uint8_t id, std::chrono::nanoseconds period)
 
 ~SimpleSensorSampler ()
 
void addSensor (AbstractSensor *sensor, SensorInfo sensorInfo) override
 Add a sensor to the sensors map.
 
void sampleSensor (AbstractSensor *s) override
 Perform the update of all the sensors in the sampler.
 
- Public Member Functions inherited from Boardcore::SensorSampler
 SensorSampler (uint8_t id, std::chrono::nanoseconds period)
 
virtual ~SensorSampler ()
 
bool operator== (const SensorSampler &sampler) const
 
void toggleSensor (AbstractSensor *sensor, bool isEnabled)
 Enabled or disable a sensor.
 
void enableAllSensors ()
 Enable sampling for all the sensors.
 
void disableAllSensors ()
 Disable sampling for all the sensors.
 
void sampleAndCallback ()
 For each sensor, sample it and call the corresponding callback.
 
uint8_t getID ()
 
std::chrono::nanoseconds getSamplingPeriod ()
 
unsigned int getNumSensors ()
 
const SensorInfo getSensorInfo (AbstractSensor *sensor)
 

Additional Inherited Members

- Static Public Member Functions inherited from Boardcore::SensorSampler
static bool compareByPeriod (SensorSampler *left, SensorSampler *right)
 
- Protected Attributes inherited from Boardcore::SensorSampler
std::vector< std::pair< AbstractSensor *, SensorInfo > > sensors
 
PrintLogger logger = Logging::getLogger("sensorsampler")
 

Detailed Description

Sampler for simple sensors, those that are simply sampled by calling the sample() method.

Definition at line 119 of file SensorSampler.h.

Constructor & Destructor Documentation

◆ SimpleSensorSampler()

Boardcore::SimpleSensorSampler::SimpleSensorSampler ( uint8_t id,
std::chrono::nanoseconds period )

Definition at line 99 of file SensorSampler.cpp.

◆ ~SimpleSensorSampler()

Boardcore::SimpleSensorSampler::~SimpleSensorSampler ( )

Definition at line 105 of file SensorSampler.cpp.

Member Function Documentation

◆ addSensor()

void Boardcore::SimpleSensorSampler::addSensor ( AbstractSensor * sensor,
SensorInfo sensorInfo )
overridevirtual

Add a sensor to the sensors map.

Parameters
sensorThe sensor to be added.

Implements Boardcore::SensorSampler.

Definition at line 107 of file SensorSampler.cpp.

◆ sampleSensor()

void Boardcore::SimpleSensorSampler::sampleSensor ( AbstractSensor * s)
overridevirtual

Perform the update of all the sensors in the sampler.

Implements Boardcore::SensorSampler.

Definition at line 113 of file SensorSampler.cpp.


The documentation for this class was generated from the following files: