Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
SensorDataHandler.h
Go to the documentation of this file.
1// Originally written by Ethan Anderson -- 2/17/2024
2// DataHandler.h
3
4#ifndef SensorDataHandler_H
5#define SensorDataHandler_H
6
7#include <algorithm>
8#include <cmath>
9#include <cstdint>
10#include <cstdlib>
11#include <vector>
12
16
25public:
34
42 int addData(DataPoint data);
43
49 void restrictSaveSpeed(uint16_t interval_ms);
50
51 uint8_t getName() const {return name;}
52
54 return lastDataPointSaved;
55 }
56
57
58protected:
60private:
61 uint8_t name;
62 uint16_t saveInterval_ms; // The minimum time between each data point that is saved to the SD card
63 uint32_t lastSaveTime_ms; // The last time a data point was saved to the SD card
64
65 DataPoint lastDataPointSaved;
66};
67
68#endif // DATAHANDLER_H
Timestamped float measurement container.
Definition DataPoint.h:11
Abstract interface for persisting timestamped data points.
Definition DataSaver.h:13
SensorDataHandler(uint8_t name, IDataSaver *dataSaver)
Construct a handler for a specific sensor.
DataPoint getLastDataPointSaved() const
uint8_t getName() const
void restrictSaveSpeed(uint16_t interval_ms)
Set the minimum gap between persisted samples.
int addData(DataPoint data)
Ingest a data point and persist it if the save interval elapsed.