Rleg  2
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
gdatalogger.h
Go to the documentation of this file.
1 /*****************************************************************************
2 // File: GDataLogger.h
3 // Contents: Header for GDataLogger functions.
4 // Author: G. A. Borges.
5 *****************************************************************************/
6 #ifndef GDATALOGGER_H
7 #define GDATALOGGER_H
8 
9 #ifdef __cplusplus
10  extern "C" {
11 #endif
12 
13 #define GDATALOGGER_MAXVARIABLES 150
14 
15 typedef struct{
16  char VariableName[100];
17  char VariableUnit[50];
19  int Nr;
20  int Nc;
21  double *CircularQueue;
25 
26 typedef struct{
31 
32 #define QUEUE_MAXDESTINATIONS 4
33 #define QUEUE_DESTINATION_FILE QUEUE_READ_GATE_0
34 #define QUEUE_DESTINATION_IPC QUEUE_READ_GATE_1
35 #define QUEUE_DESTINATION_USER1 QUEUE_READ_GATE_2
36 #define QUEUE_DESTINATION_USER2 QUEUE_READ_GATE_3
37 
38 #define GDATALOGGER_IPC_MAXQUEUESIZE 1000
39 #define GDATALOGGER_IPC_FLAGIDDLE 0
40 #define GDATALOGGER_IPC_FLAGREQUESTDATA 1
41 #define GDATALOGGER_IPC_FLAGDATAAVAILABLE 2
42 #define GDATALOGGER_IPC_FLAGNOTEXIST 3
43 #define GDATALOGGER_IPC_FLAGTIMEOUT 4
44 
45 typedef struct {
46  char VariableName[100];
47  char VariableUnit[50];
48  double QueueData[GDATALOGGER_IPC_MAXQUEUESIZE];
49  int QueueSize;
50  int Flag;
52 
53 #if DATALOGGER_COMPILE_FOR_XENOMAI
54  #define GDATALOGGER_IPC_STATEFILE "gdataloggershm"
55 #else
56  #define GDATALOGGER_IPC_STATEFILE "/gdatalogger.shm"
57 #endif
58 
59 int gDataLogger_Init(PGDATALOGGER pgDataLogger, char *filename, char *dirname);
60 int gDataLogger_DeclareVariable(PGDATALOGGER pgDataLogger, char *varname, char *varunit, int nrows, int ncols, int queuesize);
61 int gDataLogger_InsertVariable(PGDATALOGGER pgDataLogger, char *varname, double *varvalue);
62 int gDataLogger_IPC_RetrieveVariable(char *varname, char *varunit, double *pbuffer, int *bufferlen);
63 int gDataLogger_MatfileUpdate(PGDATALOGGER pgDataLogger);
64 int gDataLogger_IPCUpdate(PGDATALOGGER pgDataLogger);
65 int gDataLogger_Close(PGDATALOGGER pgDataLogger);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* GDATALOGGER_H */
int gDataLogger_IPC_RetrieveVariable(char *varname, char *varunit, double *pbuffer, int *bufferlen)
Definition: gdatalogger.c:319
#define GDATALOGGER_IPC_MAXQUEUESIZE
Definition: gdatalogger.h:38
int gDataLogger_MatfileUpdate(PGDATALOGGER pgDataLogger)
Definition: gdatalogger.c:245
GQUEUECONTROL CircularQueueControl
Definition: gdatalogger.h:22
double * CircularQueue
Definition: gdatalogger.h:21
GMATLABDATAFILECONFIG GMatlabDataFileConfig
Definition: gdatalogger.h:29
struct GDATALOGGER * PGDATALOGGER
long int GMatlabDataFileIndex
Definition: gdatalogger.h:18
int gDataLogger_Init(PGDATALOGGER pgDataLogger, char *filename, char *dirname)
Definition: gdatalogger.c:42
int m_NumberOfVariables
Definition: gdatalogger.h:28
#define GDATALOGGER_MAXVARIABLES
Definition: gdatalogger.h:13
int gDataLogger_Close(PGDATALOGGER pgDataLogger)
Definition: gdatalogger.c:362
struct GDATALOGGERVARIABLE * PGDATALOGGERVARIABLE
int gDataLogger_InsertVariable(PGDATALOGGER pgDataLogger, char *varname, double *varvalue)
Definition: gdatalogger.c:199
int gDataLogger_DeclareVariable(PGDATALOGGER pgDataLogger, char *varname, char *varunit, int nrows, int ncols, int queuesize)
Definition: gdatalogger.c:173
int gDataLogger_IPCUpdate(PGDATALOGGER pgDataLogger)
Definition: gdatalogger.c:274