diff --git a/samples/Geodetic2Ecef/CMakeLists.txt b/samples/Geodetic2Ecef/CMakeLists.txt index b3afc69b1..0b3848fa2 100644 --- a/samples/Geodetic2Ecef/CMakeLists.txt +++ b/samples/Geodetic2Ecef/CMakeLists.txt @@ -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") \ No newline at end of file +TARGET_LINK_LIBRARIES(sample_geodetic2ecef blackmisc blackcore ${QT_LIBRARIES}) +SET_TARGET_PROPERTIES(sample_geodetic2ecef PROPERTIES PROJECT_LABEL "Samples - Geodetic to Ecef") \ No newline at end of file diff --git a/samples/Geodetic2Ecef/main.cpp b/samples/Geodetic2Ecef/main.cpp index e43891c34..384f4e288 100644 --- a/samples/Geodetic2Ecef/main.cpp +++ b/samples/Geodetic2Ecef/main.cpp @@ -2,8 +2,6 @@ #include #include "blackmisc/debug.h" #include -#include -#include #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(); } diff --git a/samples/Geodetic2Ecef/sample_geodetic2ecef.pro b/samples/Geodetic2Ecef/sample_geodetic2ecef.pro index c3dccb6aa..33ac98235 100644 --- a/samples/Geodetic2Ecef/sample_geodetic2ecef.pro +++ b/samples/Geodetic2Ecef/sample_geodetic2ecef.pro @@ -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 diff --git a/samples/Logging/main.cpp b/samples/Logging/main.cpp index b3f428e77..43ce024a6 100644 --- a/samples/Logging/main.cpp +++ b/samples/Logging/main.cpp @@ -1,5 +1,6 @@ #include #include "blackmisc/debug.h" +#include "blackmisc/context.h" #include "blackcore/constants.h" #include #include @@ -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(); } diff --git a/samples/Logging/sample_logging.pro b/samples/Logging/sample_logging.pro index e542673c1..3afe1dfe7 100644 --- a/samples/Logging/sample_logging.pro +++ b/samples/Logging/sample_logging.pro @@ -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 + +