Manually merged samples geodetic2ecef and logging due to merge issues

This commit is contained in:
Klaus Basan
2013-04-24 13:12:57 +02:00
parent 472521f281
commit 54d031a479
5 changed files with 55 additions and 66 deletions

View File

@@ -1,6 +1,6 @@
FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(sample_Geodetic2Ecef ${SRC})
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")
TARGET_LINK_LIBRARIES(sample_geodetic2ecef blackmisc blackcore ${QT_LIBRARIES})
SET_TARGET_PROPERTIES(sample_geodetic2ecef PROPERTIES PROJECT_LABEL "Samples - Geodetic to Ecef")

View File

@@ -2,8 +2,6 @@
#include <QElapsedTimer>
#include "blackmisc/debug.h"
#include <iostream>
#include <conio.h>
#include <windows.h>
#include "blackcore/ecef.h"
#include "blackcore/vector_geo.h"
@@ -14,40 +12,42 @@ int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
BlackMisc::CApplicationContext myApplicationContext;
BlackMisc::IContext::getInstance().setSingleton(new BlackMisc::CDebug());
QElapsedTimer timer;
qint64 duration;
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;
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;
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();
}

View File

@@ -11,23 +11,14 @@ DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
SOURCES += *.cpp
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
LIBS += -L../../lib -lblackcore -lblackmisc
LIBS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
LIBS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
}
win32: PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
DESTDIR = ../../bin

View File

@@ -1,5 +1,6 @@
#include <QCoreApplication>
#include "blackmisc/debug.h"
#include "blackmisc/context.h"
#include "blackcore/constants.h"
#include <limits>
#include <iostream>
@@ -9,10 +10,12 @@ int main(int argc, char *argv[])
QCoreApplication a(argc, argv);
BlackMisc::CApplicationContext myApplicationContext;
bInfo << "This is a Info log message";
bWarning << "This is a bWarning log message";
bError << "This is a bError log message";
bDebug << "This is a bDebug log message";
BlackMisc::IContext::getInstance().setSingleton(new BlackMisc::CDebug());
bAppInfo << "This is a Info 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();
}

View File

@@ -8,22 +8,17 @@ CONFIG += console
CONFIG -= app_bundle
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
SOURCES += *.cpp
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
LIBS += -L../../lib -lblackmisc
LIBS += ../../lib/blackmisc.lib \
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
LIBS += ../../lib/libblackmisc.a \
}
win32: PRE_TARGETDEPS += ../../lib/blackmisc.lib
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a
DESTDIR = ../../bin