Renderer, ...: use PixelRect::GetCenter()
[xcsoar.git] / src / Device / Driver / Volkslogger / vlconv.h
blobf4021a4318d5f6865e11a49b4afb1f33ee4b923b
1 /***********************************************************************
2 **
3 ** vlconv.h
4 **
5 ** This file is part of libkfrgcs.
6 **
7 ************************************************************************
8 **
9 ** Copyright (c): 2002 by Garrecht Ingenieurgesellschaft
11 ** This file is distributed under the terms of the General Public
12 ** Licence. See the file COPYING for more information.
14 ** $Id$
16 ***********************************************************************/
18 #ifndef VLCONV_H
19 #define VLCONV_H
21 #include <stdio.h>
22 #include <stdint.h>
23 #include <time.h>
24 #include <vector>
26 /* Untertypen des Haupttyps Variabel */
27 #define FLDPLT 0x01
28 #define FLDPLT1 0x01
29 #define FLDPLT2 0x02
30 #define FLDPLT3 0x03
31 #define FLDPLT4 0x04
32 #define FLDGTY 0x05
33 #define FLDGID 0x06
34 #define FLDCID 0x07
35 #define FLDCCL 0x08
36 #define FLDTZN 0x09
38 #define FLDNTP 0x10
39 #define FLDFDT 0x11
40 #define FLDTID 0x12
41 #define FLDTKF 0x20
42 #define FLDSTA 0x21
43 #define FLDFIN 0x22
44 #define FLDLDG 0x23
45 // Landing gibts nicht
46 #define FLDTP1 0x31
47 #define FLDTP2 0x32
48 #define FLDTP3 0x33
49 #define FLDTP4 0x34
50 #define FLDTP5 0x35
51 #define FLDTP6 0x36
52 #define FLDTP7 0x37
53 #define FLDTP8 0x38
54 #define FLDTP9 0x39
55 #define FLDTP10 0x3a
56 #define FLDTP11 0x3b
57 #define FLDTP12 0x3c
59 #define FLDHDR 0x50
60 #define FLDEPEV 0x60
61 #define FLDETKF 0x61
64 /**
65 convert_gcs
66 function:
67 converts a given flight log from VOLKSLOGGER binary to IGC-format
68 input values:
69 converter version
70 output stream handle
71 pointer to binary file buffer
72 OO-fillin
73 serial-number (reference)
74 position of signature in binary file (reference)
77 * @return the length of the output file or 0 on error
79 size_t
80 convert_gcs(int igcfile_version, FILE *Ausgabedatei,
81 const uint8_t *const bin_puffer, size_t length,
82 bool oo_fillin);
86 DIRENTRY
87 descriptive information about each single flight log in the VL
89 struct DIRENTRY {
90 unsigned int serno; // FR serial number
91 tm firsttime; // time of first fix
92 tm lasttime; // time of last fix
93 long recordingtime; // length of trace in seconds
94 int takeoff; // set to one if VL has detected a takeoff
95 // (v>10kt) inside this trace
96 char pilot[65]; // flight-info, can be enhanced by all
97 char competitionid[4]; // headerfields, but these here might be
98 char gliderid[8]; // enough
102 * Converts binary flight list (called directory) data to a vector of
103 * logs. Each log entry of type DIRENTRY. This vector is returned through
104 * reference parameter &flights.
105 * The functions returns true if conversion was successful.
106 * @param flights Vector to return the read flights.
107 * @param src Pointer to the buffer containing the binary input data.
108 * @param length The length of the data stored in buffer.
111 bool
112 conv_dir(std::vector<DIRENTRY> &flights,
113 const uint8_t *src, size_t length);
115 #endif