|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Represents a single data chunk with timestamp and sensor datapoints. More...
#include <DiabloPackets.h>
Public Member Functions | |
| SensorDataChunkCollection (uint32_t ts, uint8_t num_sensors) | |
| Constructor with timestamp. | |
| bool | add_datapoint (uint8_t sensor_id, uint32_t data) |
| Add a sensor datapoint to this chunk. | |
| size_t | size () const |
| Get the number of datapoints in this chunk. | |
| bool | empty () const |
| Check if the chunk is empty. | |
| bool | full () const |
| Check if the chunk is full. | |
| void | clear () |
| Clear all datapoints from this chunk. | |
Public Attributes | |
| uint32_t | timestamp |
| std::vector< SensorDatapoint > | datapoints |
| uint8_t | num_sensors |
Represents a single data chunk with timestamp and sensor datapoints.
This struct represents one data chunk containing a timestamp and a vector with num_sensors datapoints. It's used for collecting sensor data before serializing into network packets.
Definition at line 98 of file DiabloPackets.h.
|
inline |
Constructor with timestamp.
| ts | The timestamp for this data chunk |
| num_sensors | The number of sensor datapoints for this chunk |
Definition at line 108 of file DiabloPackets.h.
References num_sensors, and timestamp.
|
inline |
Add a sensor datapoint to this chunk.
| sensor_id | The ID of the sensor |
| data | The sensor reading value |
Definition at line 116 of file DiabloPackets.h.
References datapoints, and num_sensors.
Referenced by test_sensor_data_buffer_too_small(), and test_sensor_data_roundtrip().
|
inline |
Clear all datapoints from this chunk.
Definition at line 145 of file DiabloPackets.h.
References datapoints.
|
inline |
Check if the chunk is empty.
Definition at line 134 of file DiabloPackets.h.
References datapoints.
|
inline |
Check if the chunk is full.
Definition at line 140 of file DiabloPackets.h.
References datapoints, and num_sensors.
|
inline |
Get the number of datapoints in this chunk.
Definition at line 128 of file DiabloPackets.h.
References datapoints.
| std::vector<SensorDatapoint> daq::SensorDataChunkCollection::datapoints |
Definition at line 100 of file DiabloPackets.h.
Referenced by add_datapoint(), clear(), empty(), full(), daq::parse_sensor_data_packet(), and size().
| uint8_t daq::SensorDataChunkCollection::num_sensors |
Definition at line 101 of file DiabloPackets.h.
Referenced by add_datapoint(), full(), and SensorDataChunkCollection().
| uint32_t daq::SensorDataChunkCollection::timestamp |
Definition at line 99 of file DiabloPackets.h.
Referenced by engine.control.robust_ddp.data_models.Measurement::__post_init__(), and SensorDataChunkCollection().