MAV'RIC
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions
Data_logging Class Reference

Log data in files. More...

#include <data_logging.hpp>

Inheritance diagram for Data_logging:
Inheritance graph
[legend]

List of all members.

Classes

struct  conf_t
 Configuration of the data_logging element. More...

Public Member Functions

 Data_logging (File &file, State &state, conf_t config=default_config())
 Data logging constructor.
bool create_new_log_file (const char *file_name_, uint32_t sysid)
 Initialise the data logging module.
bool update ()
 The task to log the data to the SD card.
bool start (void)
 Start logging data.
bool stop (void)
 Stop logging data.
template<typename T >
bool add_field (const T *val, const char *param_name)
 Registers parameter to log on the SD card (integer version)
template<typename T >
bool add_field (const T *val, const char *param_name, uint32_t precision)
 Registers parameter to log on the SD card (float and double version)
template<>
bool add_field (const uint8_t *val, const char *param_name)
template<>
bool add_field (const int8_t *val, const char *param_name)
template<>
bool add_field (const uint16_t *val, const char *param_name)
template<>
bool add_field (const int16_t *val, const char *param_name)
template<>
bool add_field (const uint32_t *val, const char *param_name)
template<>
bool add_field (const int32_t *val, const char *param_name)
template<>
bool add_field (const uint64_t *val, const char *param_name)
template<>
bool add_field (const int64_t *val, const char *param_name)
template<>
bool add_field (const float *val, const char *param_name, uint32_t precision)
template<>
bool add_field (const double *val, const char *param_name, uint32_t precision)
template<>
bool add_field (const bool *val, const char *param_name)

Static Public Member Functions

static conf_t default_config ()
 Default configuration for the data_logging.

Protected Member Functions

virtual uint32_t max_count (void)=0
 Get maximum number of variables to log.
virtual data_logging_entry_tlist ()=0
 Get list of variables to log.

Detailed Description

Log data in files.

This class is abstract and does not contains the task list, use the child class Data_logging_T


Member Function Documentation

template<typename T >
bool Data_logging::add_field ( const T *  val,
const char *  param_name 
)

Registers parameter to log on the SD card (integer version)

Parameters:
data_loggingThe pointer to the data logging structure
valThe parameter value
param_nameName of the parameter
Template Parameters:
TType of parameter to add
Returns:
True if the parameter was added, false otherwise
template<typename T >
bool Data_logging::add_field ( const T *  val,
const char *  param_name,
uint32_t  precision 
)

Registers parameter to log on the SD card (float and double version)

Parameters:
data_loggingThe pointer to the data logging structure
valThe parameter value
param_nameName of the parameter
precisionThe number of digit after the zero
Template Parameters:
TType of parameter to add (float or double)
Returns:
True if the parameter was added, false otherwise
bool Data_logging::create_new_log_file ( const char *  file_name_,
uint32_t  sysid 
)

Initialise the data logging module.

Parameters:
file_nameThe pointer to name of the file to create
sysidThe system identification number of the MAV
Returns:
True if the init succeed, false otherwise

Here is the caller graph for this function:

static conf_t Data_logging::default_config ( ) [inline, static]

Default configuration for the data_logging.

Returns:
Config structure
virtual data_logging_entry_t* Data_logging::list ( ) [protected, pure virtual]

Get list of variables to log.

Abstract method to be implemented in child classes

Returns:
list

Implemented in Data_logging_T< N >, and Data_logging_T< 10 >.

virtual uint32_t Data_logging::max_count ( void  ) [protected, pure virtual]

Get maximum number of variables to log.

Abstract method to be implemented in child classes

Returns:
Maximum number of variables to log

Implemented in Data_logging_T< N >, and Data_logging_T< 10 >.

bool Data_logging::start ( void  )

Start logging data.

Will succeed only if the MAV is disarmed

Returns:
Success

Here is the call graph for this function:

bool Data_logging::stop ( void  )

Stop logging data.

Will succeed only if the MAV is disarmed

Returns:
Success

Here is the call graph for this function:

bool Data_logging::update ( void  )

The task to log the data to the SD card.

Parameters:
data_loggingThe pointer to the data logging structure
Returns:
The result of the task execution

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines