-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (30 loc) · 1.43 KB
/
main.cpp
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
#include <QCommandLineParser>
#include "BaroCache.h"
auto main(int argc, char *argv[]) -> int
{
QCoreApplication const app(argc, argv);
QCommandLineParser parser;
parser.setApplicationDescription(u"Test for baroCache"_qs);
parser.addHelpOption();
parser.process(app);
#warning Implement. Need to set up a framework for tests here, feeding data into the cache and then trying out how it work.
Navigation::BaroCache baroCache;
QGeoCoordinate* coordinate = new QGeoCoordinate(1.0,1.0,1.0);
QGeoPositionInfo* info = new QGeoPositionInfo(*coordinate, QDateTime::currentDateTime());
for(double height_pressure = 0.0, height_geometric = 0.0; height_pressure <= 5000; height_pressure += 300, height_geometric += 500.0)
{
baroCache.onPressureAltitudeReceived(Units::Distance::fromM(height_pressure));
coordinate = new QGeoCoordinate(0,0,height_geometric);
info = new QGeoPositionInfo(*coordinate, QDateTime::currentDateTime());
// qDebug() << info->coordinate().altitude();
baroCache.onGeometricPositionInfoReceived(*info);
usleep(50000UL);
}
for(double height = 0; height <= 5000; height += 100)
{
baroCache.onPressureAltitudeReceived(Units::Distance::fromM(height));
}
baroCache.printAltitudeList();
qDebug() << "estimated pressure altitude: " << baroCache.estimatedPressureAltitude(Units::Distance::fromM(4660),false).toM();
return 0;
}