From 243b4ecc395372672d1d668da33182f10cc6cd97 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Feb 2018 01:10:27 +0100 Subject: [PATCH] Give priority to RINEX_printer flag over configuration file. Fix building. --- src/algorithms/PVT/adapters/CMakeLists.txt | 1 + src/algorithms/PVT/adapters/rtklib_pvt.cc | 25 +++++++++-- src/algorithms/PVT/libs/rinex_printer.cc | 43 +------------------ .../channel/adapters/CMakeLists.txt | 3 +- 4 files changed, 26 insertions(+), 46 deletions(-) diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index baf58e507..71568cf88 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -28,6 +28,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/algorithms/libs ${ARMADILLO_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index c21303ab3..967109d53 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -36,7 +36,7 @@ #include #include #include "configuration_interface.h" - +#include "gnss_sdr_flags.h" using google::LogMessage; @@ -70,11 +70,30 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, // RINEX version int rinex_version = configuration->property(role + ".rinex_version", 3); - if( (rinex_version < 2) || (rinex_version > 3) ) + if ( FLAGS_RINEX_version.compare("3.01") == 0 ) { - //warn user and set the default rinex_version = 3; } + else if ( FLAGS_RINEX_version.compare("3.02") == 0 ) + { + rinex_version = 3; + } + else if ( FLAGS_RINEX_version.compare("3") == 0 ) + { + rinex_version = 3; + } + else if ( FLAGS_RINEX_version.compare("2.11") == 0 ) + { + rinex_version = 2; + } + else if ( FLAGS_RINEX_version.compare("2.10") == 0 ) + { + rinex_version = 2; + } + else if ( FLAGS_RINEX_version.compare("2") == 0 ) + { + rinex_version = 2; + } // RTCM Printer settings bool flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false); diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index b2dfa2a68..f1dec9219 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -43,7 +43,6 @@ #include #include #include -#include "gnss_sdr_flags.h" using google::LogMessage; @@ -143,57 +142,17 @@ Rinex_Printer::Rinex_Printer(int conf_version) observationCode["GPS_L1_CA_v2"] = "1"; observationCode["GLONASS_G1_CA_v2"] = "1"; - if ( FLAGS_RINEX_version.compare("3.01") == 0 ) - { - version = 3; - stringVersion = "3.01"; - } - else if ( FLAGS_RINEX_version.compare("3.02") == 0 ) - { - version = 3; - stringVersion = "3.02"; - } - else if ( FLAGS_RINEX_version.compare("3") == 0 ) - { - version = 3; - stringVersion = "3.02"; - } - else if ( FLAGS_RINEX_version.compare("2.11") == 0 ) - { - version = 2; - stringVersion = "2.11"; - } - else if ( FLAGS_RINEX_version.compare("2.10") == 0 ) - { - version = 2; - stringVersion = "2.10"; - } - else if ( FLAGS_RINEX_version.compare("2") == 0 ) + if(conf_version == 2) { version = 2; stringVersion = "2.11"; } else { - LOG(WARNING) << "Unknown RINEX version " << FLAGS_RINEX_version << " (must be 2.11 or 3.02). Using 3.02"; version = 3; stringVersion = "3.02"; } - if(conf_version != 0) - { - if(conf_version == 2) - { - version = 2; - stringVersion = "2.11"; - } - if(conf_version == 3) - { - version = 3; - stringVersion = "3.02"; - } - } - numberTypesObservations = 4; // Number of available types of observable in the system fake_cnav_iode = 1; } diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index e7c1c8660..b2d74748e 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -24,6 +24,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/interfaces ${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} @@ -34,4 +35,4 @@ file(GLOB CHANNEL_ADAPTER_HEADERS "*.h") list(SORT CHANNEL_ADAPTER_HEADERS) add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_HEADERS}) source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) -target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} gnss_sdr_flags)