Skyward boardcore
|
Sampler for simple sensors, those that are simply sampled by calling the sample() method. More...
#include <SensorSampler.h>
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. | |
![]() | |
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 bool | compareByPeriod (SensorSampler *left, SensorSampler *right) |
![]() | |
std::vector< std::pair< AbstractSensor *, SensorInfo > > | sensors |
PrintLogger | logger = Logging::getLogger("sensorsampler") |
Sampler for simple sensors, those that are simply sampled by calling the sample() method.
Definition at line 119 of file SensorSampler.h.
Boardcore::SimpleSensorSampler::SimpleSensorSampler | ( | uint8_t | id, |
std::chrono::nanoseconds | period ) |
Definition at line 99 of file SensorSampler.cpp.
Boardcore::SimpleSensorSampler::~SimpleSensorSampler | ( | ) |
Definition at line 105 of file SensorSampler.cpp.
|
overridevirtual |
Add a sensor to the sensors map.
sensor | The sensor to be added. |
Implements Boardcore::SensorSampler.
Definition at line 107 of file SensorSampler.cpp.
|
overridevirtual |
Perform the update of all the sensors in the sampler.
Implements Boardcore::SensorSampler.
Definition at line 113 of file SensorSampler.cpp.