Anti-Sway Capstone 1.0
|
Data Recording Interface. More...
#include <stdlib.h>
#include <string.h>
#include "matlabfiles.h"
#include "setup.h"
#include "record.h"
Data Structures | |
struct | DataFile_t |
Data File. More... | |
Macros | |
#define | DEFAULT_NUM_FILES 3 |
Default number of Files to remember. | |
#define | DEFAULT_NUM_VALS 10 |
Default number of values for data arrays. | |
#define | DEFAULT_RESIZE_FACTOR 2 |
Default resize factor. | |
Functions | |
static void | DeallocateHelper () |
static int | ReallocateHelper (DataFile_t *f) |
FileID_t | OpenDataFile (char *name, char **entry_names, int num_entries) |
int | RecordData (FileID_t file, double data[], int data_length) |
int | RecordValue (FileID_t file, char *value_name, double value) |
int | SaveDataFiles () |
Variables | |
static DataFile_t * | files = NULL |
The data files this module is handling. | |
static int | num_files = 0 |
The number of files this module is handling. | |
static int | capacity_files = 0 |
The number of files this module can handle. | |
Data Recording Interface.
|
inlinestatic |
Deallocates the entire module
FileID_t OpenDataFile | ( | char * | name, |
char ** | entry_names, | ||
int | num_entries ) |
Opens a data file
name | The name of the file |
entry_names | The name of each entry |
num_entries | The number of entries |
|
inlinestatic |
Reallocates the entry_values for a DataFile_t
f | A pointer to the DataFile_t to resize |
int RecordData | ( | FileID_t | file, |
double | data[], | ||
int | data_length ) |
Records data for each entry
file | The FileID_t to record upon |
data | The array of data to record (in order of the entries) |
data_length | The length of the data array |
int RecordValue | ( | FileID_t | file, |
char * | value_name, | ||
double | value ) |
Records one-time data
file | The FileID_t to record upon |
value_name | The name of the value |
value | The value to record |
int SaveDataFiles | ( | ) |
Records all data into actual files, and closes all files