Incomplete parser
This commit is contained in:
65
igc.h
Normal file
65
igc.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* IGC parser
|
||||
* @brief parse IGC file, get all data points, compute average horizontal/vertical speed, print to STDOUT
|
||||
*
|
||||
* @author xamidev <xamidev@riseup.net>
|
||||
* @license GNU GPL v3
|
||||
*/
|
||||
|
||||
#ifndef IGC_H
|
||||
#define IGC_H
|
||||
|
||||
#define NAME_MAX 256
|
||||
#define TMP_SIZE 8
|
||||
|
||||
void parse_igc_file(FILE* fp);
|
||||
|
||||
enum IGC_RecordType
|
||||
{
|
||||
MANUFACTURER = 'A',
|
||||
METADATA = 'H',
|
||||
EXTENSION = 'I',
|
||||
J_EXTENSION = 'J',
|
||||
DECLARATION = 'C',
|
||||
SATELLITES = 'F',
|
||||
DATAPOINT = 'B',
|
||||
DIFFERENTIAL_GPS = 'D',
|
||||
PILOT_EVENT = 'E',
|
||||
GEN_PURPOSE_PLACEHOLDER = 'K',
|
||||
COMMENT = 'L',
|
||||
SEC_KEY = 'G'
|
||||
};
|
||||
|
||||
enum Cardinals
|
||||
{
|
||||
NORTH = 'N',
|
||||
SOUTH = 'S',
|
||||
EAST = 'E',
|
||||
WEST = 'W'
|
||||
};
|
||||
|
||||
struct Coord
|
||||
{
|
||||
char cardinal;
|
||||
int deg;
|
||||
int min;
|
||||
int sec;
|
||||
};
|
||||
|
||||
struct IGC_DataPoint
|
||||
{
|
||||
// timestamp
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
|
||||
// coordinates
|
||||
struct Coord lat;
|
||||
struct Coord lon;
|
||||
|
||||
// altitude
|
||||
int baro_alt;
|
||||
int gps_alt;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user