|
SBB Host
Host communication with the self balancing bike.
|
A templated-class for managing logged-data. More...
#include <LogData.h>
Public Member Functions | |
| LogData (std::string str_name, std::string str_path, std::vector< std::string > signal_names, int ID, size_t num_of_signals, size_t num_of_samples, Time *p_time=nullptr, std::string theAuthor="unknown") | |
| Constructor. More... | |
| ~LogData () | |
| Destructor. More... | |
| T | get (int i, int j) |
| Get a single sample of a signal. More... | |
| std::vector< T > | get (int i) |
| Get all samples of a signal. More... | |
| int | push_back (T *packet) |
| Push data to the log buffer. More... | |
| std::string | getAuthor () |
| Get author name. More... | |
| std::string | getDate () |
| Get the date. More... | |
| size_t | save (File *p_file) |
| Save the log. More... | |
Public Attributes | |
| size_t | num_samples |
| Number of logged samples. More... | |
| size_t | num_signals |
| Number of logged signals. More... | |
| size_t | max_num_samples |
| Max number of logged samples (reserved for vectors). More... | |
| std::vector< std::vector< T > > | data |
| Vector of vector of type T (i.e. a matrix with num_signals rows and max_num_samples columns) More... | |
| std::vector< size_t > | samples |
| Vector of samples. More... | |
| std::vector< std::string > | signals |
| Vector of signal names. More... | |
| std::string | name |
| Name of the log. More... | |
| std::string | path |
| Path of the corresponding log file. More... | |
| std::string | author |
| Author of the log. More... | |
| Time * | time |
| Variable to store the initial time. More... | |
| int | id = -1 |
| ID of the log. More... | |
| bool | saved |
| True if the log has been saved. More... | |
A templated-class for managing logged-data.
Templated-class for managing logged-data with used-defined type, used in SBBHostCore.
| T | The base type of the packet. |
|
inline |
Constructor.
Default constructor of the logged data.
| str_name | Th name of the logged data. |
| str_path | The path of the corresponding file (if any). |
| signal_names | The vector of signal names. |
| ID | The ID of the log. |
| num_of_signals | The number of signals of the log. |
| num_of_samples | The number of samples of the log. |
Destructor.
Default destructor. It clears the logged data.
|
inline |
Get all samples of a signal.
Function to get all samples of a given signal.
| i | The index of the signal. |
|
inline |
Get a single sample of a signal.
Function to get a single sample of a given signal.
| i | The index of the signal. |
| j | The index of the sample. |
|
inline |
Get author name.
Function to get the author of the log.
|
inline |
Get the date.
Function to get the creation date and time of the log.
|
inline |
Push data to the log buffer.
Function to push data to the log buffer.
| packet | The pointer to the signal packet to pust |
Save the log.
Function to save the log to a file. The file must be open before. The file is not closed after the saving.
| p_file | The pointer to the File object. |
| std::string LogData< T >::author |
Author of the log.
| std::vector<std::vector<T> > LogData< T >::data |
Vector of vector of type T (i.e. a matrix with num_signals rows and max_num_samples columns)
| int LogData< T >::id = -1 |
ID of the log.
| size_t LogData< T >::max_num_samples |
Max number of logged samples (reserved for vectors).
| std::string LogData< T >::name |
Name of the log.
| size_t LogData< T >::num_samples |
Number of logged samples.
| size_t LogData< T >::num_signals |
Number of logged signals.
| std::string LogData< T >::path |
Path of the corresponding log file.
| std::vector<size_t> LogData< T >::samples |
Vector of samples.
| bool LogData< T >::saved |
True if the log has been saved.
| std::vector<std::string> LogData< T >::signals |
Vector of signal names.