mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +08:00
Manually merged samples geodetic2ecef and logging due to merge issues
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
FILE(GLOB SRC *.cpp)
|
FILE(GLOB SRC *.cpp)
|
||||||
|
|
||||||
ADD_EXECUTABLE(sample_Geodetic2Ecef ${SRC})
|
ADD_EXECUTABLE(sample_geodetic2ecef ${SRC})
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(sample_Geodetic2Ecef blackmisc blackcore ${QT_LIBRARIES})
|
TARGET_LINK_LIBRARIES(sample_geodetic2ecef blackmisc blackcore ${QT_LIBRARIES})
|
||||||
SET_TARGET_PROPERTIES(sample_Geodetic2Ecef PROPERTIES PROJECT_LABEL "Samples - Geodetic to Ecef")
|
SET_TARGET_PROPERTIES(sample_geodetic2ecef PROPERTIES PROJECT_LABEL "Samples - Geodetic to Ecef")
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include "blackmisc/debug.h"
|
#include "blackmisc/debug.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <conio.h>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#include "blackcore/ecef.h"
|
#include "blackcore/ecef.h"
|
||||||
#include "blackcore/vector_geo.h"
|
#include "blackcore/vector_geo.h"
|
||||||
@@ -15,39 +13,41 @@ int main(int argc, char *argv[])
|
|||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
BlackMisc::CApplicationContext myApplicationContext;
|
BlackMisc::CApplicationContext myApplicationContext;
|
||||||
|
|
||||||
|
BlackMisc::IContext::getInstance().setSingleton(new BlackMisc::CDebug());
|
||||||
|
|
||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
qint64 duration;
|
qint64 duration;
|
||||||
|
|
||||||
double lat = 27.999999, lon = 86.999999, h = 8820.999999; // Mt Everest
|
double lat = 27.999999, lon = 86.999999, h = 8820.999999; // Mt Everest
|
||||||
|
|
||||||
BlackCore::CEcef mediumvec;
|
BlackCore::CEcef mediumvec;
|
||||||
BlackCore::CVectorGeo startVec(lat, lon, h);
|
BlackCore::CVectorGeo startVec(lat, lon, h);
|
||||||
startVec.print();
|
startVec.print();
|
||||||
|
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
|
|
||||||
BlackCore::CVectorGeo endVec;
|
BlackCore::CVectorGeo endVec;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
mediumvec = startVec.toCartesian();
|
mediumvec = startVec.toCartesian();
|
||||||
|
|
||||||
duration = timer.nsecsElapsed();
|
duration = timer.nsecsElapsed();
|
||||||
|
|
||||||
mediumvec.print();
|
mediumvec.print();
|
||||||
|
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
|
|
||||||
cout << "Needed " << duration << " nanoseconds for the calculation!" << std::endl << std::endl;
|
cout << "Needed " << duration << " nanoseconds for the calculation!" << std::endl << std::endl;
|
||||||
|
|
||||||
timer.restart();
|
timer.restart();
|
||||||
endVec = mediumvec.toGeodetic();
|
endVec = mediumvec.toGeodetic();
|
||||||
duration = timer.nsecsElapsed();
|
duration = timer.nsecsElapsed();
|
||||||
|
|
||||||
endVec.print();
|
endVec.print();
|
||||||
|
|
||||||
cout << "Needed " << duration << " nanoseconds for the calculation!" << std::endl << std::endl;
|
cout << "Needed " << duration << " nanoseconds for the calculation!" << std::endl << std::endl;
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,23 +11,14 @@ DEPENDPATH += . ../../src
|
|||||||
|
|
||||||
INCLUDEPATH += . ../../src
|
INCLUDEPATH += . ../../src
|
||||||
|
|
||||||
SOURCES += main.cpp\
|
SOURCES += *.cpp
|
||||||
|
|
||||||
win32-msvc* {
|
LIBS += -L../../lib -lblackcore -lblackmisc
|
||||||
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
|
|
||||||
../../lib/blackcore.lib
|
|
||||||
|
|
||||||
LIBS += ../../lib/blackmisc.lib \
|
win32: PRE_TARGETDEPS += ../../lib/blackmisc.lib \
|
||||||
../../lib/blackcore.lib
|
../../lib/blackcore.lib
|
||||||
}
|
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a \
|
||||||
|
../../lib/libblackcore.a
|
||||||
!win32-msvc* {
|
|
||||||
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
|
|
||||||
../../lib/libblackcore.a
|
|
||||||
|
|
||||||
LIBS += ../../lib/libblackmisc.a \
|
|
||||||
../../lib/libblackcore.a
|
|
||||||
}
|
|
||||||
|
|
||||||
DESTDIR = ../../bin
|
DESTDIR = ../../bin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include "blackmisc/debug.h"
|
#include "blackmisc/debug.h"
|
||||||
|
#include "blackmisc/context.h"
|
||||||
#include "blackcore/constants.h"
|
#include "blackcore/constants.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -9,10 +10,12 @@ int main(int argc, char *argv[])
|
|||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
BlackMisc::CApplicationContext myApplicationContext;
|
BlackMisc::CApplicationContext myApplicationContext;
|
||||||
|
|
||||||
bInfo << "This is a Info log message";
|
BlackMisc::IContext::getInstance().setSingleton(new BlackMisc::CDebug());
|
||||||
bWarning << "This is a bWarning log message";
|
|
||||||
bError << "This is a bError log message";
|
bAppInfo << "This is a Info log message";
|
||||||
bDebug << "This is a bDebug log message";
|
bAppWarning << "This is a bWarning log message";
|
||||||
|
bAppError << "This is a bError log message";
|
||||||
|
bAppDebug << "This is a bDebug log message";
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,22 +8,17 @@ CONFIG += console
|
|||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|
||||||
DEPENDPATH += . ../../src
|
DEPENDPATH += . ../../src
|
||||||
|
|
||||||
INCLUDEPATH += . ../../src
|
INCLUDEPATH += . ../../src
|
||||||
|
|
||||||
SOURCES += main.cpp\
|
SOURCES += *.cpp
|
||||||
|
|
||||||
win32-msvc* {
|
LIBS += -L../../lib -lblackmisc
|
||||||
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
|
|
||||||
|
|
||||||
LIBS += ../../lib/blackmisc.lib \
|
win32: PRE_TARGETDEPS += ../../lib/blackmisc.lib
|
||||||
}
|
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a
|
||||||
|
|
||||||
!win32-msvc* {
|
|
||||||
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
|
|
||||||
|
|
||||||
LIBS += ../../lib/libblackmisc.a \
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DESTDIR = ../../bin
|
DESTDIR = ../../bin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user