mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
#12 Fixing linux build
This commit is contained in:
6
samples/geodetic2ecef/CMakeLists.txt
Normal file
6
samples/geodetic2ecef/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
FILE(GLOB SRC *.cpp)
|
||||
|
||||
ADD_EXECUTABLE(sample_Geodetic2Ecef ${SRC})
|
||||
|
||||
TARGET_LINK_LIBRARIES(sample_Geodetic2Ecef blackmisc blackcore ${QT_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(sample_Geodetic2Ecef PROPERTIES PROJECT_LABEL "Samples - Geodetic to Ecef")
|
||||
51
samples/geodetic2ecef/main.cpp
Normal file
51
samples/geodetic2ecef/main.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QElapsedTimer>
|
||||
#include "blackmisc/debug.h"
|
||||
#include <iostream>
|
||||
|
||||
#include "blackcore/ecef.h"
|
||||
#include "blackcore/vector_geo.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
BlackMisc::CApplicationContext myApplicationContext;
|
||||
|
||||
QElapsedTimer timer;
|
||||
qint64 duration;
|
||||
|
||||
double lat = 27.999999, lon = 86.999999, h = 8820.999999; // Mt Everest
|
||||
|
||||
BlackCore::CEcef mediumvec;
|
||||
BlackCore::CVectorGeo startVec(lat, lon, h);
|
||||
startVec.print();
|
||||
|
||||
cout << std::endl;
|
||||
cout << std::endl;
|
||||
|
||||
BlackCore::CVectorGeo endVec;
|
||||
|
||||
timer.start();
|
||||
mediumvec = startVec.toCartesian();
|
||||
|
||||
duration = timer.nsecsElapsed();
|
||||
|
||||
mediumvec.print();
|
||||
|
||||
cout << std::endl;
|
||||
cout << std::endl;
|
||||
|
||||
cout << "Needed " << duration << " nanoseconds for the calculation!" << std::endl << std::endl;
|
||||
|
||||
timer.restart();
|
||||
endVec = mediumvec.toGeodetic();
|
||||
duration = timer.nsecsElapsed();
|
||||
|
||||
endVec.print();
|
||||
|
||||
cout << "Needed " << duration << " nanoseconds for the calculation!" << std::endl << std::endl;
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
35
samples/geodetic2ecef/sample_geodetic2ecef.pro
Normal file
35
samples/geodetic2ecef/sample_geodetic2ecef.pro
Normal file
@@ -0,0 +1,35 @@
|
||||
QT += core
|
||||
QT -= gui
|
||||
|
||||
TARGET = sample_geo2ecef
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
DEPENDPATH += . ../../src
|
||||
|
||||
INCLUDEPATH += . ../../src
|
||||
|
||||
SOURCES += main.cpp\
|
||||
|
||||
win32-msvc* {
|
||||
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
|
||||
../../lib/blackcore.lib
|
||||
|
||||
LIBS += ../../lib/blackmisc.lib \
|
||||
../../lib/blackcore.lib
|
||||
}
|
||||
|
||||
!win32-msvc* {
|
||||
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
|
||||
../../lib/libblackcore.a
|
||||
|
||||
LIBS += ../../lib/libblackmisc.a \
|
||||
../../lib/libblackcore.a
|
||||
}
|
||||
|
||||
DESTDIR = ../../bin
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user