AWind
TimeSerieBuffer Class Reference

Buffer for sensor data. It is used by chart control. More...

#include <TimeSerieBuffer.h>

Inheritance diagram for TimeSerieBuffer:

Public Member Functions

 TimeSerieBuffer (float time_step, float factor_y, int reserved_size, int size)
 Constructor. More...
 
 TimeSerieBuffer (float time_step, float factor_y, int size)
 Constructor. More...
 
bool SetSize (int size)
 Sets actual buffer size. It has to be less or equal to reserved_size.
 
float SetTimeStep (float time_step)
 Sets time interval between samples in buffer.
 
float SetFactorY (float factor_y)
 Sets scale factor for mesaurements.
 
void Set (unsigned int index, float value)
 Puts value into buffer. More...
 
int * Y ()
 Returns point to vaues array. It is used for direct access to internal buffer.
 
void MinMax (float &min_x, float &max_x, float &min_y, float &max_y)
 Returns min and max value for buffer data.
 
float X (unsigned int index)
 Returns X that is calculated from index in buffer (see time_step parameter)
 
float Y (unsigned int index)
 Returns scaled value Y from buffer for specified index.
 
unsigned int StartIndex ()
 Returns start index in buffer. For this class is always 0.
 
unsigned int Size ()
 Returns buffer size.
 

Protected Member Functions

void initialize (float time_step, float factor_y, int reserved_size, int size)
 Initialize internal buffer.
 

Detailed Description

Buffer for sensor data. It is used by chart control.

Constructor & Destructor Documentation

TimeSerieBuffer::TimeSerieBuffer ( float  time_step,
float  factor_y,
int  reserved_size,
int  size 
)
inline

Constructor.

Parameters
time_steptime interval between samples in buffer
factor_yscale factor for measurements. Data can be stored as volts measured directly on board pins and this factor transform them into phisical units
reserved_sizeexpected buffer size. This value allows buffer allocation only once. This is highly recomended because memory allocation is expencive operation. Mutiple allocation leads also to memory fragmentation.
sizeactual buffer size
TimeSerieBuffer::TimeSerieBuffer ( float  time_step,
float  factor_y,
int  size 
)
inline

Constructor.

Parameters
time_steptime interval between samples in buffer
factor_yscale factor for measurements. Data can be stored as volts measured directly on board pins and this factor transform them into phisical units
sizeactual buffer size. reserved_size=size

Member Function Documentation

void TimeSerieBuffer::Set ( unsigned int  index,
float  value 
)
inline

Puts value into buffer.

Parameters
indexindex in buffer. It has to be less than size
valuevalue to save in the buffer

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