4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #if !defined(XCSOAR_LOGGER_IMPL_HPP)
25 #define XCSOAR_LOGGER_IMPL_HPP
27 #include "LoggerFRecord.hpp"
28 #include "Time/BrokenDateTime.hpp"
29 #include "Geo/GeoPoint.hpp"
30 #include "Util/OverwritingRingBuffer.hpp"
36 struct LoggerSettings
;
42 * Implementation of logger
48 /** Buffer size (s) of points recorded before takeoff */
49 PRETAKEOFF_BUFFER_MAX
= 60,
52 /** Buffer for points recorded before takeoff */
53 struct PreTakeoffBuffer
55 /** Location of fix */
57 /** Barometric altitude (m STD) */
58 fixed pressure_altitude
;
59 /** GPS Altitude (m) */
61 /** Date and time of fix */
62 BrokenDateTime date_time_utc
;
63 /** IDs of satellites in fix */
64 int satellite_ids
[GPSState::MAXSATELLITES
];
65 bool satellite_ids_available
;
66 /** Time of fix (s) */
68 /** GPS fix quality */
69 FixQuality fix_quality
;
72 bool satellites_used_available
;
73 /** GPS Horizontal Dilution of precision */
77 * Is the fix real? (no replay, no simulator)
81 bool pressure_altitude_available
;
82 bool gps_altitude_available
;
85 * Set buffer value from NMEA_INFO structure
87 * @param src Item to set
89 * @return Buffer value
91 const struct PreTakeoffBuffer
&operator=(const NMEAInfo
&src
);
95 TCHAR filename
[MAX_PATH
];
98 OverwritingRingBuffer
<PreTakeoffBuffer
, PRETAKEOFF_BUFFER_MAX
> pre_takeoff_buffer
;
100 LoggerFRecord frecord
;
103 * If at least one GPS fix came from the simulator
104 * (NMEA_INFO.Simulator), then this flag is true, and signing is
110 /** Default constructor */
115 void LogPoint(const NMEAInfo
&gps_info
);
116 void LogEvent(const NMEAInfo
&gps_info
, const char* event
);
118 bool IsActive() const {
119 return writer
!= NULL
;
122 void StartLogger(const NMEAInfo
&gps_info
, const LoggerSettings
&settings
,
123 const TCHAR
*asset_number
, const Declaration
&decl
);
127 * @param gps_info NMEA_INFO struct holding the current date
129 void StopLogger(const NMEAInfo
&gps_info
);
130 void LoggerNote(const TCHAR
*text
);
135 * @param logger_id the ID of the logger, consisting of exactly 3
136 * alphanumeric characters (plain ASCII)
138 void StartLogger(const NMEAInfo
&gps_info
, const LoggerSettings
&settings
,
139 const char *logger_id
);
142 void LogPointToBuffer(const NMEAInfo
&gps_info
);
143 void WritePoint(const NMEAInfo
&gps_info
);