36 #include "kml/base/file.h"
38 #include "kml/engine.h"
42 #include "airspeedactual.h"
43 #include "attitudeactual.h"
44 #include "homelocation.h"
45 #include "gpsposition.h"
46 #include "positionactual.h"
47 #include "velocityactual.h"
49 using namespace kmldom;
68 explicit KmlExport(QString inputFileName, QString outputFileName);
69 qint64 bytesAvailable()
const;
74 bool preparseLogFile();
86 void replayFinished();
97 AirspeedActual *airspeedActual;
98 AttitudeActual *attitudeActual;
99 GPSPosition *gpsPosition;
100 HomeLocation *homeLocation;
101 PositionActual *positionActual;
102 VelocityActual *velocityActual;
104 GPSPosition::DataFields gpsPositionData;
105 HomeLocation::DataFields homeLocationData;
107 DocumentPtr document;
108 FolderPtr trackFolder;
109 FolderPtr timestampFolder;
112 QString outputFileName;
115 quint32 lastPlacemarkTime;
116 QString informationString;
117 QVector<CoordinatesPtr> wallAxes;
118 static QString dateTimeFormat;
121 StylePtr createGroundTrackStyle();
122 StyleMapPtr createWallAxesStyle();
123 StyleMapPtr createCustomBalloonStyle();
124 PlacemarkPtr CreateLineStringPlacemark(
const LLAVCoordinates &startPoint,
126 quint32 newPlacemarkTime);
127 PlacemarkPtr createTimespanPlacemark(
const LLAVCoordinates &point, quint32 lastPlacemarkTime,
128 quint32 newPlacemarkTime);
130 kmlbase::Color32 mapVelocity2Color(
double velocity, quint8 alpha = 255);
134 #define COLORMAP_JET \
136 { 0, 0, 0.5156 }, { 0, 0, 0.5312 }, { 0, 0, 0.5469 }, { 0, 0, 0.5625 }, { 0, 0, 0.5781 }, \
137 { 0, 0, 0.5938 }, { 0, 0, 0.6094 }, { 0, 0, 0.6250 }, { 0, 0, 0.6406 }, \
138 { 0, 0, 0.6562 }, { 0, 0, 0.6719 }, { 0, 0, 0.6875 }, { 0, 0, 0.7031 }, \
139 { 0, 0, 0.7188 }, { 0, 0, 0.7344 }, { 0, 0, 0.7500 }, { 0, 0, 0.7656 }, \
140 { 0, 0, 0.7812 }, { 0, 0, 0.7969 }, { 0, 0, 0.8125 }, { 0, 0, 0.8281 }, \
141 { 0, 0, 0.8438 }, { 0, 0, 0.8594 }, { 0, 0, 0.8750 }, { 0, 0, 0.8906 }, \
142 { 0, 0, 0.9062 }, { 0, 0, 0.9219 }, { 0, 0, 0.9375 }, { 0, 0, 0.9531 }, \
143 { 0, 0, 0.9688 }, { 0, 0, 0.9844 }, { 0, 0, 1.0000 }, { 0, 0.0156, 1.0000 }, \
144 { 0, 0.0312, 1.0000 }, { 0, 0.0469, 1.0000 }, { 0, 0.0625, 1.0000 }, \
145 { 0, 0.0781, 1.0000 }, { 0, 0.0938, 1.0000 }, { 0, 0.1094, 1.0000 }, \
146 { 0, 0.1250, 1.0000 }, { 0, 0.1406, 1.0000 }, { 0, 0.1562, 1.0000 }, \
147 { 0, 0.1719, 1.0000 }, { 0, 0.1875, 1.0000 }, { 0, 0.2031, 1.0000 }, \
148 { 0, 0.2188, 1.0000 }, { 0, 0.2344, 1.0000 }, { 0, 0.2500, 1.0000 }, \
149 { 0, 0.2656, 1.0000 }, { 0, 0.2812, 1.0000 }, { 0, 0.2969, 1.0000 }, \
150 { 0, 0.3125, 1.0000 }, { 0, 0.3281, 1.0000 }, { 0, 0.3438, 1.0000 }, \
151 { 0, 0.3594, 1.0000 }, { 0, 0.3750, 1.0000 }, { 0, 0.3906, 1.0000 }, \
152 { 0, 0.4062, 1.0000 }, { 0, 0.4219, 1.0000 }, { 0, 0.4375, 1.0000 }, \
153 { 0, 0.4531, 1.0000 }, { 0, 0.4688, 1.0000 }, { 0, 0.4844, 1.0000 }, \
154 { 0, 0.5000, 1.0000 }, { 0, 0.5156, 1.0000 }, { 0, 0.5312, 1.0000 }, \
155 { 0, 0.5469, 1.0000 }, { 0, 0.5625, 1.0000 }, { 0, 0.5781, 1.0000 }, \
156 { 0, 0.5938, 1.0000 }, { 0, 0.6094, 1.0000 }, { 0, 0.6250, 1.0000 }, \
157 { 0, 0.6406, 1.0000 }, { 0, 0.6562, 1.0000 }, { 0, 0.6719, 1.0000 }, \
158 { 0, 0.6875, 1.0000 }, { 0, 0.7031, 1.0000 }, { 0, 0.7188, 1.0000 }, \
159 { 0, 0.7344, 1.0000 }, { 0, 0.7500, 1.0000 }, { 0, 0.7656, 1.0000 }, \
160 { 0, 0.7812, 1.0000 }, { 0, 0.7969, 1.0000 }, { 0, 0.8125, 1.0000 }, \
161 { 0, 0.8281, 1.0000 }, { 0, 0.8438, 1.0000 }, { 0, 0.8594, 1.0000 }, \
162 { 0, 0.8750, 1.0000 }, { 0, 0.8906, 1.0000 }, { 0, 0.9062, 1.0000 }, \
163 { 0, 0.9219, 1.0000 }, { 0, 0.9375, 1.0000 }, { 0, 0.9531, 1.0000 }, \
164 { 0, 0.9688, 1.0000 }, { 0, 0.9844, 1.0000 }, { 0, 1.0000, 1.0000 }, \
165 { 0.0156, 1.0000, 0.9844 }, { 0.0312, 1.0000, 0.9688 }, { 0.0469, 1.0000, 0.9531 }, \
166 { 0.0625, 1.0000, 0.9375 }, { 0.0781, 1.0000, 0.9219 }, { 0.0938, 1.0000, 0.9062 }, \
167 { 0.1094, 1.0000, 0.8906 }, { 0.1250, 1.0000, 0.8750 }, { 0.1406, 1.0000, 0.8594 }, \
168 { 0.1562, 1.0000, 0.8438 }, { 0.1719, 1.0000, 0.8281 }, { 0.1875, 1.0000, 0.8125 }, \
169 { 0.2031, 1.0000, 0.7969 }, { 0.2188, 1.0000, 0.7812 }, { 0.2344, 1.0000, 0.7656 }, \
170 { 0.2500, 1.0000, 0.7500 }, { 0.2656, 1.0000, 0.7344 }, { 0.2812, 1.0000, 0.7188 }, \
171 { 0.2969, 1.0000, 0.7031 }, { 0.3125, 1.0000, 0.6875 }, { 0.3281, 1.0000, 0.6719 }, \
172 { 0.3438, 1.0000, 0.6562 }, { 0.3594, 1.0000, 0.6406 }, { 0.3750, 1.0000, 0.6250 }, \
173 { 0.3906, 1.0000, 0.6094 }, { 0.4062, 1.0000, 0.5938 }, { 0.4219, 1.0000, 0.5781 }, \
174 { 0.4375, 1.0000, 0.5625 }, { 0.4531, 1.0000, 0.5469 }, { 0.4688, 1.0000, 0.5312 }, \
175 { 0.4844, 1.0000, 0.5156 }, { 0.5000, 1.0000, 0.5000 }, { 0.5156, 1.0000, 0.4844 }, \
176 { 0.5312, 1.0000, 0.4688 }, { 0.5469, 1.0000, 0.4531 }, { 0.5625, 1.0000, 0.4375 }, \
177 { 0.5781, 1.0000, 0.4219 }, { 0.5938, 1.0000, 0.4062 }, { 0.6094, 1.0000, 0.3906 }, \
178 { 0.6250, 1.0000, 0.3750 }, { 0.6406, 1.0000, 0.3594 }, { 0.6562, 1.0000, 0.3438 }, \
179 { 0.6719, 1.0000, 0.3281 }, { 0.6875, 1.0000, 0.3125 }, { 0.7031, 1.0000, 0.2969 }, \
180 { 0.7188, 1.0000, 0.2812 }, { 0.7344, 1.0000, 0.2656 }, { 0.7500, 1.0000, 0.2500 }, \
181 { 0.7656, 1.0000, 0.2344 }, { 0.7812, 1.0000, 0.2188 }, { 0.7969, 1.0000, 0.2031 }, \
182 { 0.8125, 1.0000, 0.1875 }, { 0.8281, 1.0000, 0.1719 }, { 0.8438, 1.0000, 0.1562 }, \
183 { 0.8594, 1.0000, 0.1406 }, { 0.8750, 1.0000, 0.1250 }, { 0.8906, 1.0000, 0.1094 }, \
184 { 0.9062, 1.0000, 0.0938 }, { 0.9219, 1.0000, 0.0781 }, { 0.9375, 1.0000, 0.0625 }, \
185 { 0.9531, 1.0000, 0.0469 }, { 0.9688, 1.0000, 0.0312 }, { 0.9844, 1.0000, 0.0156 }, \
186 { 1.0000, 1.0000, 0 }, { 1.0000, 0.9844, 0 }, { 1.0000, 0.9688, 0 }, \
187 { 1.0000, 0.9531, 0 }, { 1.0000, 0.9375, 0 }, { 1.0000, 0.9219, 0 }, \
188 { 1.0000, 0.9062, 0 }, { 1.0000, 0.8906, 0 }, { 1.0000, 0.8750, 0 }, \
189 { 1.0000, 0.8594, 0 }, { 1.0000, 0.8438, 0 }, { 1.0000, 0.8281, 0 }, \
190 { 1.0000, 0.8125, 0 }, { 1.0000, 0.7969, 0 }, { 1.0000, 0.7812, 0 }, \
191 { 1.0000, 0.7656, 0 }, { 1.0000, 0.7500, 0 }, { 1.0000, 0.7344, 0 }, \
192 { 1.0000, 0.7188, 0 }, { 1.0000, 0.7031, 0 }, { 1.0000, 0.6875, 0 }, \
193 { 1.0000, 0.6719, 0 }, { 1.0000, 0.6562, 0 }, { 1.0000, 0.6406, 0 }, \
194 { 1.0000, 0.6250, 0 }, { 1.0000, 0.6094, 0 }, { 1.0000, 0.5938, 0 }, \
195 { 1.0000, 0.5781, 0 }, { 1.0000, 0.5625, 0 }, { 1.0000, 0.5469, 0 }, \
196 { 1.0000, 0.5312, 0 }, { 1.0000, 0.5156, 0 }, { 1.0000, 0.5000, 0 }, \
197 { 1.0000, 0.4844, 0 }, { 1.0000, 0.4688, 0 }, { 1.0000, 0.4531, 0 }, \
198 { 1.0000, 0.4375, 0 }, { 1.0000, 0.4219, 0 }, { 1.0000, 0.4062, 0 }, \
199 { 1.0000, 0.3906, 0 }, { 1.0000, 0.3750, 0 }, { 1.0000, 0.3594, 0 }, \
200 { 1.0000, 0.3438, 0 }, { 1.0000, 0.3281, 0 }, { 1.0000, 0.3125, 0 }, \
201 { 1.0000, 0.2969, 0 }, { 1.0000, 0.2812, 0 }, { 1.0000, 0.2656, 0 }, \
202 { 1.0000, 0.2500, 0 }, { 1.0000, 0.2344, 0 }, { 1.0000, 0.2188, 0 }, \
203 { 1.0000, 0.2031, 0 }, { 1.0000, 0.1875, 0 }, { 1.0000, 0.1719, 0 }, \
204 { 1.0000, 0.1562, 0 }, { 1.0000, 0.1406, 0 }, { 1.0000, 0.1250, 0 }, \
205 { 1.0000, 0.1094, 0 }, { 1.0000, 0.0938, 0 }, { 1.0000, 0.0781, 0 }, \
206 { 1.0000, 0.0625, 0 }, { 1.0000, 0.0469, 0 }, { 1.0000, 0.0312, 0 }, \
207 { 1.0000, 0.0156, 0 }, { 1.0000, 0, 0 }, { 0.9844, 0, 0 }, { 0.9688, 0, 0 }, \
208 { 0.9531, 0, 0 }, { 0.9375, 0, 0 }, { 0.9219, 0, 0 }, { 0.9062, 0, 0 }, \
209 { 0.8906, 0, 0 }, { 0.8750, 0, 0 }, { 0.8594, 0, 0 }, { 0.8438, 0, 0 }, \
210 { 0.8281, 0, 0 }, { 0.8125, 0, 0 }, { 0.7969, 0, 0 }, { 0.7812, 0, 0 }, \
211 { 0.7656, 0, 0 }, { 0.7500, 0, 0 }, { 0.7344, 0, 0 }, { 0.7188, 0, 0 }, \
212 { 0.7031, 0, 0 }, { 0.6875, 0, 0 }, { 0.6719, 0, 0 }, { 0.6562, 0, 0 }, \
213 { 0.6406, 0, 0 }, { 0.6250, 0, 0 }, { 0.6094, 0, 0 }, { 0.5938, 0, 0 }, \
214 { 0.5781, 0, 0 }, { 0.5625, 0, 0 }, { 0.5469, 0, 0 }, { 0.5312, 0, 0 }, \
221 #endif // KMLEXPORT_H
void setFileName(QString name)