-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatLabXRK.h
313 lines (270 loc) · 12.7 KB
/
MatLabXRK.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
#ifndef SIMPLEH_H
#define SIMPLEH_H
#include "helper.h"
#ifdef __cplusplus
extern "C" {
#endif
//! Get the compile date of this library
/*!
\return the compile date
*/
EXPORTED_FUNCTION char const* get_library_date();
//! Get the compile time of this library
/*!
\return the compile time
*/
EXPORTED_FUNCTION char const* get_library_time();
//! Open a xrk file
/*!
\param full_path_name full path to the file to be opened, it cannot be a relative path
\return > 0 in case of success the internal index of the file opened, 0 in case the file is opened but can't be parsed, < 0 in case of problems
*/
EXPORTED_FUNCTION int open_file(char const* full_path_name);
//! Close a xrk file
/*!
\param full_path_name full path to the file to be closed, it cannot be a relative path
\return > 0 the internal index of the file closed, < 0 in case of problems
*/
EXPORTED_FUNCTION int close_file_n(char const* full_path_name);
//! Close a xrk file
/*!
\param idx the internal file index returned by open function
\return > 0 the internal index of the file closed, < 0 in case of problems
*/
EXPORTED_FUNCTION int close_file_i(int idx);
//! Get vehicle info
/*!
\param idx the internal file index returned by open function
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_vehicle_name(int idx);
//! Get track info
/*!
\param idx the internal file index returned by open function
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_track_name(int idx);
//! Get racer info
/*!
\param idx the internal file index returned by open function
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_racer_name(int idx);
//! Get championship info
/*!
\param idx the internal file index returned by open function
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_championship_name(int idx);
//! Get venue type info
/*!
\param idx the internal file index returned by open function
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_venue_type_name(int idx);
//! Get session date and time
/*!
\param idx the internal file index returned by open function
\return a struct tm pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION struct tm const* get_date_and_time(int idx);
//! Get laps count of a xrk file
/*!
\param idx the internal file index returned by open function
\return > 0 the laps count, < 0 in case of problems, 0 in case the xrk file has no laps (theorically not possible)
*/
EXPORTED_FUNCTION int get_laps_count(int idx);
/*!
Laps information functions
*/
//! Get lap info
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param pstart pointer to an already allocated double in which the start time of the lap will be stored
\param pduration pointer to an already allocated double in which the lap duration will be stored
\return 1 if all is OK, < 0 in case of problems, 0 in case the xrk file has no laps (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_info(int idxf, int idxl, double* pstart, double* pduration);
/*!
Channels information functions
*/
//! Get channels count of a xrk file
/*!
\param idx the internal file index returned by open function
\return > 0 the channel count, < 0 in case of problems, 0 in case the xrk file has no channels (theorically not possible)
*/
EXPORTED_FUNCTION int get_channels_count(int idx);
//! Get channel name
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_channel_name(int idxf, int idxc);
//! Get channel units
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_channel_units(int idxf, int idxc);
//! Get channel samples count
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return > 0 the samples count, < 0 in case of problems, 0 in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_channel_samples_count(int idxf, int idxc);
//! Get channel samples
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\param ptimes pointer to an already allocated buffer in which sample times will be stored
\param pvalues pointer to an already allocated buffer in which sample values will be stored
\param cnt the number of samples of the buffer, that is the samples count returned by get channel samples count function
\return > 0 the samples count, < 0 in case of problems, 0 in case the cnt param doesn't match the samples count or in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_channel_samples(int idxf, int idxc, double* ptimes, double* pvalues, int cnt);
//! Get channel samples count in a given lap
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param idxc the channel index
\return > 0 the samples count, < 0 in case of problems, 0 in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_channel_samples_count(int idxf, int idxl, int idxc);
//! Get channel samples in a given lap
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param idxc the channel index
\param ptimes pointer to an already allocated buffer in which sample times will be stored
\param pvalues pointer to an already allocated buffer in which sample values will be stored
\param cnt the number of samples of the buffer, that is the samples count returned by get channel samples count function
\return > 0 the samples count, < 0 in case of problems, 0 in case the cnt param doesn't match the samples count or in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_channel_samples(int idxf, int idxl, int idxc, double* ptimes, double* pvalues, int cnt);
/*!
GPS channels information functions, where GPS channels are the same channels added to AiM drk files in RS2Analysis,
those that consider vehicle dynamics assuming that the vehicle is constantly aligned to the trajectory.
*/
//! Get GPS channels count of a xrk file
/*!
\param idx the internal file index returned by open function
\return > 0 the channel count, < 0 in case of problems, 0 in case the xrk file has no channels (theorically not possible)
*/
EXPORTED_FUNCTION int get_GPS_channels_count(int idx);
//! Get GPS channel name
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_GPS_channel_name(int idxf, int idxc);
//! Get GPS channel units
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_GPS_channel_units(int idxf, int idxc);
//! Get GPS channel samples count
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return > 0 the samples count, < 0 in case of problems, 0 in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_GPS_channel_samples_count(int idxf, int idxc);
//! Get GPS channel samples
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\param ptimes pointer to an already allocated buffer in which sample times will be stored
\param pvalues pointer to an already allocated buffer in which sample values will be stored
\param cnt the number of samples of the buffer, that is the samples count returned by get channel samples count function
\return > 0 the samples count, < 0 in case of problems, 0 in case the cnt param doesn't match the samples count or in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_GPS_channel_samples(int idxf, int idxc, double* ptimes, double* pvalues, int cnt);
//! Get GPS channel samples count in a given lap
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param idxc the channel index
\return > 0 the samples count, < 0 in case of problems, 0 in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_GPS_channel_samples_count(int idxf, int idxl, int idxc);
//! Get GPS channel samples in a given lap
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param idxc the channel index
\param ptimes pointer to an already allocated buffer in which sample times will be stored
\param pvalues pointer to an already allocated buffer in which sample values will be stored
\param cnt the number of samples of the buffer, that is the samples count returned by get channel samples count function
\return > 0 the samples count, < 0 in case of problems, 0 in case the cnt param doesn't match the samples count or in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_GPS_channel_samples(int idxf, int idxl, int idxc, double* ptimes, double* pvalues, int cnt);
/*!
GPS raw channels information functions, where GPS raw channels are information in the GPS solution coming directly from the GPS receiver.
*/
//! Get GPS raw channels count of a xrk file
/*!
\param idx the internal file index returned by open function
\return > 0 the channel count, < 0 in case of problems, 0 in case the xrk file has no channels (theorically not possible)
*/
EXPORTED_FUNCTION int get_GPS_raw_channels_count(int idx);
//! Get GPS raw channel name
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_GPS_raw_channel_name(int idxf, int idxc);
//! Get GPS raw channel units
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return a null terminated char pointer with the required info, NULL in case of problems
*/
EXPORTED_FUNCTION char const* get_GPS_raw_channel_units(int idxf, int idxc);
//! Get GPS raw channel samples count
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\return > 0 the samples count, < 0 in case of problems, 0 in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_GPS_raw_channel_samples_count(int idxf, int idxc);
//! Get GPS raw channel samples
/*!
\param idxf the internal file index returned by open function
\param idxc the channel index
\param ptimes pointer to an already allocated buffer in which sample times will be stored
\param pvalues pointer to an already allocated buffer in which sample values will be stored
\param cnt the number of samples of the buffer, that is the samples count returned by get channel samples count function
\return > 0 the samples count, < 0 in case of problems, 0 in case the cnt param doesn't match the samples count or in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_GPS_raw_channel_samples(int idxf, int idxc, double* ptimes, double* pvalues, int cnt);
//! Get GPS raw channel samples count in a given lap
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param idxc the channel index
\return > 0 the samples count, < 0 in case of problems, 0 in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_GPS_raw_channel_samples_count(int idxf, int idxl, int idxc);
//! Get GPS raw channel samples in a given lap
/*!
\param idxf the internal file index returned by open function
\param idxl the lap index
\param idxc the channel index
\param ptimes pointer to an already allocated buffer in which sample times will be stored
\param pvalues pointer to an already allocated buffer in which sample values will be stored
\param cnt the number of samples of the buffer, that is the samples count returned by get channel samples count function
\return > 0 the samples count, < 0 in case of problems, 0 in case the cnt param doesn't match the samples count or in case the channel has no samples (theorically not possible)
*/
EXPORTED_FUNCTION int get_lap_GPS_raw_channel_samples(int idxf, int idxl, int idxc, double* ptimes, double* pvalues, int cnt);
#ifdef __cplusplus
}
#endif
#endif