From b0ba2469346aec76fb022f36b855fa31f2103b3a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 00:35:21 +0100 Subject: [PATCH 01/52] Apply some style rules to CMake scripts --- src/algorithms/PVT/adapters/CMakeLists.txt | 40 ++-- .../PVT/gnuradio_blocks/CMakeLists.txt | 30 +-- src/algorithms/PVT/libs/CMakeLists.txt | 80 ++++--- .../acquisition/adapters/CMakeLists.txt | 73 +++--- .../gnuradio_blocks/CMakeLists.txt | 57 +++-- .../acquisition/libs/CMakeLists.txt | 40 ++-- .../channel/adapters/CMakeLists.txt | 34 ++- src/algorithms/channel/libs/CMakeLists.txt | 22 +- .../conditioner/adapters/CMakeLists.txt | 26 +-- .../data_type_adapter/adapters/CMakeLists.txt | 34 +-- .../gnuradio_blocks/CMakeLists.txt | 30 ++- .../input_filter/adapters/CMakeLists.txt | 62 ++--- .../gnuradio_blocks/CMakeLists.txt | 38 +-- src/algorithms/libs/CMakeLists.txt | 120 +++++----- src/algorithms/libs/rtklib/CMakeLists.txt | 87 ++++--- .../observables/adapters/CMakeLists.txt | 24 +- .../gnuradio_blocks/CMakeLists.txt | 49 ++-- .../resampler/adapters/CMakeLists.txt | 38 +-- .../resampler/gnuradio_blocks/CMakeLists.txt | 29 ++- .../signal_generator/adapters/CMakeLists.txt | 38 +-- .../gnuradio_blocks/CMakeLists.txt | 36 +-- .../signal_source/adapters/CMakeLists.txt | 130 +++++------ .../gnuradio_blocks/CMakeLists.txt | 51 ++-- .../signal_source/libs/CMakeLists.txt | 84 +++---- .../telemetry_decoder/adapters/CMakeLists.txt | 35 +-- .../gnuradio_blocks/CMakeLists.txt | 65 +++--- .../telemetry_decoder/libs/CMakeLists.txt | 29 ++- .../libs/libswiftcnav/CMakeLists.txt | 30 ++- .../tracking/adapters/CMakeLists.txt | 139 ++++++----- .../tracking/gnuradio_blocks/CMakeLists.txt | 123 ++++++---- src/algorithms/tracking/libs/CMakeLists.txt | 98 ++++---- src/core/libs/CMakeLists.txt | 2 +- src/core/libs/supl/CMakeLists.txt | 14 +- src/core/monitor/CMakeLists.txt | 17 +- src/core/receiver/CMakeLists.txt | 219 +++++++++--------- src/core/system_parameters/CMakeLists.txt | 156 +++++++------ src/main/CMakeLists.txt | 110 ++++----- src/utils/front-end-cal/CMakeLists.txt | 93 ++++---- src/utils/rinex2assist/CMakeLists.txt | 16 +- 39 files changed, 1322 insertions(+), 1076 deletions(-) diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index cc63d7032..74ef5d92a 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -18,33 +18,39 @@ if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105800) set(PVT_ADAPTER_SOURCES - rtklib_pvt.cc + rtklib_pvt.cc ) set(PVT_ADAPTER_HEADERS - rtklib_pvt.h + rtklib_pvt.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${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} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${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} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) + source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) -target_link_libraries(pvt_adapters pvt_gr_blocks ${ARMADILLO_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(pvt_adapters + pvt_gr_blocks + ${ARMADILLO_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} +) diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index adaac0125..bbe9ed19d 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -18,30 +18,30 @@ if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105800) set(PVT_GR_BLOCKS_SOURCES - rtklib_pvt_cc.cc + rtklib_pvt_cc.cc ) set(PVT_GR_BLOCKS_HEADERS - rtklib_pvt_cc.h + rtklib_pvt_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${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} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${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} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS}) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index ed69cabab..ad1944c21 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -19,47 +19,46 @@ add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) set(PVT_LIB_SOURCES - pvt_solution.cc - ls_pvt.cc - hybrid_ls_pvt.cc - kml_printer.cc - gpx_printer.cc - rinex_printer.cc - nmea_printer.cc - rtcm_printer.cc - geojson_printer.cc - rtklib_solver.cc - pvt_conf.cc + pvt_solution.cc + ls_pvt.cc + hybrid_ls_pvt.cc + kml_printer.cc + gpx_printer.cc + rinex_printer.cc + nmea_printer.cc + rtcm_printer.cc + geojson_printer.cc + rtklib_solver.cc + pvt_conf.cc ) set(PVT_LIB_HEADERS - pvt_solution.h - ls_pvt.h - hybrid_ls_pvt.h - kml_printer.h - gpx_printer.h - rinex_printer.h - nmea_printer.h - rtcm_printer.h - geojson_printer.h - rtklib_solver.h - pvt_conf.h + pvt_solution.h + ls_pvt.h + hybrid_ls_pvt.h + kml_printer.h + gpx_printer.h + rinex_printer.h + nmea_printer.h + rtcm_printer.h + geojson_printer.h + rtklib_solver.h + pvt_conf.h ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${Boost_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${Boost_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) list(SORT PVT_LIB_HEADERS) @@ -69,9 +68,16 @@ add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) source_group(Headers FILES ${PVT_LIB_HEADERS}) if(MATIO_FOUND) - add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) + add_dependencies(pvt_lib + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + ) else(MATIO_FOUND) - add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) + add_dependencies(pvt_lib + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) endif(MATIO_FOUND) target_link_libraries( diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index b27cb9cb3..f1e21185d 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -55,45 +55,60 @@ set(ACQ_ADAPTER_HEADERS glonass_l2_ca_pcps_acquisition.h ) - if(ENABLE_FPGA) - set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_acquisition_fpga.cc - gps_l2_m_pcps_acquisition_fpga.cc - galileo_e1_pcps_ambiguous_acquisition_fpga.cc - galileo_e5a_pcps_acquisition_fpga.cc - gps_l5i_pcps_acquisition_fpga.cc) - - set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_acquisition_fpga.h - gps_l2_m_pcps_acquisition_fpga.h - galileo_e1_pcps_ambiguous_acquisition_fpga.h - galileo_e5a_pcps_acquisition_fpga.h - gps_l5i_pcps_acquisition_fpga.h) + set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} + gps_l1_ca_pcps_acquisition_fpga.cc + gps_l2_m_pcps_acquisition_fpga.cc + galileo_e1_pcps_ambiguous_acquisition_fpga.cc + galileo_e5a_pcps_acquisition_fpga.cc + gps_l5i_pcps_acquisition_fpga.cc + ) + set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} + gps_l1_ca_pcps_acquisition_fpga.h + gps_l2_m_pcps_acquisition_fpga.h + galileo_e1_pcps_ambiguous_acquisition_fpga.h + galileo_e5a_pcps_acquisition_fpga.h + gps_l5i_pcps_acquisition_fpga.h + ) endif(ENABLE_FPGA) if(OPENCL_FOUND) - set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_opencl_acquisition.cc) - set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_opencl_acquisition.h) + set(ACQ_ADAPTER_SOURCES + ${ACQ_ADAPTER_SOURCES} + gps_l1_ca_pcps_opencl_acquisition.cc + ) + set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} + gps_l1_ca_pcps_opencl_acquisition.h + ) endif(OPENCL_FOUND) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${GNURADIO_BLOCKS_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) list(SORT ACQ_ADAPTER_HEADERS) list(SORT ACQ_ADAPTER_SOURCES) add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) -target_link_libraries(acq_adapters acquisition_lib gnss_sp_libs gnss_sdr_flags acq_gr_blocks ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}) +target_link_libraries(acq_adapters + acquisition_lib + gnss_sp_libs + gnss_sdr_flags + acq_gr_blocks + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} +) diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index bd1800d35..a6d5f6a45 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -50,28 +50,27 @@ if(OPENCL_FOUND) endif(OPENCL_FOUND) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) - if(OPENCL_FOUND) - include_directories( ${OPENCL_INCLUDE_DIRS} ) + include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") + set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") else(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) endif(OS_IS_MACOSX) endif(OPENCL_FOUND) @@ -81,9 +80,29 @@ add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) if(ENABLE_FPGA) - target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES}) + target_link_libraries(acq_gr_blocks + acquisition_lib + gnss_sp_libs + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${OPT_LIBRARIES} + ${OPT_ACQUISITION_LIBRARIES} + ) else(ENABLE_FPGA) - target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ${MATIO_LIBRARIES}) + target_link_libraries(acq_gr_blocks + gnss_sp_libs + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${OPT_LIBRARIES} + ${MATIO_LIBRARIES} + ${OPT_ACQUISITION_LIBRARIES} + ) endif(ENABLE_FPGA) if(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index c8720e226..9ffc0e07a 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -17,19 +17,19 @@ # if(ENABLE_FPGA) - set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc ) - set(ACQUISITION_LIB_HEADERS fpga_acquisition.h ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ) + set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc) + set(ACQUISITION_LIB_HEADERS fpga_acquisition.h) + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${VOLK_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ) endif(ENABLE_FPGA) set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) @@ -38,9 +38,19 @@ set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_SOURCES) -add_library(acquisition_lib ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS}) +add_library(acquisition_lib + ${ACQUISITION_LIB_SOURCES} + ${ACQUISITION_LIB_HEADERS} +) + source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) -target_link_libraries(acquisition_lib ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(acquisition_lib + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} +) + if(VOLK_GNSSSDR_FOUND) add_dependencies(acquisition_lib glog-${glog_RELEASE}) else(VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index d3b754e97..65591834c 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -20,18 +20,28 @@ set(CHANNEL_ADAPTER_SOURCES channel.cc) set(CHANNEL_ADAPTER_HEADERS channel.h) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${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} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${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} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} +) + +add_library(channel_adapters + ${CHANNEL_ADAPTER_SOURCES} + ${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} gnss_sdr_flags) + +target_link_libraries(channel_adapters + channel_fsm + ${GNURADIO_RUNTIME_LIBRARIES} + ${Boost_LIBRARIES} + gnss_sdr_flags +) diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 7965cea70..70bee59f9 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -19,23 +19,23 @@ set(CHANNEL_FSM_SOURCES channel_fsm.cc channel_msg_receiver_cc.cc - ) +) set(CHANNEL_FSM_HEADERS channel_fsm.h channel_msg_receiver_cc.h - ) +) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) list(SORT CHANNEL_FSM_HEADERS) diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index def069263..38d606824 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -18,25 +18,25 @@ set(COND_ADAPTER_SOURCES - signal_conditioner.cc - array_signal_conditioner.cc + signal_conditioner.cc + array_signal_conditioner.cc ) set(COND_ADAPTER_HEADERS - signal_conditioner.h - array_signal_conditioner.h + signal_conditioner.h + array_signal_conditioner.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) list(SORT COND_ADAPTER_HEADERS) diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 419e1a271..1977f7a5a 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -23,7 +23,7 @@ set(DATATYPE_ADAPTER_SOURCES ibyte_to_complex.cc ibyte_to_cshort.cc ishort_to_cshort.cc - ishort_to_complex.cc + ishort_to_complex.cc ) set(DATATYPE_ADAPTER_HEADERS @@ -32,25 +32,33 @@ set(DATATYPE_ADAPTER_HEADERS ibyte_to_complex.h ibyte_to_cshort.h ishort_to_cshort.h - ishort_to_complex.h + ishort_to_complex.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) list(SORT DATATYPE_ADAPTER_HEADERS) list(SORT DATATYPE_ADAPTER_SOURCES) -add_library(datatype_adapters ${DATATYPE_ADAPTER_SOURCES} ${DATATYPE_ADAPTER_HEADERS}) +add_library(datatype_adapters + ${DATATYPE_ADAPTER_SOURCES} + ${DATATYPE_ADAPTER_HEADERS} +) + source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) add_dependencies(datatype_adapters glog-${glog_RELEASE}) -target_link_libraries(datatype_adapters data_type_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}) +target_link_libraries(datatype_adapters + data_type_gr_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} +) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 2253ce5f8..b4f429db9 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -18,26 +18,34 @@ set(DATA_TYPE_GR_BLOCKS_SOURCES - interleaved_byte_to_complex_byte.cc - interleaved_short_to_complex_short.cc - interleaved_byte_to_complex_short.cc + interleaved_byte_to_complex_byte.cc + interleaved_short_to_complex_short.cc + interleaved_byte_to_complex_short.cc ) set(DATA_TYPE_GR_BLOCKS_HEADERS - interleaved_byte_to_complex_byte.h - interleaved_short_to_complex_short.h - interleaved_byte_to_complex_short.h + interleaved_byte_to_complex_byte.h + interleaved_short_to_complex_short.h + interleaved_byte_to_complex_short.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) -add_library(data_type_gr_blocks ${DATA_TYPE_GR_BLOCKS_SOURCES} ${DATA_TYPE_GR_BLOCKS_HEADERS}) +add_library(data_type_gr_blocks + ${DATA_TYPE_GR_BLOCKS_SOURCES} + ${DATA_TYPE_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) -target_link_libraries(data_type_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES}) + +target_link_libraries(data_type_gr_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${VOLK_LIBRARIES} +) diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 959c1ba88..7f33f4072 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -17,43 +17,53 @@ # set(INPUT_FILTER_ADAPTER_SOURCES - fir_filter.cc - freq_xlating_fir_filter.cc - beamformer_filter.cc - pulse_blanking_filter.cc - notch_filter.cc - notch_filter_lite.cc + fir_filter.cc + freq_xlating_fir_filter.cc + beamformer_filter.cc + pulse_blanking_filter.cc + notch_filter.cc + notch_filter_lite.cc ) set(INPUT_FILTER_ADAPTER_HEADERS - fir_filter.h - freq_xlating_fir_filter.h - beamformer_filter.h - pulse_blanking_filter.h - notch_filter.h - notch_filter_lite.h + fir_filter.h + freq_xlating_fir_filter.h + beamformer_filter.h + pulse_blanking_filter.h + notch_filter.h + notch_filter_lite.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) -add_library(input_filter_adapters ${INPUT_FILTER_ADAPTER_SOURCES} ${INPUT_FILTER_ADAPTER_HEADERS}) +add_library(input_filter_adapters + ${INPUT_FILTER_ADAPTER_SOURCES} + ${INPUT_FILTER_ADAPTER_HEADERS} +) + source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) add_dependencies(input_filter_adapters glog-${glog_RELEASE} gnss_sp_libs) -target_link_libraries(input_filter_adapters input_filter_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} gnss_sp_libs) +target_link_libraries(input_filter_adapters + input_filter_gr_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + gnss_sp_libs +) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 75f903868..ea3de1cb6 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -18,35 +18,41 @@ set(INPUT_FILTER_GR_BLOCKS_SOURCES - beamformer.cc - pulse_blanking_cc.cc - notch_cc.cc - notch_lite_cc.cc + beamformer.cc + pulse_blanking_cc.cc + notch_cc.cc + notch_lite_cc.cc ) set(INPUT_FILTER_GR_BLOCKS_HEADERS - beamformer.h - pulse_blanking_cc.h - notch_cc.h - notch_lite_cc.h + beamformer.h + pulse_blanking_cc.h + notch_cc.h + notch_lite_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${GNURADIO_BLOCKS_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ) list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) -add_library(input_filter_gr_blocks ${INPUT_FILTER_GR_BLOCKS_SOURCES} ${INPUT_FILTER_GR_BLOCKS_HEADERS}) +add_library(input_filter_gr_blocks + ${INPUT_FILTER_GR_BLOCKS_SOURCES} + ${INPUT_FILTER_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) -target_link_libraries(input_filter_gr_blocks ${GNURADIO_FILTER_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${LOG4CPP_LIBRARIES}) +target_link_libraries(input_filter_gr_blocks + ${GNURADIO_FILTER_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${LOG4CPP_LIBRARIES}) if(NOT VOLK_GNSSSDR_FOUND) add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index de4efc084..29869ea6a 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -19,79 +19,77 @@ add_subdirectory(rtklib) set(GNSS_SPLIBS_SOURCES - gps_l2c_signal.cc - gps_l5_signal.cc - galileo_e1_signal_processing.cc - gnss_sdr_valve.cc - gnss_sdr_sample_counter.cc - gnss_signal_processing.cc - gps_sdr_signal_processing.cc - glonass_l1_signal_processing.cc - glonass_l2_signal_processing.cc - pass_through.cc - galileo_e5_signal_processing.cc - complex_byte_to_float_x2.cc - byte_x2_to_complex_byte.cc - cshort_to_float_x2.cc - short_x2_to_cshort.cc - complex_float_to_complex_byte.cc - conjugate_cc.cc - conjugate_sc.cc - conjugate_ic.cc - gnss_sdr_create_directory.cc - geofunctions.cc + gps_l2c_signal.cc + gps_l5_signal.cc + galileo_e1_signal_processing.cc + gnss_sdr_valve.cc + gnss_sdr_sample_counter.cc + gnss_signal_processing.cc + gps_sdr_signal_processing.cc + glonass_l1_signal_processing.cc + glonass_l2_signal_processing.cc + pass_through.cc + galileo_e5_signal_processing.cc + complex_byte_to_float_x2.cc + byte_x2_to_complex_byte.cc + cshort_to_float_x2.cc + short_x2_to_cshort.cc + complex_float_to_complex_byte.cc + conjugate_cc.cc + conjugate_sc.cc + conjugate_ic.cc + gnss_sdr_create_directory.cc + geofunctions.cc ) set(GNSS_SPLIBS_HEADERS - gps_l2c_signal.h - gps_l5_signal.h - galileo_e1_signal_processing.h - gnss_sdr_valve.h - gnss_sdr_sample_counter.h - gnss_signal_processing.h - gps_sdr_signal_processing.h - glonass_l1_signal_processing.h - glonass_l2_signal_processing.h - pass_through.h - galileo_e5_signal_processing.h - complex_byte_to_float_x2.h - byte_x2_to_complex_byte.h - cshort_to_float_x2.h - short_x2_to_cshort.h - complex_float_to_complex_byte.h - conjugate_cc.h - conjugate_sc.h - conjugate_ic.h - gnss_sdr_create_directory.h - gnss_circular_deque.h - geofunctions.h + gps_l2c_signal.h + gps_l5_signal.h + galileo_e1_signal_processing.h + gnss_sdr_valve.h + gnss_sdr_sample_counter.h + gnss_signal_processing.h + gps_sdr_signal_processing.h + glonass_l1_signal_processing.h + glonass_l2_signal_processing.h + pass_through.h + galileo_e5_signal_processing.h + complex_byte_to_float_x2.h + byte_x2_to_complex_byte.h + cshort_to_float_x2.h + short_x2_to_cshort.h + complex_float_to_complex_byte.h + conjugate_cc.h + conjugate_sc.h + conjugate_ic.h + gnss_sdr_create_directory.h + gnss_circular_deque.h + geofunctions.h ) - if(ENABLE_FPGA) - set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} + set(GNSS_SPLIBS_SOURCES + ${GNSS_SPLIBS_SOURCES} gnss_sdr_time_counter.cc gnss_sdr_fpga_sample_counter.cc - ) - - set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} + ) + set(GNSS_SPLIBS_HEADERS + ${GNSS_SPLIBS_HEADERS} gnss_sdr_time_counter.h gnss_sdr_fpga_sample_counter.h - ) - + ) endif(ENABLE_FPGA) if(OPENCL_FOUND) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} - opencl/fft_execute.cc # Needs OpenCL - opencl/fft_setup.cc # Needs OpenCL - opencl/fft_kernelstring.cc # Needs OpenCL + opencl/fft_execute.cc # Needs OpenCL + opencl/fft_setup.cc # Needs OpenCL + opencl/fft_kernelstring.cc # Needs OpenCL ) - set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} - opencl/fft_execute.h # Needs OpenCL - opencl/fft_setup.h # Needs OpenCL - opencl/fft_kernelstring.h # Needs OpenCL + opencl/fft_execute.h # Needs OpenCL + opencl/fft_setup.h # Needs OpenCL + opencl/fft_kernelstring.h # Needs OpenCL ) endif(OPENCL_FOUND) @@ -111,7 +109,7 @@ include_directories( ) if(OPENCL_FOUND) - include_directories( ${OPENCL_INCLUDE_DIRS} ) + include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") else(OS_IS_MACOSX) @@ -127,7 +125,8 @@ list(SORT GNSS_SPLIBS_SOURCES) add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) -target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} +target_link_libraries(gnss_sp_libs + ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES} ${ORC_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} ${GFlags_LIBS} @@ -140,7 +139,8 @@ target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module armadillo-${armadillo_RELEASE}) + add_dependencies(gnss_sp_libs volk_gnsssdr_module + armadillo-${armadillo_RELEASE}) else(NOT VOLK_GNSSSDR_FOUND) add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) endif(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index ff81a9fb8..c2f7ff6f8 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -16,60 +16,59 @@ # along with GNSS-SDR. If not, see . # -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(RTKLIB_LIB_SOURCES - rtklib_rtkcmn.cc - rtklib_ephemeris.cc - rtklib_preceph.cc - rtklib_sbas.cc - rtklib_ionex.cc - rtklib_pntpos.cc - rtklib_ppp.cc - rtklib_tides.cc - rtklib_lambda.cc - rtklib_rtkpos.cc - rtklib_conversions.cc - rtklib_stream.cc - rtklib_rtksvr.cc - rtklib_solution.cc - rtklib_rtcm.cc - rtklib_rtcm2.cc - rtklib_rtcm3.cc + rtklib_rtkcmn.cc + rtklib_ephemeris.cc + rtklib_preceph.cc + rtklib_sbas.cc + rtklib_ionex.cc + rtklib_pntpos.cc + rtklib_ppp.cc + rtklib_tides.cc + rtklib_lambda.cc + rtklib_rtkpos.cc + rtklib_conversions.cc + rtklib_stream.cc + rtklib_rtksvr.cc + rtklib_solution.cc + rtklib_rtcm.cc + rtklib_rtcm2.cc + rtklib_rtcm3.cc ) set(RTKLIB_LIB_HEADERS - rtklib_rtkcmn.h - rtklib_ephemeris.h - rtklib_preceph.h - rtklib_sbas.h - rtklib_ionex.h - rtklib_pntpos.h - rtklib_ppp.h - rtklib_tides.h - rtklib_lambda.h - rtklib_rtkpos.h - rtklib_conversions.h - rtklib_stream.h - rtklib_rtksvr.h - rtklib_solution.h - rtklib_rtcm.h - rtklib_rtcm2.h - rtklib_rtcm3.h - rtklib.h + rtklib_rtkcmn.h + rtklib_ephemeris.h + rtklib_preceph.h + rtklib_sbas.h + rtklib_ionex.h + rtklib_pntpos.h + rtklib_ppp.h + rtklib_tides.h + rtklib_lambda.h + rtklib_rtkpos.h + rtklib_conversions.h + rtklib_stream.h + rtklib_rtksvr.h + rtklib_solution.h + rtklib_rtcm.h + rtklib_rtcm2.h + rtklib_rtcm3.h + rtklib.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${Boost_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} ) - list(SORT RTKLIB_LIB_HEADERS) list(SORT RTKLIB_LIB_SOURCES) diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index d3c5b6933..ef0df1d7d 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -17,24 +17,24 @@ # set(OBS_ADAPTER_SOURCES - hybrid_observables.cc + hybrid_observables.cc ) set(OBS_ADAPTER_HEADERS - hybrid_observables.h + hybrid_observables.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) add_library(obs_adapters ${OBS_ADAPTER_SOURCES} ${OBS_ADAPTER_HEADERS}) diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 82c5bc243..5a1a55e8d 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -17,32 +17,49 @@ # set(OBS_GR_BLOCKS_SOURCES - hybrid_observables_cc.cc + hybrid_observables_cc.cc ) set(OBS_GR_BLOCKS_HEADERS - hybrid_observables_cc.h + hybrid_observables_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) + if(MATIO_FOUND) - add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) + add_dependencies(obs_gr_blocks + gnss_sp_libs + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + ) else(MATIO_FOUND) - add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) + add_dependencies(obs_gr_blocks + gnss_sp_libs + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) endif(MATIO_FOUND) -target_link_libraries(obs_gr_blocks gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ${ARMADILLO_LIBRARIES} ${MATIO_LIBRARIES}) + +target_link_libraries(obs_gr_blocks + gnss_sp_libs + ${GNURADIO_RUNTIME_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${MATIO_LIBRARIES} +) diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 41f5dd8d1..0f6c92684 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -16,35 +16,39 @@ # along with GNSS-SDR. If not, see . # + set(RESAMPLER_ADAPTER_SOURCES - direct_resampler_conditioner.cc - mmse_resampler_conditioner.cc + direct_resampler_conditioner.cc + mmse_resampler_conditioner.cc ) - set(RESAMPLER_ADAPTER_HEADERS - direct_resampler_conditioner.h - mmse_resampler_conditioner.h + direct_resampler_conditioner.h + mmse_resampler_conditioner.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) -add_library(resampler_adapters ${RESAMPLER_ADAPTER_SOURCES} ${RESAMPLER_ADAPTER_HEADERS}) +add_library(resampler_adapters + ${RESAMPLER_ADAPTER_SOURCES} + ${RESAMPLER_ADAPTER_HEADERS} +) + source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) + target_link_libraries(resampler_adapters resampler_gr_blocks) diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 26233f3fd..ae570d644 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -18,28 +18,33 @@ set(RESAMPLER_GR_BLOCKS_SOURCES - direct_resampler_conditioner_cc.cc - direct_resampler_conditioner_cs.cc - direct_resampler_conditioner_cb.cc + direct_resampler_conditioner_cc.cc + direct_resampler_conditioner_cs.cc + direct_resampler_conditioner_cb.cc ) set(RESAMPLER_GR_BLOCKS_HEADERS - direct_resampler_conditioner_cc.h - direct_resampler_conditioner_cs.h - direct_resampler_conditioner_cb.h + direct_resampler_conditioner_cc.h + direct_resampler_conditioner_cs.h + direct_resampler_conditioner_cb.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) list(SORT RESAMPLER_GR_BLOCKS_HEADERS) list(SORT RESAMPLER_GR_BLOCKS_SOURCES) -add_library(resampler_gr_blocks ${RESAMPLER_GR_BLOCKS_SOURCES} ${RESAMPLER_GR_BLOCKS_HEADERS}) +add_library(resampler_gr_blocks + ${RESAMPLER_GR_BLOCKS_SOURCES} + ${RESAMPLER_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) + add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index c248171d9..fe793203b 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -20,22 +20,28 @@ set(SIGNAL_GENERATOR_ADAPTER_SOURCES signal_generator.cc) set(SIGNAL_GENERATOR_ADAPTER_HEADERS signal_generator.h) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) -add_library(signal_generator_adapters ${SIGNAL_GENERATOR_ADAPTER_SOURCES} ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) -source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) -target_link_libraries(signal_generator_adapters gnss_sp_libs - signal_generator_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} +add_library(signal_generator_adapters + ${SIGNAL_GENERATOR_ADAPTER_SOURCES} + ${SIGNAL_GENERATOR_ADAPTER_HEADERS} +) + +source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) + +target_link_libraries(signal_generator_adapters + gnss_sp_libs + signal_generator_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} ) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index b8df4e29f..eade10e00 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -20,23 +20,31 @@ set(SIGNAL_GENERATOR_BLOCK_SOURCES signal_generator_c.cc) set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} +) + +add_library(signal_generator_blocks + ${SIGNAL_GENERATOR_BLOCK_SOURCES} + ${SIGNAL_GENERATOR_BLOCK_HEADERS} ) -add_library(signal_generator_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS}) source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) -target_link_libraries(signal_generator_blocks gnss_system_parameters gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + +target_link_libraries(signal_generator_blocks + gnss_system_parameters + gnss_sp_libs + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${ORC_LIBRARIES} ) if(VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index d7cde103e..83062ea66 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -81,6 +81,7 @@ if(ENABLE_FMCOMMS2) endif(GRIIO_FOUND) endif(ENABLE_FMCOMMS2) + if(ENABLE_AD9361) ############################################### # AD9361 DIRECT TO FPGA Hardware @@ -92,57 +93,55 @@ if(ENABLE_AD9361) endif(ENABLE_AD9361) - if(ENABLE_GN3S) - ############################################## - # GN3S (USB dongle) - ############################################## - find_package(GRGN3S REQUIRED) - if(NOT GRGN3S_FOUND) - message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") - message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") - endif(NOT GRGN3S_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) - set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) + ############################################## + # GN3S (USB dongle) + ############################################## + find_package(GRGN3S REQUIRED) + if(NOT GRGN3S_FOUND) + message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") + message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") + endif(NOT GRGN3S_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) + set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) endif(ENABLE_GN3S) if(ENABLE_FLEXIBAND) - ############################################## - # TELEORBIT FLEXIBAND FRONTEND ADAPTER - ############################################## - find_package(TELEORBIT REQUIRED) - if(NOT TELEORBIT_FOUND) - message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") - endif(NOT TELEORBIT_FOUND) - - # Set up variables - set(FLEXIBAND_DRIVER_INCLUDE_DIRS - ${OPT_DRIVER_INCLUDE_DIRS} - ${TELEORBIT_INCLUDE_DIR}/teleorbit - ) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) - set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) + ############################################## + # TELEORBIT FLEXIBAND FRONTEND ADAPTER + ############################################## + find_package(TELEORBIT REQUIRED) + if(NOT TELEORBIT_FOUND) + message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") + endif(NOT TELEORBIT_FOUND) + # Set up variables + set(FLEXIBAND_DRIVER_INCLUDE_DIRS + ${OPT_DRIVER_INCLUDE_DIRS} + ${TELEORBIT_INCLUDE_DIR}/teleorbit + ) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) + set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) endif(ENABLE_FLEXIBAND) if(ENABLE_ARRAY) - ############################################## - # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE - ############################################## - find_package(GRDBFCTTC REQUIRED) - if(NOT GRDBFCTTC_FOUND) - message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") - message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") - endif(NOT GRDBFCTTC_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) - set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) + ############################################## + # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE + ############################################## + find_package(GRDBFCTTC REQUIRED) + if(NOT GRDBFCTTC_FOUND) + message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") + message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") + endif(NOT GRDBFCTTC_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) + set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) endif(ENABLE_ARRAY) @@ -167,6 +166,7 @@ if(ENABLE_OSMOSDR) endif(NOT GROSMOSDR_FOUND) endif(ENABLE_OSMOSDR) + if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) @@ -197,27 +197,27 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS file_signal_source.h if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) - set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES} - two_bit_cpx_file_signal_source.cc - two_bit_packed_file_signal_source.cc ) - set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} - two_bit_cpx_file_signal_source.h - two_bit_packed_file_signal_source.h ) + set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES} + two_bit_cpx_file_signal_source.cc + two_bit_packed_file_signal_source.cc) + set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} + two_bit_cpx_file_signal_source.h + two_bit_packed_file_signal_source.h) endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${OPT_DRIVER_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${OPT_DRIVER_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) if(ARCH_64BITS) @@ -232,9 +232,9 @@ list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS}) target_link_libraries(signal_source_adapters signal_source_gr_blocks - ${Boost_LIBRARIES} - ${GNURADIO_PMT_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${OPT_LIBRARIES} - gnss_sp_libs + ${Boost_LIBRARIES} + ${GNURADIO_PMT_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${OPT_LIBRARIES} + gnss_sp_libs ) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 9f9c174c7..b673dd897 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -31,38 +31,39 @@ endif(ENABLE_RAW_UDP) set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES - unpack_byte_2bit_samples.cc - unpack_byte_2bit_cpx_samples.cc - unpack_byte_4bit_samples.cc - unpack_intspir_1bit_samples.cc - rtl_tcp_signal_source_c.cc - unpack_2bit_samples.cc - unpack_spir_gss6450_samples.cc - labsat23_source.cc - ${OPT_DRIVER_SOURCES} + unpack_byte_2bit_samples.cc + unpack_byte_2bit_cpx_samples.cc + unpack_byte_4bit_samples.cc + unpack_intspir_1bit_samples.cc + rtl_tcp_signal_source_c.cc + unpack_2bit_samples.cc + unpack_spir_gss6450_samples.cc + labsat23_source.cc + ${OPT_DRIVER_SOURCES} ) + set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS - unpack_byte_2bit_samples.h - unpack_byte_2bit_cpx_samples.h - unpack_byte_4bit_samples.h - unpack_intspir_1bit_samples.h - rtl_tcp_signal_source_c.h - unpack_2bit_samples.h - unpack_spir_gss6450_samples.h - labsat23_source.h - ${OPT_DRIVER_HEADERS} + unpack_byte_2bit_samples.h + unpack_byte_2bit_cpx_samples.h + unpack_byte_4bit_samples.h + unpack_intspir_1bit_samples.h + rtl_tcp_signal_source_c.h + unpack_2bit_samples.h + unpack_spir_gss6450_samples.h + labsat23_source.h + ${OPT_DRIVER_HEADERS} ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${OPT_DRIVER_INCLUDE_DIRS} ) list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 759858e08..af65174c0 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,64 +17,64 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(GRIIO REQUIRED) - if(NOT GRIIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif(NOT GRIIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + find_package(GRIIO REQUIRED) + if(NOT GRIIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") + endif(NOT GRIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - find_package(LIBIIO REQUIRED) - if(NOT LIBIIO_FOUND) - message(STATUS "libiio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - endif(NOT LIBIIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) + find_package(LIBIIO REQUIRED) + if(NOT LIBIIO_FOUND) + message(STATUS "libiio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") + endif(NOT LIBIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) - ############################################### - # FMCOMMS2 based SDR Hardware - ############################################### - if(LIBIIO_FOUND) - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) - set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) - endif(LIBIIO_FOUND) + ############################################### + # FMCOMMS2 based SDR Hardware + ############################################### + if(LIBIIO_FOUND) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) + endif(LIBIIO_FOUND) endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(ENABLE_FPGA OR ENABLE_AD9361) - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) - set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) endif(ENABLE_FPGA OR ENABLE_AD9361) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${OPT_DRIVER_INCLUDE_DIRS} ) set(SIGNAL_SOURCE_LIB_SOURCES - rtl_tcp_commands.cc - rtl_tcp_dongle_info.cc - ${OPT_SIGNAL_SOURCE_LIB_SOURCES} + rtl_tcp_commands.cc + rtl_tcp_dongle_info.cc + ${OPT_SIGNAL_SOURCE_LIB_SOURCES} ) set(SIGNAL_SOURCE_LIB_HEADERS - rtl_tcp_commands.h - rtl_tcp_dongle_info.h - ${OPT_SIGNAL_SOURCE_LIB_HEADERS} + rtl_tcp_commands.h + rtl_tcp_dongle_info.h + ${OPT_SIGNAL_SOURCE_LIB_HEADERS} ) list(SORT SIGNAL_SOURCE_LIB_HEADERS) diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index 7c4e4b53a..01836e5ae 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -40,22 +40,31 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_SOURCES) -add_library(telemetry_decoder_adapters ${TELEMETRY_DECODER_ADAPTER_SOURCES} ${TELEMETRY_DECODER_ADAPTER_HEADERS}) +add_library(telemetry_decoder_adapters + ${TELEMETRY_DECODER_ADAPTER_SOURCES} + ${TELEMETRY_DECODER_ADAPTER_HEADERS} +) + source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) -target_link_libraries(telemetry_decoder_adapters telemetry_decoder_gr_blocks gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(telemetry_decoder_adapters + telemetry_decoder_gr_blocks + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} +) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index e0a102148..92d258bfe 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -17,45 +17,56 @@ # set(TELEMETRY_DECODER_GR_BLOCKS_SOURCES - gps_l1_ca_telemetry_decoder_cc.cc - gps_l2c_telemetry_decoder_cc.cc - gps_l5_telemetry_decoder_cc.cc - sbas_l1_telemetry_decoder_cc.cc - glonass_l1_ca_telemetry_decoder_cc.cc - glonass_l2_ca_telemetry_decoder_cc.cc - galileo_telemetry_decoder_cc.cc + gps_l1_ca_telemetry_decoder_cc.cc + gps_l2c_telemetry_decoder_cc.cc + gps_l5_telemetry_decoder_cc.cc + sbas_l1_telemetry_decoder_cc.cc + glonass_l1_ca_telemetry_decoder_cc.cc + glonass_l2_ca_telemetry_decoder_cc.cc + galileo_telemetry_decoder_cc.cc ) set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS - gps_l1_ca_telemetry_decoder_cc.h - gps_l2c_telemetry_decoder_cc.h - gps_l5_telemetry_decoder_cc.h - sbas_l1_telemetry_decoder_cc.h - glonass_l1_ca_telemetry_decoder_cc.h - glonass_l2_ca_telemetry_decoder_cc.h - galileo_telemetry_decoder_cc.h + gps_l1_ca_telemetry_decoder_cc.h + gps_l2c_telemetry_decoder_cc.h + gps_l5_telemetry_decoder_cc.h + sbas_l1_telemetry_decoder_cc.h + glonass_l1_ca_telemetry_decoder_cc.h + glonass_l2_ca_telemetry_decoder_cc.h + galileo_telemetry_decoder_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) list(SORT TELEMETRY_DECODER_GR_BLOCKS_SOURCES) -add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) +add_library(telemetry_decoder_gr_blocks + ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} + ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) -target_link_libraries(telemetry_decoder_gr_blocks telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES}) + +target_link_libraries(telemetry_decoder_gr_blocks + telemetry_decoder_libswiftcnav + telemetry_decoder_lib + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} +) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) + add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) endif(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 5c663c93a..53a997cc8 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -16,31 +16,36 @@ # along with GNSS-SDR. If not, see . # + add_subdirectory(libswiftcnav) set(TELEMETRY_DECODER_LIB_SOURCES - viterbi_decoder.cc + viterbi_decoder.cc ) set(TELEMETRY_DECODER_LIB_HEADERS - viterbi_decoder.h - convolutional.h + viterbi_decoder.h + convolutional.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ) list(SORT TELEMETRY_DECODER_LIB_HEADERS) list(SORT TELEMETRY_DECODER_LIB_SOURCES) -add_library(telemetry_decoder_lib ${TELEMETRY_DECODER_LIB_SOURCES} ${TELEMETRY_DECODER_LIB_HEADERS}) +add_library(telemetry_decoder_lib + ${TELEMETRY_DECODER_LIB_SOURCES} + ${TELEMETRY_DECODER_LIB_HEADERS} +) source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) + target_link_libraries(telemetry_decoder_lib gnss_system_parameters) diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index ad356be81..af753c057 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -17,27 +17,33 @@ # set(TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES - cnav_msg.c - bits.c - edc.c - viterbi27.c + cnav_msg.c + bits.c + edc.c + viterbi27.c ) set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS - cnav_msg.h - bits.h - edc.h - swift_common.h - fec.h + cnav_msg.h + bits.h + edc.h + swift_common.h + fec.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} ) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES) -add_library(telemetry_decoder_libswiftcnav STATIC ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) +add_library(telemetry_decoder_libswiftcnav STATIC + ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} + ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} +) + source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) -set_target_properties(telemetry_decoder_libswiftcnav PROPERTIES LINKER_LANGUAGE C) + +set_target_properties(telemetry_decoder_libswiftcnav + PROPERTIES LINKER_LANGUAGE C) diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 5ac4ec00b..db967b669 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -16,81 +16,104 @@ # along with GNSS-SDR. If not, see . # + if(ENABLE_CUDA) - set(OPT_TRACKING_ADAPTERS_SOURCES ${OPT_TRACKING_ADAPTERS_SOURCES} gps_l1_ca_dll_pll_tracking_gpu.cc) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} gps_l1_ca_dll_pll_tracking_gpu.h) - set(OPT_TRACKING_INCLUDE_DIRS ${OPT_TRACKING_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) + set(OPT_TRACKING_ADAPTERS_SOURCES + ${OPT_TRACKING_ADAPTERS_SOURCES} + gps_l1_ca_dll_pll_tracking_gpu.cc + ) + set(OPT_TRACKING_ADAPTERS_HEADERS + ${OPT_TRACKING_ADAPTERS_HEADERS} + gps_l1_ca_dll_pll_tracking_gpu.h + ) + set(OPT_TRACKING_INCLUDE_DIRS + ${OPT_TRACKING_INCLUDE_DIRS} + ${CUDA_INCLUDE_DIRS} + ) endif(ENABLE_CUDA) if(ENABLE_FPGA) - set(OPT_TRACKING_ADAPTERS_SOURCES ${OPT_TRACKING_ADAPTERS_SOURCES} - gps_l1_ca_dll_pll_tracking_fpga.cc - gps_l2_m_dll_pll_tracking_fpga.cc - galileo_e1_dll_pll_veml_tracking_fpga.cc - galileo_e5a_dll_pll_tracking_fpga.cc - gps_l5_dll_pll_tracking_fpga.cc) + set(OPT_TRACKING_ADAPTERS_SOURCES + ${OPT_TRACKING_ADAPTERS_SOURCES} + gps_l1_ca_dll_pll_tracking_fpga.cc + gps_l2_m_dll_pll_tracking_fpga.cc + galileo_e1_dll_pll_veml_tracking_fpga.cc + galileo_e5a_dll_pll_tracking_fpga.cc + gps_l5_dll_pll_tracking_fpga.cc + ) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} - gps_l1_ca_dll_pll_tracking_fpga.h - gps_l2_m_dll_pll_tracking_fpga.h - galileo_e1_dll_pll_veml_tracking_fpga.h - galileo_e5a_dll_pll_tracking_fpga.h - gps_l5_dll_pll_tracking_fpga.h) + set(OPT_TRACKING_ADAPTERS_HEADERS + ${OPT_TRACKING_ADAPTERS_HEADERS} + gps_l1_ca_dll_pll_tracking_fpga.h + gps_l2_m_dll_pll_tracking_fpga.h + galileo_e1_dll_pll_veml_tracking_fpga.h + galileo_e5a_dll_pll_tracking_fpga.h + gps_l5_dll_pll_tracking_fpga.h + ) endif(ENABLE_FPGA) set(TRACKING_ADAPTER_SOURCES - galileo_e1_dll_pll_veml_tracking.cc - galileo_e1_tcp_connector_tracking.cc - gps_l1_ca_dll_pll_tracking.cc - gps_l1_ca_dll_pll_c_aid_tracking.cc - gps_l1_ca_tcp_connector_tracking.cc - galileo_e5a_dll_pll_tracking.cc - gps_l2_m_dll_pll_tracking.cc - glonass_l1_ca_dll_pll_tracking.cc - glonass_l1_ca_dll_pll_c_aid_tracking.cc - gps_l1_ca_kf_tracking.cc - gps_l5_dll_pll_tracking.cc - glonass_l2_ca_dll_pll_tracking.cc - glonass_l2_ca_dll_pll_c_aid_tracking.cc - ${OPT_TRACKING_ADAPTERS_SOURCES} + galileo_e1_dll_pll_veml_tracking.cc + galileo_e1_tcp_connector_tracking.cc + gps_l1_ca_dll_pll_tracking.cc + gps_l1_ca_dll_pll_c_aid_tracking.cc + gps_l1_ca_tcp_connector_tracking.cc + galileo_e5a_dll_pll_tracking.cc + gps_l2_m_dll_pll_tracking.cc + glonass_l1_ca_dll_pll_tracking.cc + glonass_l1_ca_dll_pll_c_aid_tracking.cc + gps_l1_ca_kf_tracking.cc + gps_l5_dll_pll_tracking.cc + glonass_l2_ca_dll_pll_tracking.cc + glonass_l2_ca_dll_pll_c_aid_tracking.cc + ${OPT_TRACKING_ADAPTERS_SOURCES} ) set(TRACKING_ADAPTER_HEADERS - galileo_e1_dll_pll_veml_tracking.h - galileo_e1_tcp_connector_tracking.h - gps_l1_ca_dll_pll_tracking.h - gps_l1_ca_dll_pll_c_aid_tracking.h - gps_l1_ca_tcp_connector_tracking.h - galileo_e5a_dll_pll_tracking.h - gps_l2_m_dll_pll_tracking.h - glonass_l1_ca_dll_pll_tracking.h - glonass_l1_ca_dll_pll_c_aid_tracking.h - gps_l1_ca_kf_tracking.h - gps_l5_dll_pll_tracking.h - glonass_l2_ca_dll_pll_tracking.h - glonass_l2_ca_dll_pll_c_aid_tracking.h - ${OPT_TRACKING_ADAPTERS_HEADERS} + galileo_e1_dll_pll_veml_tracking.h + galileo_e1_tcp_connector_tracking.h + gps_l1_ca_dll_pll_tracking.h + gps_l1_ca_dll_pll_c_aid_tracking.h + gps_l1_ca_tcp_connector_tracking.h + galileo_e5a_dll_pll_tracking.h + gps_l2_m_dll_pll_tracking.h + glonass_l1_ca_dll_pll_tracking.h + glonass_l1_ca_dll_pll_c_aid_tracking.h + gps_l1_ca_kf_tracking.h + gps_l5_dll_pll_tracking.h + glonass_l2_ca_dll_pll_tracking.h + glonass_l2_ca_dll_pll_c_aid_tracking.h + ${OPT_TRACKING_ADAPTERS_HEADERS} ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${OPT_TRACKING_INCLUDE_DIRS} ) list(SORT TRACKING_ADAPTER_HEADERS) list(SORT TRACKING_ADAPTER_SOURCES) -add_library(tracking_adapters ${TRACKING_ADAPTER_SOURCES} ${TRACKING_ADAPTER_HEADERS}) +add_library(tracking_adapters + ${TRACKING_ADAPTER_SOURCES} + ${TRACKING_ADAPTER_HEADERS} +) + source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) -target_link_libraries(tracking_adapters tracking_gr_blocks gnss_sp_libs gnss_sdr_flags) + +target_link_libraries(tracking_adapters + tracking_gr_blocks + gnss_sp_libs + gnss_sdr_flags +) diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 9ac1a4e26..fdc72cd34 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -17,77 +17,104 @@ # if(ENABLE_CUDA) - set(OPT_TRACKING_BLOCKS_SOURCES ${OPT_TRACKING_BLOCKS_SOURCES} gps_l1_ca_dll_pll_tracking_gpu_cc.cc) - set(OPT_TRACKING_BLOCKS_HEADERS ${OPT_TRACKING_BLOCKS_HEADERS} gps_l1_ca_dll_pll_tracking_gpu_cc.h) - set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS}) - set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} ${CUDA_LIBRARIES}) + set(OPT_TRACKING_BLOCKS_SOURCES + ${OPT_TRACKING_BLOCKS_SOURCES} + gps_l1_ca_dll_pll_tracking_gpu_cc.cc + ) + set(OPT_TRACKING_BLOCKS_HEADERS + ${OPT_TRACKING_BLOCKS_HEADERS} + gps_l1_ca_dll_pll_tracking_gpu_cc.h + ) + set(OPT_TRACKING_INCLUDES + ${OPT_TRACKING_INCLUDES} + ${CUDA_INCLUDE_DIRS} + ) + set(OPT_TRACKING_LIBRARIES + ${OPT_TRACKING_LIBRARIES} + ${CUDA_LIBRARIES} + ) endif(ENABLE_CUDA) if(ENABLE_FPGA) - set(OPT_TRACKING_BLOCKS_SOURCES ${OPT_TRACKING_BLOCKS_SOURCES} dll_pll_veml_tracking_fpga.cc) - set(OPT_TRACKING_BLOCKS_HEADERS ${OPT_TRACKING_BLOCKS_HEADERS} dll_pll_veml_tracking_fpga.h) + set(OPT_TRACKING_BLOCKS_SOURCES + ${OPT_TRACKING_BLOCKS_SOURCES} + dll_pll_veml_tracking_fpga.cc + ) + set(OPT_TRACKING_BLOCKS_HEADERS + ${OPT_TRACKING_BLOCKS_HEADERS} + dll_pll_veml_tracking_fpga.h + ) endif(ENABLE_FPGA) set(TRACKING_GR_BLOCKS_SOURCES - galileo_e1_tcp_connector_tracking_cc.cc - gps_l1_ca_tcp_connector_tracking_cc.cc - gps_l1_ca_dll_pll_c_aid_tracking_cc.cc - gps_l1_ca_dll_pll_c_aid_tracking_sc.cc - glonass_l1_ca_dll_pll_tracking_cc.cc - glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc - glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc - gps_l1_ca_kf_tracking_cc.cc - glonass_l2_ca_dll_pll_tracking_cc.cc - glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc - glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc - dll_pll_veml_tracking.cc - ${OPT_TRACKING_BLOCKS_SOURCES} + galileo_e1_tcp_connector_tracking_cc.cc + gps_l1_ca_tcp_connector_tracking_cc.cc + gps_l1_ca_dll_pll_c_aid_tracking_cc.cc + gps_l1_ca_dll_pll_c_aid_tracking_sc.cc + glonass_l1_ca_dll_pll_tracking_cc.cc + glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc + glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc + gps_l1_ca_kf_tracking_cc.cc + glonass_l2_ca_dll_pll_tracking_cc.cc + glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc + glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc + dll_pll_veml_tracking.cc + ${OPT_TRACKING_BLOCKS_SOURCES} ) set(TRACKING_GR_BLOCKS_HEADERS - galileo_e1_tcp_connector_tracking_cc.h - gps_l1_ca_tcp_connector_tracking_cc.h - gps_l1_ca_dll_pll_c_aid_tracking_cc.h - gps_l1_ca_dll_pll_c_aid_tracking_sc.h - glonass_l1_ca_dll_pll_tracking_cc.h - glonass_l1_ca_dll_pll_c_aid_tracking_cc.h - glonass_l1_ca_dll_pll_c_aid_tracking_sc.h - gps_l1_ca_kf_tracking_cc.h - glonass_l2_ca_dll_pll_tracking_cc.h - glonass_l2_ca_dll_pll_c_aid_tracking_cc.h - glonass_l2_ca_dll_pll_c_aid_tracking_sc.h - dll_pll_veml_tracking.h - ${OPT_TRACKING_BLOCKS_HEADERS} + galileo_e1_tcp_connector_tracking_cc.h + gps_l1_ca_tcp_connector_tracking_cc.h + gps_l1_ca_dll_pll_c_aid_tracking_cc.h + gps_l1_ca_dll_pll_c_aid_tracking_sc.h + glonass_l1_ca_dll_pll_tracking_cc.h + glonass_l1_ca_dll_pll_c_aid_tracking_cc.h + glonass_l1_ca_dll_pll_c_aid_tracking_sc.h + gps_l1_ca_kf_tracking_cc.h + glonass_l2_ca_dll_pll_tracking_cc.h + glonass_l2_ca_dll_pll_c_aid_tracking_cc.h + glonass_l2_ca_dll_pll_c_aid_tracking_sc.h + dll_pll_veml_tracking.h + ${OPT_TRACKING_BLOCKS_HEADERS} ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${OPT_TRACKING_INCLUDES} + ${MATIO_INCLUDE_DIRS} ) if(ENABLE_GENERIC_ARCH) - add_definitions( -DGENERIC_ARCH=1 ) + add_definitions(-DGENERIC_ARCH=1) endif(ENABLE_GENERIC_ARCH) list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) -target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} gnss_sdr_flags gnss_sp_libs ${Boost_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${MATIO_LIBRARIES} ${OPT_TRACKING_LIBRARIES}) +target_link_libraries(tracking_gr_blocks + tracking_lib + ${GNURADIO_RUNTIME_LIBRARIES} + gnss_sdr_flags gnss_sp_libs + ${Boost_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${MATIO_LIBRARIES} + ${OPT_TRACKING_LIBRARIES} +) if(NOT VOLK_GNSSSDR_FOUND) if(MATIO_FOUND) diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 72d3c66e0..7cce9e680 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -22,44 +22,43 @@ if(ENABLE_CUDA) # set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --gpu-architecture sm_30) list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30; -std=c++11;-O3; -use_fast_math -default-stream per-thread") set(CUDA_PROPAGATE_HOST_FLAGS OFF) - CUDA_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}) + cuda_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(LIB_TYPE STATIC) #set the lib type - CUDA_ADD_LIBRARY(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) + cuda_add_library(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB) - set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS} ) + set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS}) endif(ENABLE_CUDA) - set(TRACKING_LIB_SOURCES - cpu_multicorrelator.cc - cpu_multicorrelator_real_codes.cc - cpu_multicorrelator_16sc.cc - lock_detectors.cc - tcp_communication.cc - tcp_packet_data.cc - tracking_2nd_DLL_filter.cc - tracking_2nd_PLL_filter.cc - tracking_discriminators.cc - tracking_FLL_PLL_filter.cc - tracking_loop_filter.cc - dll_pll_conf.cc - bayesian_estimation.cc + cpu_multicorrelator.cc + cpu_multicorrelator_real_codes.cc + cpu_multicorrelator_16sc.cc + lock_detectors.cc + tcp_communication.cc + tcp_packet_data.cc + tracking_2nd_DLL_filter.cc + tracking_2nd_PLL_filter.cc + tracking_discriminators.cc + tracking_FLL_PLL_filter.cc + tracking_loop_filter.cc + dll_pll_conf.cc + bayesian_estimation.cc ) set(TRACKING_LIB_HEADERS - cpu_multicorrelator.h - cpu_multicorrelator_real_codes.h - cpu_multicorrelator_16sc.h - lock_detectors.h - tcp_communication.h - tcp_packet_data.h - tracking_2nd_DLL_filter.h - tracking_2nd_PLL_filter.h - tracking_discriminators.h - tracking_FLL_PLL_filter.h - tracking_loop_filter.h - dll_pll_conf.h - bayesian_estimation.h + cpu_multicorrelator.h + cpu_multicorrelator_real_codes.h + cpu_multicorrelator_16sc.h + lock_detectors.h + tcp_communication.h + tcp_packet_data.h + tracking_2nd_DLL_filter.h + tracking_2nd_PLL_filter.h + tracking_discriminators.h + tracking_FLL_PLL_filter.h + tracking_loop_filter.h + dll_pll_conf.h + bayesian_estimation.h ) if(ENABLE_FPGA) @@ -68,34 +67,41 @@ if(ENABLE_FPGA) endif(ENABLE_FPGA) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${OPT_TRACKING_INCLUDES} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) if(ENABLE_GENERIC_ARCH) - add_definitions( -DGENERIC_ARCH=1 ) + add_definitions(-DGENERIC_ARCH=1) endif(ENABLE_GENERIC_ARCH) -if (SSE3_AVAILABLE) - add_definitions( -DHAVE_SSE3=1 ) +if(SSE3_AVAILABLE) + add_definitions(-DHAVE_SSE3=1) endif(SSE3_AVAILABLE) - list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) + source_group(Headers FILES ${TRACKING_LIB_HEADERS}) -target_link_libraries(tracking_lib ${OPT_TRACKING_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(tracking_lib + ${OPT_TRACKING_LIBRARIES} + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} +) if(VOLK_GNSSSDR_FOUND) add_dependencies(tracking_lib glog-${glog_RELEASE}) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 0c6bbd4c2..bbecef4d0 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(supl) if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) set(CORE_LIBS_SOURCES diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 4faecafda..65a639e10 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -21,12 +21,12 @@ list(SORT ASN_RRLP_SOURCES) file(GLOB ASN_SUPL_SOURCES "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl/*.c") list(SORT ASN_SUPL_SOURCES) -set (SUPL_SOURCES - supl.c - ) +set(SUPL_SOURCES + supl.c +) if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) include_directories( @@ -35,7 +35,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl ${GNUTLS_INCLUDE_DIR} - ) +) if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") @@ -44,6 +44,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") endif(CMAKE_C_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") -add_library (supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) -target_link_libraries (supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) +add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) +target_link_libraries(supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C) diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 8bba7c587..54ee2a589 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -18,16 +18,15 @@ set(CORE_MONITOR_LIBS_SOURCES - gnss_synchro_monitor.cc - gnss_synchro_udp_sink.cc + gnss_synchro_monitor.cc + gnss_synchro_udp_sink.cc ) set(CORE_MONITOR_LIBS_HEADERS - gnss_synchro_monitor.h - gnss_synchro_udp_sink.h + gnss_synchro_monitor.h + gnss_synchro_udp_sink.h ) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/system_parameters @@ -40,7 +39,13 @@ include_directories( list(SORT CORE_MONITOR_LIBS_HEADERS) list(SORT CORE_MONITOR_LIBS_SOURCES) -add_library(core_monitor_lib ${CORE_MONITOR_LIBS_SOURCES} ${CORE_MONITOR_LIBS_HEADERS}) +add_library(core_monitor_lib + ${CORE_MONITOR_LIBS_SOURCES} + ${CORE_MONITOR_LIBS_HEADERS} +) + source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) + target_link_libraries(core_monitor_lib ${Boost_LIBRARIES}) + add_dependencies(core_monitor_lib glog-${glog_RELEASE}) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 461320653..89540b525 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -18,38 +18,38 @@ set(GNSS_RECEIVER_SOURCES - control_thread.cc - control_message_factory.cc - file_configuration.cc - gnss_block_factory.cc - gnss_flowgraph.cc - in_memory_configuration.cc - tcp_cmd_interface.cc + control_thread.cc + control_message_factory.cc + file_configuration.cc + gnss_block_factory.cc + gnss_flowgraph.cc + in_memory_configuration.cc + tcp_cmd_interface.cc ) set(GNSS_RECEIVER_HEADERS - control_thread.h - control_message_factory.h - file_configuration.h - gnss_block_factory.h - gnss_flowgraph.h - in_memory_configuration.h - concurrent_map.h - concurrent_queue.h - control_message.h + control_thread.h + control_message_factory.h + file_configuration.h + gnss_block_factory.h + gnss_flowgraph.h + in_memory_configuration.h + concurrent_map.h + concurrent_queue.h + control_message.h ) if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) - add_definitions(-DMODERN_GNURADIO=1) + add_definitions(-DMODERN_GNURADIO=1) endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) if(ENABLE_CUDA) - add_definitions(-DCUDA_GPU_ACCEL=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) + add_definitions(-DCUDA_GPU_ACCEL=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) endif(ENABLE_CUDA) if(ENABLE_FPGA) - add_definitions(-DENABLE_FPGA=1) + add_definitions(-DENABLE_FPGA=1) endif(ENABLE_FPGA) if(ENABLE_RAW_UDP) @@ -57,7 +57,7 @@ if(ENABLE_RAW_UDP) endif(ENABLE_RAW_UDP) if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105000) if(OPENSSL_FOUND) @@ -88,7 +88,7 @@ endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) #Enable OpenCL if found in the system if(OPENCL_FOUND) - message(STATUS "Adding processing blocks implemented using OpenCL" ) + message(STATUS "Adding processing blocks implemented using OpenCL") add_definitions(-DOPENCL_BLOCKS=1) else(OPENCL_FOUND) add_definitions(-DOPENCL_BLOCKS=0) @@ -96,13 +96,13 @@ endif(OPENCL_FOUND) #enable SDR Hardware based on fmcomms2 if(ENABLE_PLUTOSDR) - add_definitions(-DPLUTOSDR_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + add_definitions(-DPLUTOSDR_DRIVER=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR) if(ENABLE_FMCOMMS2) - add_definitions(-DFMCOMMS2_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + add_definitions(-DFMCOMMS2_DRIVER=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_FMCOMMS2) if(ENABLE_AD9361) @@ -110,98 +110,105 @@ if(ENABLE_AD9361) set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_AD9361) -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions( -DGR_GREATER_38=1 ) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${OPT_RECEIVER_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/libs + ${CMAKE_SOURCE_DIR}/src/core/libs/supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/core/monitor + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} + ${OPT_RECEIVER_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) list(SORT GNSS_RECEIVER_HEADERS) list(SORT GNSS_RECEIVER_SOURCES) -set(GNSS_RECEIVER_INTERFACE_HEADERS ../interfaces/acquisition_interface.h - ../interfaces/channel_interface.h - ../interfaces/configuration_interface.h - ../interfaces/gnss_block_interface.h - ../interfaces/observables_interface.h - ../interfaces/pvt_interface.h - ../interfaces/telemetry_decoder_interface.h - ../interfaces/tracking_interface.h +set(GNSS_RECEIVER_INTERFACE_HEADERS + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/acquisition_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/channel_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/configuration_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/gnss_block_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/observables_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/pvt_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/telemetry_decoder_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/tracking_interface.h ) list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) -add_library(gnss_rx ${GNSS_RECEIVER_SOURCES} ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS}) +add_library(gnss_rx + ${GNSS_RECEIVER_SOURCES} + ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS} +) + source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS}) -target_link_libraries(gnss_rx ${Boost_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - gnss_system_parameters - gnss_sp_libs - signal_source_adapters - datatype_adapters - input_filter_adapters - conditioner_adapters - resampler_adapters - acq_adapters - tracking_adapters - channel_adapters - telemetry_decoder_libswiftcnav - telemetry_decoder_lib - telemetry_decoder_adapters - obs_adapters - pvt_adapters - pvt_lib - rx_core_lib - core_monitor_lib +target_link_libraries(gnss_rx + ${Boost_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + gnss_system_parameters + gnss_sp_libs + signal_source_adapters + datatype_adapters + input_filter_adapters + conditioner_adapters + resampler_adapters + acq_adapters + tracking_adapters + channel_adapters + telemetry_decoder_libswiftcnav + telemetry_decoder_lib + telemetry_decoder_adapters + obs_adapters + pvt_adapters + pvt_lib + rx_core_lib + core_monitor_lib ) diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 29fc91399..4593d8e1f 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -16,87 +16,87 @@ # along with GNSS-SDR. If not, see . # + set(SYSTEM_PARAMETERS_SOURCES - gnss_satellite.cc - gnss_signal.cc - gps_navigation_message.cc - gps_ephemeris.cc - gps_iono.cc - gps_almanac.cc - gps_utc_model.cc - gps_acq_assist.cc - agnss_ref_time.cc - agnss_ref_location.cc - galileo_utc_model.cc - galileo_ephemeris.cc - galileo_almanac.cc - galileo_almanac_helper.cc - galileo_iono.cc - galileo_navigation_message.cc - sbas_ephemeris.cc - galileo_fnav_message.cc - gps_cnav_ephemeris.cc - gps_cnav_navigation_message.cc - gps_cnav_iono.cc - gps_cnav_utc_model.cc - rtcm.cc - glonass_gnav_ephemeris.cc - glonass_gnav_almanac.cc - glonass_gnav_utc_model.cc - glonass_gnav_navigation_message.cc + gnss_satellite.cc + gnss_signal.cc + gps_navigation_message.cc + gps_ephemeris.cc + gps_iono.cc + gps_almanac.cc + gps_utc_model.cc + gps_acq_assist.cc + agnss_ref_time.cc + agnss_ref_location.cc + galileo_utc_model.cc + galileo_ephemeris.cc + galileo_almanac.cc + galileo_almanac_helper.cc + galileo_iono.cc + galileo_navigation_message.cc + sbas_ephemeris.cc + galileo_fnav_message.cc + gps_cnav_ephemeris.cc + gps_cnav_navigation_message.cc + gps_cnav_iono.cc + gps_cnav_utc_model.cc + rtcm.cc + glonass_gnav_ephemeris.cc + glonass_gnav_almanac.cc + glonass_gnav_utc_model.cc + glonass_gnav_navigation_message.cc ) set(SYSTEM_PARAMETERS_HEADERS - gnss_satellite.h - gnss_signal.h - gps_navigation_message.h - gps_ephemeris.h - gps_iono.h - gps_almanac.h - gps_utc_model.h - gps_acq_assist.h - agnss_ref_time.h - agnss_ref_location.h - galileo_utc_model.h - galileo_ephemeris.h - galileo_almanac.h - galileo_almanac_helper.h - galileo_iono.h - galileo_navigation_message.h - sbas_ephemeris.h - galileo_fnav_message.h - gps_cnav_ephemeris.h - gps_cnav_navigation_message.h - gps_cnav_iono.h - gps_cnav_utc_model.h - rtcm.h - glonass_gnav_ephemeris.h - glonass_gnav_almanac.h - glonass_gnav_utc_model.h - glonass_gnav_navigation_message.h - display.h - Galileo_E1.h - Galileo_E5a.h - GLONASS_L1_L2_CA.h - gnss_frequencies.h - gnss_obs_codes.h - gnss_synchro.h - GPS_CNAV.h - GPS_L1_CA.h - GPS_L2C.h - GPS_L5.h - MATH_CONSTANTS.h + gnss_satellite.h + gnss_signal.h + gps_navigation_message.h + gps_ephemeris.h + gps_iono.h + gps_almanac.h + gps_utc_model.h + gps_acq_assist.h + agnss_ref_time.h + agnss_ref_location.h + galileo_utc_model.h + galileo_ephemeris.h + galileo_almanac.h + galileo_almanac_helper.h + galileo_iono.h + galileo_navigation_message.h + sbas_ephemeris.h + galileo_fnav_message.h + gps_cnav_ephemeris.h + gps_cnav_navigation_message.h + gps_cnav_iono.h + gps_cnav_utc_model.h + rtcm.h + glonass_gnav_ephemeris.h + glonass_gnav_almanac.h + glonass_gnav_utc_model.h + glonass_gnav_navigation_message.h + display.h + Galileo_E1.h + Galileo_E5a.h + GLONASS_L1_L2_CA.h + gnss_frequencies.h + gnss_obs_codes.h + gnss_synchro.h + GPS_CNAV.h + GPS_L1_CA.h + GPS_L2C.h + GPS_L5.h + MATH_CONSTANTS.h ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${GLOG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${GLOG_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ) link_directories(${Boost_LIBRARY_DIR}) @@ -104,7 +104,13 @@ link_directories(${Boost_LIBRARY_DIR}) list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) -add_library(gnss_system_parameters ${SYSTEM_PARAMETERS_SOURCES} ${SYSTEM_PARAMETERS_HEADERS}) +add_library(gnss_system_parameters + ${SYSTEM_PARAMETERS_SOURCES} + ${SYSTEM_PARAMETERS_HEADERS} +) + source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) + add_dependencies(gnss_system_parameters rtklib_lib glog-${glog_RELEASE}) + target_link_libraries(gnss_system_parameters rtklib_lib ${Boost_LIBRARIES}) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 4dff21617..94a6344e6 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -32,7 +32,7 @@ if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) if(ENABLE_CUDA) @@ -47,65 +47,68 @@ if(ORC_FOUND) endif(ORC_FOUND) include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${GNSS_SDR_OPTIONAL_HEADERS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/monitor + ${CMAKE_SOURCE_DIR}/src/core/libs + ${CMAKE_SOURCE_DIR}/src/core/libs/supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} + ${GNSS_SDR_OPTIONAL_HEADERS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${OPT_GNSSSDR_INCLUDE_DIRS} ) -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") if(OS_IS_MACOSX) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MAC_LIBRARIES "-framework Accelerate -lc++") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(MAC_LIBRARIES "-framework Accelerate -lc++") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(OS_IS_MACOSX) add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) -add_custom_command(TARGET gnss-sdr POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) +add_custom_command(TARGET gnss-sdr + POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ +) -target_link_libraries(gnss-sdr ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - gnss_sp_libs - gnss_sdr_flags - gnss_rx ) +target_link_libraries(gnss-sdr + ${MAC_LIBRARIES} + ${THREAD_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${GNSS_SDR_OPTIONAL_LIBS} + gnss_sp_libs + gnss_sdr_flags + gnss_rx +) install(TARGETS gnss-sdr - RUNTIME DESTINATION bin - COMPONENT "gnss-sdr" ) + RUNTIME DESTINATION bin + COMPONENT "gnss-sdr") install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr - FILES_MATCHING PATTERN "*.conf" ) + FILES_MATCHING PATTERN "*.conf") install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf - RENAME default.conf) + RENAME default.conf) if(NOT VOLK_GNSSSDR_FOUND) install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile DESTINATION bin COMPONENT "volk_gnsssdr") @@ -123,22 +126,21 @@ find_program(GZIP if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz") + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz") install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz DESTINATION share/man/man1) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/changelog - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz") + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz") install(FILES ${CMAKE_BINARY_DIR}/changelog.gz DESTINATION share/doc/gnss-sdr) if(NOT VOLK_GNSSSDR_FOUND) - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz") - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz") - - install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1) - install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1) + execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz") + execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz") + install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1) + install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1) endif(NOT VOLK_GNSSSDR_FOUND) endif(NOT GZIP_NOTFOUND) diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 252131884..817676b30 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -18,13 +18,12 @@ if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) set(FRONT_END_CAL_SOURCES front_end_cal.cc) set(FRONT_END_CAL_HEADERS front_end_cal.h) - include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/interfaces @@ -50,69 +49,69 @@ include_directories( add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS}) source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) -target_link_libraries(front_end_cal_lib ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_sdr_flags - gnss_rx - channel_fsm +target_link_libraries(front_end_cal_lib + ${MAC_LIBRARIES} + ${THREAD_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + ${GNSS_SDR_OPTIONAL_LIBS} + rx_core_lib + gnss_sdr_flags + gnss_rx + channel_fsm ) add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) -add_definitions( -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") +add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) add_custom_command(TARGET front-end-cal POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$) + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$) - -target_link_libraries(front-end-cal ${MAC_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_rx - front_end_cal_lib +target_link_libraries(front-end-cal + ${MAC_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + ${GNSS_SDR_OPTIONAL_LIBS} + rx_core_lib + gnss_rx + front_end_cal_lib ) - install(TARGETS front-end-cal - RUNTIME DESTINATION bin - COMPONENT "front-end-cal" + RUNTIME DESTINATION bin + COMPONENT "front-end-cal" ) find_program(GZIP gzip - /bin - /usr/bin - /usr/local/bin - /opt/local/bin - /sbin - ) + /bin + /usr/bin + /usr/local/bin + /opt/local/bin + /sbin +) if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz") + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz") install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1) endif(NOT GZIP_NOTFOUND) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 01c888381..0461d6185 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -20,8 +20,8 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) - set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include ) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) @@ -43,17 +43,19 @@ target_link_libraries(rinex2assist ${GPSTK_LIBRARY} ${GFlags_LIBS} gnss_sp_libs - gnss_rx) + gnss_rx +) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_custom_command(TARGET rinex2assist POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$) + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ +) install(TARGETS rinex2assist - RUNTIME DESTINATION bin - COMPONENT "rinex2assist" + RUNTIME DESTINATION bin + COMPONENT "rinex2assist" ) From a59ffca8a1c656b2480558e4daaf421d65fb07bf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 11:59:49 +0100 Subject: [PATCH 02/52] Fix Galileo sats position computation from Almanac data --- .../libs/rtklib/rtklib_conversions.cc | 20 ++++++++++--------- src/core/receiver/control_thread.cc | 4 +++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 3106b6bc1..c913ab459 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -314,32 +314,34 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.f1 = gps_alm.d_A_f1; rtklib_alm.toas = gps_alm.i_Toa; - return rtklib_alm; } + + alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) { alm_t rtklib_alm; rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - rtklib_alm.sat = gal_alm.i_satellite_PRN; + rtklib_alm.sat = gal_alm.i_satellite_PRN + NSATGPS + NSATGLO; rtklib_alm.svh = gal_alm.E1B_HS; rtklib_alm.svconf = gal_alm.E1B_HS; rtklib_alm.week = gal_alm.i_WNa; - rtklib_alm.toa = gpst2time(gal_alm.i_WNa, gal_alm.i_Toa); + gtime_t toa; + toa.time = gal_alm.i_Toa; + rtklib_alm.toa = toa; rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; rtklib_alm.e = gal_alm.d_e_eccentricity; - rtklib_alm.i0 = gal_alm.d_Delta_i + 0.31111; - rtklib_alm.OMG0 = gal_alm.d_OMEGA0; - rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT; - rtklib_alm.omg = gal_alm.d_OMEGA; - rtklib_alm.M0 = gal_alm.d_M_0; + rtklib_alm.i0 = (gal_alm.d_Delta_i + 56.0 / 180.0) * PI; + rtklib_alm.OMG0 = gal_alm.d_OMEGA0 * PI; + rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT * PI; + rtklib_alm.omg = gal_alm.d_OMEGA * PI; + rtklib_alm.M0 = gal_alm.d_M_0 * PI; rtklib_alm.f0 = gal_alm.d_A_f0; rtklib_alm.f1 = gal_alm.d_A_f1; rtklib_alm.toas = gal_alm.i_Toa; - return rtklib_alm; } diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 12148d811..dcd751f58 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -931,7 +931,9 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; - alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); + gtime_t gal_gtime; + gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); + alm2pos(gal_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; From 4bdb8c3bc4fb515ed6c6fbbba4b89d3e0bccfc97 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 15:19:36 +0100 Subject: [PATCH 03/52] Fix computation of satellite elevation when using the GPS Almanac --- .../libs/rtklib/rtklib_conversions.cc | 14 ++++---- src/core/receiver/control_thread.cc | 32 ++++++++++++++----- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index c913ab459..4eb8d218f 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -302,14 +302,16 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.svh = gps_alm.i_SV_health; rtklib_alm.svconf = gps_alm.i_AS_status; rtklib_alm.week = gps_alm.i_WNa; - rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.i_Toa); + gtime_t toa; + toa.time = gps_alm.i_Toa; + rtklib_alm.toa = toa; rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; rtklib_alm.e = gps_alm.d_e_eccentricity; - rtklib_alm.i0 = gps_alm.d_Delta_i + 0.3; - rtklib_alm.OMG0 = gps_alm.d_OMEGA0; - rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT; - rtklib_alm.omg = gps_alm.d_OMEGA; - rtklib_alm.M0 = gps_alm.d_M_0; + rtklib_alm.i0 = (gps_alm.d_Delta_i + 0.3) * PI; + rtklib_alm.OMG0 = gps_alm.d_OMEGA0 * PI; + rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT * PI; + rtklib_alm.omg = gps_alm.d_OMEGA * PI; + rtklib_alm.M0 = gps_alm.d_M_0 * PI; rtklib_alm.f0 = gps_alm.d_A_f0; rtklib_alm.f1 = gps_alm.d_A_f1; rtklib_alm.toas = gps_alm.i_Toa; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index dcd751f58..0aa4f3ac7 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -851,7 +852,8 @@ std::vector> ControlThread::get_visible_sats(time // 3. loop through all the available ephemeris or almanac and compute satellite positions and elevations // store visible satellites in a vector of pairs to associate an elevation to the each satellite std::vector> available_satellites; - + std::vector visible_gps; + std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); struct tm tstruct; char buf[80]; @@ -880,6 +882,7 @@ std::vector> ControlThread::get_visible_sats(time std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + visible_gps.push_back(it->second.i_satellite_PRN); } } @@ -902,6 +905,7 @@ std::vector> ControlThread::get_visible_sats(time std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + visible_gal.push_back(it->second.i_satellite_PRN); } } @@ -911,17 +915,23 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; + gps_gtime.time = fmod(utc2gpst(gps_gtime).time, 604800); alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); // push sat + std::vector::iterator it2; if (El > 0) { - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; - available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + it2 = std::find(visible_gps.begin(), visible_gps.end(), it->second.i_satellite_PRN); + if (it2 == visible_gps.end()) + { + std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + } } } @@ -939,11 +949,16 @@ std::vector> ControlThread::get_visible_sats(time arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); // push sat + std::vector::iterator it2; if (El > 0) { - std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; - available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + it2 = std::find(visible_gal.begin(), visible_gal.end(), it->second.i_satellite_PRN); + if (it2 == visible_gal.end()) + { + std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + } } } @@ -951,7 +966,8 @@ std::vector> ControlThread::get_visible_sats(time std::sort(available_satellites.begin(), available_satellites.end(), [](const std::pair &a, const std::pair &b) { // use lambda. Cleaner and easier to read return a.first < b.first; }); - // std::reverse(available_satellites.begin(), available_satellites.end()); + // provide list starting from satellites with higher elevation + std::reverse(available_satellites.begin(), available_satellites.end()); return available_satellites; } From f3e32e30e9503f95dc815dc5b9ea266d0a275597 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 17:07:01 +0100 Subject: [PATCH 04/52] Fix computation of sat positions with GPS Almanac --- src/core/receiver/control_thread.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 0aa4f3ac7..0b1a1aae0 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -734,7 +734,9 @@ void ControlThread::init() else { // fill agnss_ref_time_ - agnss_ref_time_.d_tv_sec = 0; // fill + struct tm tm; + strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); + agnss_ref_time_.d_tv_sec = timegm(&tm); agnss_ref_time_.valid = true; } } @@ -861,7 +863,7 @@ std::vector> ControlThread::get_visible_sats(time strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); std::string str_time = std::string(buf); std::cout << "Get visible satellites at " << str_time - << " UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; + << "UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) @@ -915,8 +917,9 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; - gps_gtime.time = fmod(utc2gpst(gps_gtime).time, 604800); - alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); + gtime_t aux_gtime; + aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); + alm2pos(aux_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; From a8fe18f43586b5de56acc6ba7c4c9bbfa61cdd04 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 23 Nov 2018 16:28:28 +0100 Subject: [PATCH 05/52] Fix defects detected by XCode --- src/algorithms/PVT/adapters/rtklib_pvt.h | 2 -- src/algorithms/libs/galileo_e1_signal_processing.cc | 4 ++-- src/algorithms/libs/galileo_e5_signal_processing.cc | 10 ++-------- src/algorithms/libs/gps_sdr_signal_processing.cc | 2 +- src/core/system_parameters/galileo_fnav_message.cc | 2 +- .../system_parameters/galileo_navigation_message.cc | 2 +- .../system_parameters/gps_cnav_navigation_message.cc | 2 +- src/core/system_parameters/gps_navigation_message.cc | 3 ++- .../galileo_fnav_inav_decoder_test.cc | 6 +++--- 9 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index bc753a560..ed2bf7da4 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -95,8 +95,6 @@ public: private: rtklib_pvt_cc_sptr pvt_; rtk_t rtk; - bool dump_; - std::string dump_filename_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 5078fd479..3aaf2047c 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -126,8 +126,8 @@ void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3]) const float alpha = sqrt(10.0 / 11.0); const float beta = sqrt(1.0 / 11.0); - int32_t sinboc_11[12 * 4092]; // _codeLength not accepted by Clang - int32_t sinboc_61[12 * 4092]; + int32_t sinboc_11[12 * 4092] = {0}; // _codeLength not accepted by Clang + int32_t sinboc_61[12 * 4092] = {0}; galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 29d7615dd..82ef4ed54 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -131,12 +131,6 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, char _Sig { _dest[(i + delay) % _samplesPerCode] = _code[i]; } - if (_fs != _codeFreqBasis) - { - free(_code); - } - else - { - delete[] _code; - } + + delete[] _code; } diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index b0a49fbd0..db3c33eff 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -131,7 +131,7 @@ void gps_l1_ca_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift) void gps_l1_ca_code_gen_complex(std::complex* _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 1023; - int32_t ca_code_int[_code_length]; + int32_t ca_code_int[_code_length] = {0}; gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift); diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 42a4a7c1b..33cd59056 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -459,7 +459,7 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset start, end; std::chrono::duration elapsed_seconds(0); - + start = std::chrono::system_clock::now(); int repetitions = 10; // FNAV FULLY ENCODED FRAME double FNAV_frame[488] = {-1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -282,7 +282,7 @@ TEST_F(Galileo_FNAV_INAV_test, ValidationOfResults) EXPECT_EQ(decode_INAV_word(&INAV_frame_odd[0], 240), true); } }) << "Exception during INAV frame decoding"; - - + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; std::cout << "Galileo FNAV/INAV Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } From c7486ad723806012ae10a7b766b466266c7d6799 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 23 Nov 2018 16:38:20 +0100 Subject: [PATCH 06/52] Add some control to input parameters --- src/core/receiver/control_thread.cc | 158 ++++++++++++++++------------ 1 file changed, 90 insertions(+), 68 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 0b1a1aae0..63c3cc3fd 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -100,6 +100,94 @@ ControlThread::ControlThread(std::shared_ptr configurati } +void ControlThread::init() +{ + // Instantiates a control queue, a GNSS flowgraph, and a control message factory + control_queue_ = gr::msg_queue::make(0); + cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread + try + { + flowgraph_ = std::make_shared(configuration_, control_queue_); + } + catch (const boost::bad_lexical_cast &e) + { + std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; + } + control_message_factory_ = std::make_shared(); + stop_ = false; + processed_control_messages_ = 0; + applied_actions_ = 0; + supl_mcc = 0; + supl_mns = 0; + supl_lac = 0; + supl_ci = 0; + msqid = -1; + agnss_ref_location_ = Agnss_Ref_Location(); + agnss_ref_time_ = Agnss_Ref_Time(); + + std::string empty_string = ""; + std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); + std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); + if (ref_location_str.compare(empty_string) != 0) + { + std::vector vect; + std::stringstream ss(ref_location_str); + double d; + while (ss >> d) + { + vect.push_back(d); + if ((ss.peek() == ',') or (ss.peek() == ' ')) + ss.ignore(); + } + // fill agnss_ref_location_ + if (vect.size() >= 2) + { + if ((vect[0] < 90.0) and (vect[0] > -90) and (vect[1] < 180.0) and (vect[1] > -180.0)) + { + agnss_ref_location_.lat = vect[0]; + agnss_ref_location_.lon = vect[1]; + agnss_ref_location_.valid = true; + } + else + { + std::cerr << "GNSS-SDR.AGNSS_ref_location=" << ref_location_str << " is not a valid position." << std::endl; + agnss_ref_location_.valid = false; + } + } + } + if (ref_time_str.compare(empty_string) == 0) + { + // Make an educated guess + time_t rawtime; + time(&rawtime); + agnss_ref_time_.d_tv_sec = rawtime; + agnss_ref_time_.valid = true; + } + else + { + // fill agnss_ref_time_ + struct tm tm; + if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) + { + agnss_ref_time_.d_tv_sec = timegm(&tm); + if (agnss_ref_time_.d_tv_sec > 0) + { + agnss_ref_time_.valid = true; + } + else + { + std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Please use four digits for the year: DD/MM/YYYY HH:MM:SS" << std::endl; + } + } + else + { + std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Should be DD/MM/YYYY HH:MM:SS in UTC" << std::endl; + agnss_ref_location_.valid = false; + } + } +} + + ControlThread::~ControlThread() { // save navigation data to files @@ -110,7 +198,7 @@ ControlThread::~ControlThread() void ControlThread::telecommand_listener() { - int tcp_cmd_port = configuration_->property("Channel.telecontrol_tcp_port", 3333); + int tcp_cmd_port = configuration_->property("GNSS-SDR.telecontrol_tcp_port", 3333); cmd_interface_.run_cmd_server(tcp_cmd_port); } @@ -653,7 +741,7 @@ void ControlThread::assist_GNSS() } // If we have enough AGNSS data, make use of it - if (agnss_ref_location_.valid == true) // and agnss_ref_time_.valid == true and we have AGNSS data + if ((agnss_ref_location_.valid == true) and ((enable_gps_supl_assistance == true) or (enable_agnss_xml == true))) { // Get the list of visible satellites arma::vec ref_LLH = arma::zeros(3, 1); @@ -676,72 +764,6 @@ void ControlThread::assist_GNSS() } -void ControlThread::init() -{ - // Instantiates a control queue, a GNSS flowgraph, and a control message factory - control_queue_ = gr::msg_queue::make(0); - cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread - try - { - flowgraph_ = std::make_shared(configuration_, control_queue_); - } - catch (const boost::bad_lexical_cast &e) - { - std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; - } - control_message_factory_ = std::make_shared(); - stop_ = false; - processed_control_messages_ = 0; - applied_actions_ = 0; - supl_mcc = 0; - supl_mns = 0; - supl_lac = 0; - supl_ci = 0; - msqid = -1; - agnss_ref_location_ = Agnss_Ref_Location(); - agnss_ref_time_ = Agnss_Ref_Time(); - - std::string empty_string = ""; - std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); - std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); - if (ref_location_str.compare(empty_string) != 0) - { - std::vector vect; - std::stringstream ss(ref_location_str); - double d; - while (ss >> d) - { - vect.push_back(d); - if (ss.peek() == ',') - ss.ignore(); - } - // fill agnss_ref_location_ - if (vect.size() >= 2) - { - agnss_ref_location_.lat = vect[0]; - agnss_ref_location_.lon = vect[1]; - agnss_ref_location_.valid = true; - } - } - if (ref_time_str.compare(empty_string) == 0) - { - // Make an educated guess - time_t rawtime; - time(&rawtime); - agnss_ref_time_.d_tv_sec = rawtime; - agnss_ref_time_.valid = true; - } - else - { - // fill agnss_ref_time_ - struct tm tm; - strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); - agnss_ref_time_.d_tv_sec = timegm(&tm); - agnss_ref_time_.valid = true; - } -} - - void ControlThread::read_control_messages() { DLOG(INFO) << "Reading control messages from queue"; From 144269a268b4f6b99e286787b94925db5e0f9004 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 09:40:15 +0100 Subject: [PATCH 07/52] Minor cleaning --- src/core/receiver/control_thread.cc | 37 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 63c3cc3fd..fa7001e97 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -182,7 +182,7 @@ void ControlThread::init() else { std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Should be DD/MM/YYYY HH:MM:SS in UTC" << std::endl; - agnss_ref_location_.valid = false; + agnss_ref_time_.valid = false; } } } @@ -273,7 +273,7 @@ int ControlThread::run() stop_ = true; flowgraph_->disconnect(); -//Join keyboard thread +// Join keyboard thread #ifdef OLD_BOOST keyboard_thread_.timed_join(boost::posix_time::seconds(1)); sysv_queue_thread_.timed_join(boost::posix_time::seconds(1)); @@ -289,11 +289,11 @@ int ControlThread::run() if (restart_) { - return 42; //signal the gnss-sdr-harness.sh to restart the receiver program + return 42; // signal the gnss-sdr-harness.sh to restart the receiver program } else { - return 0; //normal shutdown + return 0; // normal shutdown } } @@ -590,7 +590,7 @@ void ControlThread::assist_GNSS() bool SUPL_read_gps_assistance_xml = configuration_->property("GNSS-SDR.SUPL_read_gps_assistance_xml", false); if (SUPL_read_gps_assistance_xml == true) { - // read assistance from file + // Read assistance from file if (read_assistance_from_XML()) { std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; @@ -740,7 +740,7 @@ void ControlThread::assist_GNSS() } } - // If we have enough AGNSS data, make use of it + // If AGNSS is enabled, make use of it if ((agnss_ref_location_.valid == true) and ((enable_gps_supl_assistance == true) or (enable_agnss_xml == true))) { // Get the list of visible satellites @@ -780,7 +780,6 @@ void ControlThread::read_control_messages() // Apply the corresponding control actions -// TODO: May be it is better to move the apply_action state machine to the control_thread void ControlThread::process_control_messages() { for (unsigned int i = 0; i < control_messages_->size(); i++) @@ -792,7 +791,7 @@ void ControlThread::process_control_messages() } else { - if (control_messages_->at(i)->who == 300) //some TC commands require also actions from controlthread + if (control_messages_->at(i)->who == 300) // some TC commands require also actions from control_thread { apply_action(control_messages_->at(i)->what); } @@ -824,32 +823,32 @@ void ControlThread::apply_action(unsigned int what) break; case 11: LOG(INFO) << "Receiver action COLDSTART"; - //delete all ephemeris and almanac information from maps (also the PVT map queue) + // delete all ephemeris and almanac information from maps (also the PVT map queue) pvt_ptr = flowgraph_->get_pvt(); pvt_ptr->clear_ephemeris(); - //todo: reorder the satellite queues to the receiver default startup order. - //This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites + // todo: reorder the satellite queues to the receiver default startup order. + // This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites break; case 12: LOG(INFO) << "Receiver action HOTSTART"; visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); - //reorder the satellite queue to acquire first those visible satellites + // reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - //start again the satellite acquisitions (done in chained apply_action to flowgraph) + // start again the satellite acquisitions (done in chained apply_action to flowgraph) break; case 13: LOG(INFO) << "Receiver action WARMSTART"; - //delete all ephemeris and almanac information from maps (also the PVT map queue) + // delete all ephemeris and almanac information from maps (also the PVT map queue) pvt_ptr = flowgraph_->get_pvt(); pvt_ptr->clear_ephemeris(); - //load the ephemeris and the almanac from XML files (receiver assistance) + // load the ephemeris and the almanac from XML files (receiver assistance) read_assistance_from_XML(); - //call here the function that computes the set of visible satellites and its elevation - //for the date and time specified by the warm start command and the assisted position + // call here the function that computes the set of visible satellites and its elevation + // for the date and time specified by the warm start command and the assisted position get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); - //reorder the satellite queue to acquire first those visible satellites + // reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - //start again the satellite acquisitions (done in chained apply_action to flowgraph) + // start again the satellite acquisitions (done in chained apply_action to flowgraph) break; default: LOG(INFO) << "Unrecognized action."; From 1d659cb1de49982fe7aa3a0ed0f885e1485af858 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 09:41:21 +0100 Subject: [PATCH 08/52] Add protection to malformed time entry --- src/core/receiver/tcp_cmd_interface.cc | 71 ++++++++++++++------------ 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 9d3591488..ecb175e5f 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -35,6 +35,35 @@ #include +TcpCmdInterface::TcpCmdInterface() +{ + register_functions(); + keep_running_ = true; + control_queue_ = nullptr; + rx_latitude_ = 0; + rx_longitude_ = 0; + rx_altitude_ = 0; + receiver_utc_time_ = 0; +} + + +TcpCmdInterface::~TcpCmdInterface() +{ +} + + +void TcpCmdInterface::register_functions() +{ + functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); + functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); + functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); + functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); + functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); + functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); + functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); +} + + void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) { PVT_sptr_ = PVT_sptr; @@ -145,7 +174,11 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin { // Read commandline time parameter struct tm tm; - strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm); + if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) + { + response = "ERROR: time parameter malformed\n"; + return response; + } receiver_utc_time_ = timegm(&tm); // Read latitude, longitude, and height @@ -188,7 +221,11 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi // Read commandline time parameter struct tm tm; tmp_str = commandLine.at(1) + commandLine.at(2); - strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); + if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) + { + response = "ERROR: time parameter malformed\n"; + return response; + } receiver_utc_time_ = timegm(&tm); // Read latitude, longitude, and height @@ -247,30 +284,6 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co } -void TcpCmdInterface::register_functions() -{ - functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); - functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); - functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); - functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); - functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); - functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); - functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); -} - - -TcpCmdInterface::TcpCmdInterface() -{ - register_functions(); - keep_running_ = true; - control_queue_ = nullptr; - rx_latitude_ = 0; - rx_longitude_ = 0; - rx_altitude_ = 0; - receiver_utc_time_ = 0; -} - - void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) { control_queue_ = control_queue; @@ -385,9 +398,3 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) std::cout << "TCP Command Interface exception: address already in use" << std::endl; } } - - -TcpCmdInterface::~TcpCmdInterface() -{ - // TODO Auto-generated destructor stub -} From 87d1413447674231f31cbb8f7c09dba2934a51f6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 18:40:34 +0100 Subject: [PATCH 09/52] Make cmakelint happier --- CMakeLists.txt | 1100 ++++++++--------- src/CMakeLists.txt | 2 +- src/algorithms/PVT/adapters/CMakeLists.txt | 2 +- .../PVT/gnuradio_blocks/CMakeLists.txt | 2 +- src/algorithms/PVT/libs/CMakeLists.txt | 6 +- .../acquisition/adapters/CMakeLists.txt | 4 +- .../gnuradio_blocks/CMakeLists.txt | 18 +- .../acquisition/libs/CMakeLists.txt | 6 +- .../input_filter/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 6 +- src/algorithms/libs/CMakeLists.txt | 18 +- src/algorithms/libs/rtklib/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 4 +- .../resampler/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 6 +- .../signal_source/adapters/CMakeLists.txt | 84 +- .../gnuradio_blocks/CMakeLists.txt | 14 +- .../signal_source/libs/CMakeLists.txt | 12 +- .../gnuradio_blocks/CMakeLists.txt | 4 +- .../tracking/adapters/CMakeLists.txt | 5 +- .../tracking/gnuradio_blocks/CMakeLists.txt | 31 +- src/algorithms/tracking/libs/CMakeLists.txt | 12 +- src/core/libs/CMakeLists.txt | 4 +- src/core/libs/supl/CMakeLists.txt | 6 +- src/core/receiver/CMakeLists.txt | 60 +- src/core/system_parameters/CMakeLists.txt | 2 - src/main/CMakeLists.txt | 26 +- src/tests/CMakeLists.txt | 333 ++--- src/tests/system-tests/libs/CMakeLists.txt | 31 +- .../libs/CMakeLists.txt | 33 +- src/utils/CMakeLists.txt | 2 +- src/utils/front-end-cal/CMakeLists.txt | 5 +- src/utils/rinex2assist/CMakeLists.txt | 6 +- 33 files changed, 940 insertions(+), 910 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7366593ad..fceeb244b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ ######################################################################## if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ") -endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) +endif() cmake_minimum_required(VERSION 2.8) project(gnss-sdr CXX C) @@ -31,11 +31,11 @@ file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRE if(NOT CMAKE_PREFIX_PATH) if(DEFINED ENV{PYBOMBS_PREFIX}) set(CMAKE_PREFIX_PATH $ENV{PYBOMBS_PREFIX}) - endif(DEFINED ENV{PYBOMBS_PREFIX}) + endif() if(DEFINED ENV{SNAP}) set(CMAKE_PREFIX_PATH $ENV{SNAP}) - endif(DEFINED ENV{SNAP}) -endif(NOT CMAKE_PREFIX_PATH) + endif() +endif() @@ -72,7 +72,7 @@ option(ENABLE_OWN_ARMADILLO "Download and build Armadillo locally" OFF) option(ENABLE_LOG "Enable logging" ON) if(ENABLE_PACKAGING) set(ENABLE_GENERIC_ARCH ON) -endif(ENABLE_PACKAGING) +endif() # Testing option(ENABLE_UNIT_TESTING "Build unit tests" ON) @@ -82,12 +82,12 @@ option(ENABLE_SYSTEM_TESTING "Build system tests" OFF) option(ENABLE_SYSTEM_TESTING_EXTRA "Download external tools and build extra system tests" OFF) if(ENABLE_SYSTEM_TESTING_EXTRA) set(ENABLE_SYSTEM_TESTING ON) -endif(ENABLE_SYSTEM_TESTING_EXTRA) +endif() option(ENABLE_OWN_GPSTK "Force to download, build and link GPSTk for system tests, even if it is already installed" OFF) option(ENABLE_INSTALL_TESTS "Install QA code system-wide" OFF) if(ENABLE_FPGA) set(ENABLE_INSTALL_TESTS ON) -endif(ENABLE_FPGA) +endif() @@ -110,15 +110,15 @@ if(NOT ${THIS_IS_A_RELEASE}) OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) -endif(NOT ${THIS_IS_A_RELEASE}) +endif() set(VERSION_INFO_MAJOR_VERSION 0) -set(VERSION_INFO_API_COMPAT 0) +set(VERSION_INFO_API_COMPAT 0) if(${THIS_IS_A_RELEASE}) set(VERSION_INFO_MINOR_VERSION 9) -else(${THIS_IS_A_RELEASE}) +else() set(VERSION_INFO_MINOR_VERSION 9.git-${GIT_BRANCH}-${GIT_COMMIT_HASH}) -endif(${THIS_IS_A_RELEASE}) +endif() set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_INFO_MINOR_VERSION}) @@ -129,9 +129,9 @@ set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_I ######################################################################## include(ExternalProject) # Detect 64-bits machine -if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(ARCH_64BITS TRUE) -endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) +endif() set(OS_IS_MACOSX "") set(OS_IS_LINUX "") @@ -142,85 +142,85 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(OS_IS_LINUX TRUE) if(ARCH_64BITS) set(ARCH_ "(64 bits)") - else(ARCH_64BITS) + else() set(ARCH_ "(32 bits)") - endif(ARCH_64BITS) + endif() if(EXISTS "/etc/lsb-release") execute_process(COMMAND cat /etc/lsb-release - COMMAND grep DISTRIB_ID - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_DISTRIBUTION - RESULT_VARIABLE LINUX_ID_RESULT + COMMAND grep DISTRIB_ID + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_DISTRIBUTION + RESULT_VARIABLE LINUX_ID_RESULT ) execute_process(COMMAND cat /etc/lsb-release - COMMAND grep DISTRIB_RELEASE - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT + COMMAND grep DISTRIB_RELEASE + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT ) - endif(EXISTS "/etc/lsb-release") + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/linuxmint/info") - set(LINUX_DISTRIBUTION "LinuxMint") - execute_process(COMMAND cat /etc/linuxmint/info - COMMAND grep -m1 RELEASE - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - endif(EXISTS "/etc/linuxmint/info") - endif(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "LinuxMint") + execute_process(COMMAND cat /etc/linuxmint/info + COMMAND grep -m1 RELEASE + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + endif() + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/os-release") - execute_process(COMMAND cat /etc/os-release - COMMAND grep -m1 NAME - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_DISTRIBUTION - RESULT_VARIABLE LINUX_ID_RESULT - ) - execute_process(COMMAND cat /etc/os-release - COMMAND grep VERSION_ID - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - if(${LINUX_DISTRIBUTION} MATCHES "Debian") - set(LINUX_DISTRIBUTION "Debian") - file(READ /etc/debian_version LINUX_VER) - endif(${LINUX_DISTRIBUTION} MATCHES "Debian") - endif(EXISTS "/etc/os-release") - endif(NOT LINUX_DISTRIBUTION) + execute_process(COMMAND cat /etc/os-release + COMMAND grep -m1 NAME + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_DISTRIBUTION + RESULT_VARIABLE LINUX_ID_RESULT + ) + execute_process(COMMAND cat /etc/os-release + COMMAND grep VERSION_ID + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + if(${LINUX_DISTRIBUTION} MATCHES "Debian") + set(LINUX_DISTRIBUTION "Debian") + file(READ /etc/debian_version LINUX_VER) + endif() + endif() + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/redhat-release") - set(LINUX_DISTRIBUTION "Red Hat") - file(READ /etc/redhat-release LINUX_VER) - endif(EXISTS "/etc/redhat-release") - endif(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "Red Hat") + file(READ /etc/redhat-release LINUX_VER) + endif() + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/debian_version") - set(LINUX_DISTRIBUTION "Debian") - file(READ /etc/debian_version LINUX_VER) - endif(EXISTS "/etc/debian_version") - endif(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "Debian") + file(READ /etc/debian_version LINUX_VER) + endif() + endif() if(NOT LINUX_DISTRIBUTION) set(LINUX_DISTRIBUTION "Generic") set(LINUX_VER "Unknown") - endif(NOT LINUX_DISTRIBUTION) + endif() message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +endif() if(NOT LINUX_DISTRIBUTION) set(LINUX_DISTRIBUTION "Unknown") -endif(NOT LINUX_DISTRIBUTION) +endif() # Detect macOS / Mac OS X Version if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -233,48 +233,48 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Mojave 10.14") - endif(${DARWIN_VERSION} MATCHES "18") + endif() if(${DARWIN_VERSION} MATCHES "17") set(MACOS_HIGH_SIERRA TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS High Sierra 10.13") - endif(${DARWIN_VERSION} MATCHES "17") + endif() if(${DARWIN_VERSION} MATCHES "16") set(MACOS_SIERRA TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Sierra 10.12") - endif(${DARWIN_VERSION} MATCHES "16") + endif() if(${DARWIN_VERSION} MATCHES "15") set(MACOSX_EL_CAPITAN TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.11 El Capitan") - endif(${DARWIN_VERSION} MATCHES "15") + endif() if(${DARWIN_VERSION} MATCHES "14") set(MACOSX_YOSEMITE TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.10 Yosemite") - endif(${DARWIN_VERSION} MATCHES "14") + endif() if(${DARWIN_VERSION} MATCHES "13") set(MACOSX_MAVERICKS TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION="com.apple.compilers.llvm.clang.1_0") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.9 Mavericks") - endif(${DARWIN_VERSION} MATCHES "13") + endif() if(${DARWIN_VERSION} MATCHES "12") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.8 Mountain Lion") - endif(${DARWIN_VERSION} MATCHES "12") + endif() if(${DARWIN_VERSION} MATCHES "11") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.7 Lion") - endif(${DARWIN_VERSION} MATCHES "11") + endif() if(${DARWIN_VERSION} MATCHES "10") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.6 Snow Leopard") - endif(${DARWIN_VERSION} MATCHES "10") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + endif() +endif() # Define extra build types and select Release by default to get optimization flags include(GnsssdrBuildTypes) @@ -293,31 +293,31 @@ if(NOT CMAKE_BUILD_TYPE) if(ENABLE_GPERFTOOLS OR ENABLE_GPROF) set(CMAKE_BUILD_TYPE "RelWithDebInfo") message(STATUS "Build type not specified: defaulting to RelWithDebInfo.") - else(ENABLE_GPERFTOOLS OR ENABLE_GPROF) + else() set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: defaulting to Release.") - endif(ENABLE_GPERFTOOLS OR ENABLE_GPROF) -else(NOT CMAKE_BUILD_TYPE) + endif() +else() message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") -endif(NOT CMAKE_BUILD_TYPE) -GNSSSDR_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE}) +endif() +gnsssdr_check_build_type(${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") # allow 'large' files in 32 bit builds if(UNIX) add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES) -endif(UNIX) +endif() # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") -endif(CMAKE_MAKE_PROGRAM MATCHES "make") +endif() if(CMAKE_MAKE_PROGRAM MATCHES "ninja") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja") -endif(CMAKE_MAKE_PROGRAM MATCHES "ninja") +endif() if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME) set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}") -endif(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME) +endif() @@ -352,7 +352,7 @@ set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") if(CMAKE_VERSION VERSION_LESS "3.0.2") # Fix for CentOS 7 set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") -endif(CMAKE_VERSION VERSION_LESS "3.0.2") +endif() @@ -362,7 +362,7 @@ endif(CMAKE_VERSION VERSION_LESS "3.0.2") if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.") -endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) +endif() @@ -373,8 +373,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}") message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) -endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + endif() +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") execute_process(COMMAND @@ -385,25 +385,25 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # output is in error stream string(REGEX MATCH "^Apple.*" IS_APPLE ${_err}) if("${IS_APPLE}" STREQUAL "") - set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION}) - set(APPLE_STR "") - # retrieve the compiler's version from it - string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) - string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) - else("${IS_APPLE}" STREQUAL "") - set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) - set(APPLE_STR "Apple ") - # retrieve the compiler's version from it - string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) - string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) - endif("${IS_APPLE}" STREQUAL "") + set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION}) + set(APPLE_STR "") + # retrieve the compiler's version from it + string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) + string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) + else() + set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) + set(APPLE_STR "Apple ") + # retrieve the compiler's version from it + string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) + string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) + endif() if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - else(${_res} STREQUAL "0") + message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") + endif() + else() message(WARNING "\nCannot determine the version of the compiler selected to build GNSS-SDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${_res} STREQUAL "0") -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() @@ -413,10 +413,10 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(NOT OS_IS_MACOSX) if(CMAKE_CROSSCOMPILING) set(IS_ARM TRUE) - else(CMAKE_CROSSCOMPILING) + else() include(TestForARM) - endif(CMAKE_CROSSCOMPILING) -endif(NOT OS_IS_MACOSX) + endif() +endif() @@ -425,7 +425,7 @@ endif(NOT OS_IS_MACOSX) ################################################################################ if(NOT ENABLE_GENERIC_ARCH) include(TestForSSE) -endif(NOT ENABLE_GENERIC_ARCH) +endif() @@ -435,16 +435,16 @@ endif(NOT ENABLE_GENERIC_ARCH) if(CMAKE_VERSION VERSION_LESS 3.1) find_package(Threads REQUIRED) set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) -else(CMAKE_VERSION VERSION_LESS 3.1) +else() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) if(CMAKE_CROSSCOMPILING) set(THREADS_PREFER_PTHREAD_FLAG FALSE) - else(CMAKE_CROSSCOMPILING) + else() set(THREADS_PREFER_PTHREAD_FLAG TRUE) - endif(CMAKE_CROSSCOMPILING) + endif() find_package(Threads REQUIRED) set(THREAD_LIBRARIES Threads::Threads) -endif(CMAKE_VERSION VERSION_LESS 3.1) +endif() @@ -455,28 +455,28 @@ enable_testing() if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) if(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR $ENV{GTEST_DIR}) - endif(EXISTS $ENV{GTEST_DIR}) + endif() if(GTEST_DIR) message(STATUS "Googletest root folder set at ${GTEST_DIR}") find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR}) - if(LIBGTEST_DEV_DIR) - message(STATUS "Googletest has been found.") - else(LIBGTEST_DEV_DIR) - message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") - endif(LIBGTEST_DEV_DIR) + if(LIBGTEST_DEV_DIR) + message(STATUS "Googletest has been found.") + else() + message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") + endif() find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include) - else(GTEST_DIR) + else() find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include) if(LIBGTEST_DEV_DIR) - message(STATUS "Googletest package has been found.") - else(LIBGTEST_DEV_DIR) - message(STATUS " Googletest has not been found.") - message(STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") - message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") - endif(LIBGTEST_DEV_DIR) - endif(GTEST_DIR) -endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) + message(STATUS "Googletest package has been found.") + else() + message(STATUS " Googletest has not been found.") + message(STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") + message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") + endif() + endif() +endif() @@ -485,7 +485,7 @@ endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) ################################################################################ if(UNIX AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix -endif(UNIX AND EXISTS "/usr/lib64") +endif() set(Boost_ADDITIONAL_VERSIONS "1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49" "1.50.0" "1.50" "1.51.0" "1.51" "1.53.0" "1.53" "1.54.0" "1.54" @@ -501,7 +501,7 @@ set(Boost_USE_STATIC_LIBS OFF) find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED) if(NOT Boost_FOUND) message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") -endif(NOT Boost_FOUND) +endif() @@ -514,23 +514,23 @@ if(PC_GNURADIO_RUNTIME_VERSION) if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) set(GNURADIO_RUNTIME_FOUND) message(STATUS "The GNU Radio version installed in your system is too old.") - endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) -endif(PC_GNURADIO_RUNTIME_VERSION) + endif() +endif() if(NOT GNURADIO_RUNTIME_FOUND) message(STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}") if(OS_IS_LINUX) - message("Go to https://github.com/gnuradio/pybombs") - message("and follow the instructions to install GNU Radio in your system.") - message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") - endif(OS_IS_LINUX) + message("Go to https://github.com/gnuradio/pybombs") + message("and follow the instructions to install GNU Radio in your system.") + message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") + endif() if(OS_IS_MACOSX) - message("You can install it easily via Macports:") - message(" sudo port install gnuradio ") - message("Alternatively, you can use homebrew:") - message(" brew install gnuradio") - message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") - endif(OS_IS_MACOSX) -endif(NOT GNURADIO_RUNTIME_FOUND) + message("You can install it easily via Macports:") + message(" sudo port install gnuradio ") + message("Alternatively, you can use homebrew:") + message(" brew install gnuradio") + message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") + endif() +endif() if(NOT GNURADIO_ANALOG_FOUND) message(FATAL_ERROR "*** The gnuradio-analog library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") @@ -574,7 +574,6 @@ endif() # volk_gnsssdr module - GNSS-SDR's own VOLK library ################################################################################ find_package(VOLKGNSSSDR) - if(NOT VOLKGNSSSDR_FOUND) message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'") ############################### @@ -584,13 +583,13 @@ if(NOT VOLKGNSSSDR_FOUND) if(NOT PYTHON_MIN_VER_FOUND) message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR") - endif(NOT PYTHON_MIN_VER_FOUND) + endif() if(${PYTHON3}) set(PYTHON_NAME "python3") - else(${PYTHON3}) + else() set(PYTHON_NAME "python") - endif(${PYTHON3}) + endif() # Mako if(NOT MAKO_FOUND) @@ -600,11 +599,11 @@ if(NOT VOLKGNSSSDR_FOUND) message(STATUS " sudo yum install ${PYTHON_NAME}-mako") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") message(STATUS " sudo zypper install ${PYTHON_NAME}-Mako") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(STATUS " sudo apt-get install ${PYTHON_NAME}-mako") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR") - endif(NOT MAKO_FOUND) + endif() # Six if(NOT SIX_FOUND) @@ -614,37 +613,37 @@ if(NOT VOLKGNSSSDR_FOUND) message(STATUS " sudo yum install ${PYTHON_NAME}-six") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") message(STATUS " sudo zypper install ${PYTHON_NAME}-six") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(STATUS " sudo apt-get install ${PYTHON_NAME}-six") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR") - endif(NOT SIX_FOUND) + endif() set(READ_ENVIRO "") if(ENABLE_PACKAGING) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") + endif() if(NOT DEFINED ENV{PROTECT_PASSWORDS}) - set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) - endif(NOT DEFINED ENV{PROTECT_PASSWORDS}) - endif(ENABLE_PACKAGING) + set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) + endif() + endif() set(VOLK_GNSSSDR_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}") if(PYTHON_EXECUTABLE) set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") - endif(PYTHON_EXECUTABLE) + endif() if(OS_IS_MACOSX) if(CMAKE_GENERATOR STREQUAL Xcode) - set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target") - endif(CMAKE_GENERATOR STREQUAL Xcode) - endif(OS_IS_MACOSX) + set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target") + endif() + endif() if(CMAKE_CROSSCOMPILING) set(VOLK_GNSSSDR_COMPILER "") - else(CMAKE_CROSSCOMPILING) + else() set(VOLK_GNSSSDR_COMPILER -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) - endif(CMAKE_CROSSCOMPILING) + endif() set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_COMPILER} -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install -DENABLE_STATIC_LIBS=ON @@ -657,39 +656,39 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake -DCROSSCOMPILE_MULTILIB=TRUE) - endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) + endif() if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} - DOWNLOAD_COMMAND "" - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + ExternalProject_Add(volk_gnsssdr_module + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} - DOWNLOAD_COMMAND "" - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + else() + ExternalProject_Add(volk_gnsssdr_module + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() find_package(ORC) if(NOT ORC_FOUND) set(ORC_LIBRARIES "") set(ORC_INCLUDE_DIRS "") - endif(NOT ORC_FOUND) + endif() add_library(volk_gnsssdr UNKNOWN IMPORTED) set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) @@ -697,20 +696,20 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES}) if(CMAKE_VERSION VERSION_LESS 3.2) - add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) - else(CMAKE_VERSION VERSION_LESS 3.2) - add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile - BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) - endif(CMAKE_VERSION VERSION_LESS 3.2) + add_custom_command(TARGET volk_gnsssdr_module POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) + else() + add_custom_command(TARGET volk_gnsssdr_module POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile + BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) + endif() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info) -endif(NOT VOLKGNSSSDR_FOUND) + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info) +endif() @@ -725,35 +724,33 @@ if(NOT GFLAGS_FOUND) message(STATUS " when doing 'make'. ") if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - GIT_REPOSITORY git://github.com/gflags/gflags.git - GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - GIT_REPOSITORY git://github.com/gflags/gflags.git - GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + GIT_REPOSITORY git://github.com/gflags/gflags.git + GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + else() + ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + GIT_REPOSITORY git://github.com/gflags/gflags.git + GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + endif() set(GFlags_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" @@ -770,7 +767,7 @@ if(NOT GFLAGS_FOUND) set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) -endif(NOT GFLAGS_FOUND) +endif() @@ -781,28 +778,28 @@ if(NOT ${ENABLE_OWN_GLOG}) find_package(GLOG) if(GLOG_INCLUDE_DIRS) set(GLOG_FOUND ON) - endif(GLOG_INCLUDE_DIRS) -endif(NOT ${ENABLE_OWN_GLOG}) + endif() +endif() set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION}) if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) message(STATUS " glog library has not been found") if(NOT GFLAGS_FOUND) message(STATUS " or it is likely not linked to gflags.") - endif(NOT GFLAGS_FOUND) + endif() message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") message(STATUS " when doing 'make'. ") if(NOT ${LOCAL_GFLAGS}) add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED) set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}") - endif(NOT ${LOCAL_GFLAGS}) + endif() set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) if(${LOCAL_GFLAGS}) set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS}) set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) - else(${LOCAL_GFLAGS}) + else() set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS}) set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS}) - endif(${LOCAL_GFLAGS}) + endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags @@ -820,7 +817,7 @@ autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") - else(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + else() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags "#!/bin/sh export CPPFLAGS=-I${GFlags_INCLUDE_DIRS} @@ -832,49 +829,48 @@ automake --add-missing autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) # Ensure that aclocal and libtool are present if(OS_IS_LINUX) if(EXISTS "/usr/bin/libtoolize") - if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - # Everything ok, we can move on - else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(" aclocal has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install automake") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install automake") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "aclocal is required to build glog from source") - endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - else(EXISTS "/usr/bin/libtoolize") + if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + # Everything ok, we can move on + else() + message(" aclocal has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install automake") + else() + message(" sudo apt-get install automake") + endif() + message(FATAL_ERROR "aclocal is required to build glog from source") + endif() + else() message(" libtool has not been found.") message(" You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") + message(" sudo yum groupinstall 'Development Tools'") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install libtoool") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libtool") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo zypper install libtoool") + else() + message(" sudo apt-get install libtool") + endif() message(FATAL_ERROR "libtool is required to build glog from source") - endif(EXISTS "/usr/bin/libtoolize") - endif(OS_IS_LINUX) + endif() + endif() if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - glog-${GNSSSDR_GLOG_LOCAL_VERSION} + ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ @@ -887,9 +883,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PATCH_COMMAND "" INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - glog-${GNSSSDR_GLOG_LOCAL_VERSION} + else() + ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ @@ -903,7 +898,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PATCH_COMMAND "" INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() # Set up variables set(GLOG_INCLUDE_DIRS @@ -914,15 +909,15 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE) -else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) +else() add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED) set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}") -endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) +endif() if(NOT ENABLE_LOG) message(STATUS "Logging is not enabled") add_definitions(-DGOOGLE_STRIP_LOG=1) -endif(NOT ENABLE_LOG) +endif() @@ -936,11 +931,11 @@ if(NOT BLAS) message(" You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(" sudo yum install blas-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(" sudo apt-get install libblas-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "BLAS is required to build gnss-sdr") -endif(NOT BLAS) +endif() @@ -956,11 +951,11 @@ if(NOT LAPACK) message(" sudo yum install lapack-devel") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") message(" sudo zypper install lapack-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(" sudo apt-get install liblapack-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "LAPACK is required to build gnss-sdr") -endif(NOT LAPACK) +endif() @@ -972,8 +967,8 @@ if(ARMADILLO_FOUND) if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) set(ARMADILLO_FOUND false) set(ENABLE_OWN_ARMADILLO true) - endif(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) -endif(ARMADILLO_FOUND) + endif() +endif() if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) message(STATUS " Armadillo has not been found.") @@ -991,22 +986,21 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) message(STATUS "The gfortran library has not been found.") message(STATUS " You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo yum install gcc-fortran") + message(STATUS " sudo yum install gcc-fortran") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(STATUS " sudo zypper install gcc-fortran") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo apt-get install gfortran") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(STATUS " sudo zypper install gcc-fortran") + else() + message(STATUS " sudo apt-get install gfortran") + endif() message(FATAL_ERROR "gfortran is required to build gnss-sdr") - endif(NOT GFORTRAN) - endif(NOT OS_IS_MACOSX) + endif() + endif() ############################################# # Download and build Armadillo ############################################# if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - armadillo-${armadillo_RELEASE} + ExternalProject_Add(armadillo-${armadillo_RELEASE} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} @@ -1017,9 +1011,8 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) UPDATE_COMMAND "" INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - armadillo-${armadillo_RELEASE} + else() + ExternalProject_Add(armadillo-${armadillo_RELEASE} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} @@ -1031,22 +1024,22 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) UPDATE_COMMAND "" INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() # Set up variables ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) if(NOT GFORTRAN) set(GFORTRAN "") - endif(NOT GFORTRAN) + endif() set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) -else(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) +else() set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") -endif(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) +endif() @@ -1055,35 +1048,36 @@ endif(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) ################################################################################ find_package(GnuTLS) find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27 - HINTS /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/aarch64-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/i386-linux-gnu - /usr/lib/alpha-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/i386-gnu - /usr/lib/i686-gnu - /usr/lib/i686-linux-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i686-kfreebsd-gnu - /usr/lib/m68k-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc-linux-gnuspe - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/sh4-linux-gnu) + HINTS /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/i386-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/i386-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu +) if(NOT GNUTLS_OPENSSL_LIBRARY) message(STATUS "Looking for OpenSSL instead...") @@ -1092,22 +1086,22 @@ if(NOT GNUTLS_OPENSSL_LIBRARY) set(GNUTLS_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}) set(GNUTLS_LIBRARIES "") set(GNUTLS_OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY}) - else(OPENSSL_FOUND) + else() message(" The GnuTLS library with openssl compatibility enabled has not been found.") message(" You can try to install the required libraries by typing:") if(OS_IS_LINUX) - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum install openssl-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libgnutls-openssl-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - endif(OS_IS_LINUX) + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum install openssl-devel") + else() + message(" sudo apt-get install libgnutls-openssl-dev") + endif() + endif() if(OS_IS_MACOSX) - message(" sudo port install gnutls") - endif(OS_IS_MACOSX) + message(" sudo port install gnutls") + endif() message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr") - endif(OPENSSL_FOUND) -endif(NOT GNUTLS_OPENSSL_LIBRARY) + endif() +endif() @@ -1118,97 +1112,95 @@ find_package(MATIO) if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) if(MATIO_FOUND) message(STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required).") - endif(MATIO_FOUND) + endif() message(STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") find_package(ZLIB) if(ZLIB_FOUND) get_filename_component(ZLIB_BASE_DIR ${ZLIB_INCLUDE_DIRS} DIRECTORY) if(OS_IS_LINUX) - if(NOT EXISTS "/usr/bin/libtoolize") - message(" libtool has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install libtoool") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libtool") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "libtool is required to build matio from source") - endif(NOT EXISTS "/usr/bin/libtoolize") - if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(STATUS "Automake found.") - else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(" aclocal has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install automake") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install automake") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "aclocal is required to build matio from source") - endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - endif(OS_IS_LINUX) + if(NOT EXISTS "/usr/bin/libtoolize") + message(" libtool has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install libtoool") + else() + message(" sudo apt-get install libtool") + endif() + message(FATAL_ERROR "libtool is required to build matio from source") + endif() + if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + message(STATUS "Automake found.") + else() + message(" aclocal has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install automake") + else() + message(" sudo apt-get install automake") + endif() + message(FATAL_ERROR "aclocal is required to build matio from source") + endif() + endif() find_package(HDF5) if(HDF5_FOUND) - list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) - get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) - get_filename_component(HDF5_BASE_DIR ${HDF5_BASE_DIR2} DIRECTORY) - if(OS_IS_MACOSX) - if(EXISTS /opt/local/include/hdf5.h) - set(HDF5_BASE_DIR /opt/local) - endif(EXISTS /opt/local/include/hdf5.h) - if(EXISTS /usr/local/include/hdf5.h) - set(HDF5_BASE_DIR /usr/local) - endif(EXISTS /usr/local/include/hdf5.h) - endif(OS_IS_MACOSX) - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio - GIT_REPOSITORY https://github.com/tbeu/matio - GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio - GIT_REPOSITORY https://github.com/tbeu/matio - GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) - set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) - set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) - set(MATIO_LOCAL true) - else(HDF5_FOUND) - message(STATUS " The hdf5 library has not been found in your system.") - message(STATUS " Please try to install it by doing:") - if(OS_IS_MACOSX) - message(STATUS " $ sudo port install hdf5") - message(STATUS " or") - message(STATUS " $ brew install hdf5") - endif(OS_IS_MACOSX) - if(OS_IS_LINUX) - message(STATUS " $ sudo apt-get install libhdf5-dev") - endif(OS_IS_LINUX) - message(FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr") - endif(HDF5_FOUND) - else(ZLIB_FOUND) + list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) + get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) + get_filename_component(HDF5_BASE_DIR ${HDF5_BASE_DIR2} DIRECTORY) + if(OS_IS_MACOSX) + if(EXISTS /opt/local/include/hdf5.h) + set(HDF5_BASE_DIR /opt/local) + endif() + if(EXISTS /usr/local/include/hdf5.h) + set(HDF5_BASE_DIR /usr/local) + endif() + endif() + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + GIT_REPOSITORY https://github.com/tbeu/matio + GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + BUILD_COMMAND make + ) + else() + ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + GIT_REPOSITORY https://github.com/tbeu/matio + GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + BUILD_COMMAND make + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + endif() + set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) + set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) + set(MATIO_LOCAL true) + else() + message(STATUS " The hdf5 library has not been found in your system.") + message(STATUS " Please try to install it by doing:") + if(OS_IS_MACOSX) + message(STATUS " $ sudo port install hdf5") + message(STATUS " or") + message(STATUS " $ brew install hdf5") + endif() + if(OS_IS_LINUX) + message(STATUS " $ sudo apt-get install libhdf5-dev") + endif() + message(FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr") + endif() + else() message(FATAL_ERROR "*** The zlib library is required to build gnss-sdr") - endif(ZLIB_FOUND) -endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) + endif() +endif() @@ -1217,47 +1209,45 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V ################################################################################ find_package(PUGIXML QUIET) if(PUGIXML_FOUND) - message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") -else(PUGIXML_FOUND) + message(STATUS "PugiXML has been found.") +else() message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(PUGIXML_COMPILER "") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") - endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) + endif() if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/zeux/pugixml - GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" + ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/zeux/pugixml - GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - INSTALL_COMMAND "" + else() + ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) set(PUGIXML_LOCAL true) -endif(PUGIXML_FOUND) +endif() ################################################################################ @@ -1270,11 +1260,11 @@ if(ENABLE_UHD) message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") message(STATUS " so all USRP-based front-ends will not be usable.") message(STATUS " Please check https://files.ettus.com/manual/") - else(NOT UHD_FOUND) + else() set(GR_REQUIRED_COMPONENTS UHD) find_package(Gnuradio) - endif(NOT UHD_FOUND) -endif(ENABLE_UHD) + endif() +endif() ################################################################################ @@ -1292,10 +1282,10 @@ if(DOXYGEN_FOUND) if(PDFLATEX_COMPILER) set(GENERATE_PDF_DOCUMENTATION "YES") set(GNSSSDR_USE_MATHJAX "NO") - else(PDFLATEX_COMPILER) + else() set(GENERATE_PDF_DOCUMENTATION "NO") set(GNSSSDR_USE_MATHJAX "YES") - endif(PDFLATEX_COMPILER) + endif() configure_file(${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.in ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile @ONLY @@ -1315,7 +1305,7 @@ if(DOXYGEN_FOUND) WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/docs/latex COMMENT "Generating PDF manual with Doxygen." VERBATIM ) - endif(LATEX_COMPILER) + endif() message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") add_custom_target(doc-clean COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html @@ -1323,21 +1313,21 @@ if(DOXYGEN_FOUND) COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf COMMENT "Cleaning documentation." VERBATIM ) -else(DOXYGEN_FOUND) +else() message(STATUS " Doxygen has not been found in your system.") message(STATUS " You can get nice code documentation by using it!") message(STATUS " Get it from http://www.stack.nl/~dimitri/doxygen/index.html") if(OS_IS_LINUX) if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(STATUS " or simply by doing 'sudo yum install doxygen-latex'.") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(STATUS " or simply by doing 'sudo apt-get install doxygen-latex'.") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - endif(OS_IS_LINUX) + endif() + endif() if(OS_IS_MACOSX) message(STATUS " or simply by doing 'sudo port install doxygen +latex'.") - endif(OS_IS_MACOSX) -endif(DOXYGEN_FOUND) + endif() +endif() @@ -1348,25 +1338,25 @@ if(ENABLE_OPENCL) find_package(OPENCL) if($ENV{DISABLE_OPENCL}) set(DISABLE_OPENCL TRUE) - endif($ENV{DISABLE_OPENCL}) + endif() if(DISABLE_OPENCL) set(OPENCL_FOUND FALSE) - else(DISABLE_OPENCL) + else() if(OPENCL_FOUND) - message(STATUS "OpenCL has been found and will be used by some processing blocks") - message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") - endif(OPENCL_FOUND) - endif(DISABLE_OPENCL) + message(STATUS "OpenCL has been found and will be used by some processing blocks") + message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") + endif() + endif() if(ENABLE_GENERIC_ARCH) set(OPENCL_FOUND FALSE) message(STATUS "ENABLE_GENERIC_ARCH is set to ON so the use of OpenCL has been disabled.") - endif(ENABLE_GENERIC_ARCH) + endif() if(NOT OPENCL_FOUND) message(STATUS "Processing blocks using OpenCL will not be built.") - endif(NOT OPENCL_FOUND) -else(ENABLE_OPENCL) + endif() +else() set(OPENCL_FOUND FALSE) -endif(ENABLE_OPENCL) +endif() @@ -1376,16 +1366,18 @@ endif(ENABLE_OPENCL) if($ENV{CUDA_GPU_ACCEL}) message(STATUS "CUDA_GPU_ACCEL environment variable found.") set(ENABLE_CUDA ON) -endif($ENV{CUDA_GPU_ACCEL}) +endif() if(ENABLE_CUDA) - FIND_PACKAGE(CUDA REQUIRED) + find_package(CUDA REQUIRED) message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") -else(ENABLE_CUDA) +else() message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") -endif(ENABLE_CUDA) +endif() + + ############################################################################### # CUSTOM UDP PACKET SOURCE (OPTIONAL) @@ -1393,10 +1385,10 @@ endif(ENABLE_CUDA) if(ENABLE_RAW_UDP) message(STATUS "High-optimized custom UDP ip packet source will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") -else(ENABLE_RAW_UDP) +else() message(STATUS "High-optimized custom UDP ip packet source will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") -endif(ENABLE_RAW_UDP) +endif() ############################################################################### @@ -1405,10 +1397,10 @@ endif(ENABLE_RAW_UDP) if(ENABLE_FPGA) message(STATUS "FPGA Acceleration will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") -else(ENABLE_FPGA) +else() message(STATUS "Fpga Acceleration will be not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") -endif(ENABLE_FPGA) +endif() @@ -1418,75 +1410,75 @@ endif(ENABLE_FPGA) if($ENV{GN3S_DRIVER}) message(STATUS "GN3S_DRIVER environment variable found.") set(ENABLE_GN3S ON) -endif($ENV{GN3S_DRIVER}) +endif() if(GN3S_DRIVER) set(ENABLE_GN3S ON) -endif(GN3S_DRIVER) +endif() if(ENABLE_GN3S) message(STATUS "The GN3S driver will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") -else(ENABLE_GN3S) +else() message(STATUS "The (optional and experimental) GN3S driver is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") -endif(ENABLE_GN3S) +endif() if($ENV{RAW_ARRAY_DRIVER}) message(STATUS "RAW_ARRAY_DRIVER environment variable found.") set(ENABLE_ARRAY ON) -endif($ENV{RAW_ARRAY_DRIVER}) +endif() if(RAW_ARRAY_DRIVER) set(ENABLE_ARRAY ON) -endif(RAW_ARRAY_DRIVER) +endif() if(ENABLE_ARRAY) message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") # copy firmware to install folder # Build project gr-dbfcttc -else(ENABLE_ARRAY) +else() message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") -endif(ENABLE_ARRAY) +endif() if($ENV{RTLSDR_DRIVER}) message(STATUS "RTLSDR_DRIVER environment variable found.") set(ENABLE_OSMOSDR ON) -endif($ENV{RTLSDR_DRIVER}) +endif() if(ENABLE_OSMOSDR) find_package(GROSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") - else(GROSMOSDR_FOUND) + else() if(ENABLE_PACKAGING) - message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") - else(ENABLE_PACKAGING) - message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver") - endif(ENABLE_PACKAGING) - endif(GROSMOSDR_FOUND) -else(ENABLE_OSMOSDR) + message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") + else() + message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver") + endif() + endif() +else() message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") -endif(ENABLE_OSMOSDR) +endif() if($ENV{FLEXIBAND_DRIVER}) message(STATUS "FLEXIBAND_DRIVER environment variable found.") set(ENABLE_FLEXIBAND ON) -endif($ENV{FLEXIBAND_DRIVER}) +endif() if(FLEXIBAND_DRIVER) set(ENABLE_FLEXIBAND ON) -endif(FLEXIBAND_DRIVER) +endif() if(ENABLE_FLEXIBAND) message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") -else(ENABLE_FLEXIBAND) +else() message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") -endif(ENABLE_FLEXIBAND) +endif() @@ -1499,23 +1491,23 @@ if(ENABLE_GPERFTOOLS) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") - else(NOT GPERFTOOLS_FOUND) + else() message(STATUS "GPerftools libraries found.") message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") - endif(NOT GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + endif() +endif() if(ENABLE_GPERFTOOLS) # Set GPerftools related flags if it is available # See https://github.com/gperftools/gperftools/blob/master/README if(GPERFTOOLS_FOUND) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") + endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - endif(GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") + endif() + endif() +endif() @@ -1526,7 +1518,7 @@ if(ENABLE_GPROF) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") -endif(ENABLE_GPROF) +endif() ######################################################################## @@ -1538,15 +1530,15 @@ endif(ENABLE_GPROF) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + else() # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + endif() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) +endif() # Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8) # Enable C++14 support in Clang >= 3.5.0 or AppleClang >= 600 @@ -1555,37 +1547,37 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences if(CLANG_VERSION VERSION_LESS "600") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CLANG_VERSION VERSION_LESS "600") - # if(CLANG_VERSION VERSION_LESS "900") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CLANG_VERSION VERSION_LESS "900") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CLANG_VERSION VERSION_LESS "900") - endif(CLANG_VERSION VERSION_LESS "600") - else(OS_IS_MACOSX) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + else() + # if(CLANG_VERSION VERSION_LESS "900") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") + # else(CLANG_VERSION VERSION_LESS "900") + # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") + # endif(CLANG_VERSION VERSION_LESS "900") + endif() + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - endif(OS_IS_MACOSX) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + else() + # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") + # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") + # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + endif() + endif() if(OS_IS_MACOSX) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -stdlib=libc++") - endif(OS_IS_MACOSX) -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 14) - endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) -endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) + endif() +endif() # Processor-architecture related flags # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html @@ -1593,31 +1585,31 @@ if(NOT ARCH_COMPILER_FLAGS) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(OS_IS_MACOSX) set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") - else(OS_IS_MACOSX) + else() if(NOT ${ENABLE_GENERIC_ARCH}) if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) if(NOT CMAKE_CROSSCOMPILING) - if(ARM_VERSION STREQUAL "arm") - # Unknown arm version - try our best to detect - set(ARCH_COMPILER_FLAGS "-mcpu=native") - else(ARM_VERSION STREQUAL "arm") - set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") - endif(ARM_VERSION STREQUAL "arm") - endif(NOT CMAKE_CROSSCOMPILING) - else(IS_ARM) + if(ARM_VERSION STREQUAL "arm") + # Unknown arm version - try our best to detect + set(ARCH_COMPILER_FLAGS "-mcpu=native") + else() + set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") + endif() + endif() + else() set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse") - endif(IS_ARM) - endif(NOT ${ENABLE_GENERIC_ARCH}) - endif(OS_IS_MACOSX) - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif(NOT ARCH_COMPILER_FLAGS) + endif() + endif() + endif() + endif() +endif() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) # https://gcc.gnu.org/wiki/Visibility add_definitions(-fvisibility=hidden) -endif((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84e918b73..83c519fd5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,5 +21,5 @@ add_subdirectory(core) add_subdirectory(main) if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) add_subdirectory(tests) -endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) +endif() add_subdirectory(utils) diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 74ef5d92a..d8c055506 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -19,7 +19,7 @@ if(Boost_VERSION LESS 105800) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105800) +endif() set(PVT_ADAPTER_SOURCES rtklib_pvt.cc diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index bbe9ed19d..eb58c0894 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -19,7 +19,7 @@ if(Boost_VERSION LESS 105800) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105800) +endif() set(PVT_GR_BLOCKS_SOURCES rtklib_pvt_cc.cc diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index ad1944c21..cd306531a 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -16,7 +16,7 @@ # along with GNSS-SDR. If not, see . # -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(PVT_LIB_SOURCES pvt_solution.cc @@ -72,13 +72,13 @@ if(MATIO_FOUND) glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} ) -else(MATIO_FOUND) +else() add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION} ) -endif(MATIO_FOUND) +endif() target_link_libraries( pvt_lib diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index f1e21185d..ee0046970 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -70,7 +70,7 @@ if(ENABLE_FPGA) galileo_e5a_pcps_acquisition_fpga.h gps_l5i_pcps_acquisition_fpga.h ) -endif(ENABLE_FPGA) +endif() if(OPENCL_FOUND) set(ACQ_ADAPTER_SOURCES @@ -80,7 +80,7 @@ if(OPENCL_FOUND) set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_opencl_acquisition.h ) -endif(OPENCL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index a6d5f6a45..60825d6f0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -42,12 +42,12 @@ set(ACQ_GR_BLOCKS_HEADERS if(ENABLE_FPGA) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_acquisition_fpga.h) -endif(ENABLE_FPGA) +endif() if(OPENCL_FOUND) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_opencl_acquisition_cc.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) -endif(OPENCL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -69,10 +69,10 @@ if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") - else(OS_IS_MACOSX) + else() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) - endif(OS_IS_MACOSX) -endif(OPENCL_FOUND) + endif() +endif() list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_SOURCES) @@ -91,7 +91,7 @@ if(ENABLE_FPGA) ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ) -else(ENABLE_FPGA) +else() target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters @@ -103,8 +103,8 @@ else(ENABLE_FPGA) ${MATIO_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ) -endif(ENABLE_FPGA) +endif() -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(acq_gr_blocks volk_gnsssdr_module) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 9ffc0e07a..c3f368be6 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -30,7 +30,7 @@ if(ENABLE_FPGA) ${GFlags_INCLUDE_DIRS} ${VOLK_GNSSSDR_INCLUDE_DIRS} ) -endif(ENABLE_FPGA) +endif() set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) @@ -51,8 +51,8 @@ target_link_libraries(acquisition_lib ${GNURADIO_RUNTIME_LIBRARIES} ) -if(VOLK_GNSSSDR_FOUND) +if(VOLKGNSSSDR_FOUND) add_dependencies(acquisition_lib glog-${glog_RELEASE}) -else(VOLK_GNSSSDR_FOUND) +else() add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) endif() diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 7f33f4072..8153c6c3c 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -48,7 +48,7 @@ include_directories( if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") add_definitions(-DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") +endif() list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index ea3de1cb6..8a4aefc11 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -54,8 +54,8 @@ target_link_libraries(input_filter_gr_blocks ${VOLK_GNSSSDR_LIBRARIES} ${LOG4CPP_LIBRARIES}) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) -else(NOT VOLK_GNSSSDR_FOUND) +else() add_dependencies(input_filter_gr_blocks glog-${glog_RELEASE}) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 29869ea6a..9ef2da55c 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -78,7 +78,7 @@ if(ENABLE_FPGA) gnss_sdr_time_counter.h gnss_sdr_fpga_sample_counter.h ) -endif(ENABLE_FPGA) +endif() if(OPENCL_FOUND) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} @@ -91,7 +91,7 @@ if(OPENCL_FOUND) opencl/fft_setup.h # Needs OpenCL opencl/fft_kernelstring.h # Needs OpenCL ) -endif(OPENCL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -112,10 +112,10 @@ if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") - else(OS_IS_MACOSX) + else() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) - endif(OS_IS_MACOSX) -endif(OPENCL_FOUND) + endif() +endif() add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") @@ -138,16 +138,16 @@ target_link_libraries(gnss_sp_libs gnss_rx ) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(gnss_sp_libs volk_gnsssdr_module armadillo-${armadillo_RELEASE}) -else(NOT VOLK_GNSSSDR_FOUND) +else() add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() if(${GFLAGS_GREATER_20}) add_definitions(-DGFLAGS_GREATER_2_0=1) -endif(${GFLAGS_GREATER_20}) +endif() add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) source_group(Headers FILES gnss_sdr_flags.h) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index c2f7ff6f8..882cd4a81 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -78,7 +78,7 @@ add_dependencies(rtklib_lib glog-${glog_RELEASE}) if(OS_IS_MACOSX) set(MAC_LIBRARIES "-framework Accelerate") -endif(OS_IS_MACOSX) +endif() target_link_libraries( rtklib_lib diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 5a1a55e8d..e829c474d 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -48,14 +48,14 @@ if(MATIO_FOUND) glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} ) -else(MATIO_FOUND) +else() add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION} ) -endif(MATIO_FOUND) +endif() target_link_libraries(obs_gr_blocks gnss_sp_libs diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 0f6c92684..07e8ddc74 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -39,7 +39,7 @@ include_directories( if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") add_definitions(-DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") +endif() list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index eade10e00..30ab655e1 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -47,8 +47,8 @@ target_link_libraries(signal_generator_blocks ${ORC_LIBRARIES} ) -if(VOLK_GNSSSDR_FOUND) +if(VOLKGNSSSDR_FOUND) # add_dependencies(signal_generator_blocks glog-${glog_RELEASE}) -else(VOLK_GNSSSDR_FOUND) +else() add_dependencies(signal_generator_blocks volk_gnsssdr_module) -endif(VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 83062ea66..6674cd853 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -23,13 +23,13 @@ if(ENABLE_RAW_UDP) find_package(PCAP) if(NOT PCAP_FOUND) message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif(NOT PCAP_FOUND) + endif() get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h) -endif(ENABLE_RAW_UDP) +endif() if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) find_package(GRIIO REQUIRED) @@ -40,10 +40,10 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") - endif(NOT GRIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) +endif() if(ENABLE_AD9361) find_package(LIBIIO REQUIRED) @@ -54,10 +54,10 @@ if(ENABLE_AD9361) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") - endif(NOT LIBIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) -endif(ENABLE_AD9361) +endif() if(ENABLE_PLUTOSDR) @@ -67,8 +67,8 @@ if(ENABLE_PLUTOSDR) if(GRIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h) - endif(GRIIO_FOUND) -endif(ENABLE_PLUTOSDR) + endif() +endif() if(ENABLE_FMCOMMS2) @@ -78,8 +78,8 @@ if(ENABLE_FMCOMMS2) if(GRIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h) - endif(GRIIO_FOUND) -endif(ENABLE_FMCOMMS2) + endif() +endif() if(ENABLE_AD9361) @@ -89,8 +89,8 @@ if(ENABLE_AD9361) if(LIBIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h) - endif(LIBIIO_FOUND) -endif(ENABLE_AD9361) + endif() +endif() if(ENABLE_GN3S) @@ -101,12 +101,12 @@ if(ENABLE_GN3S) if(NOT GRGN3S_FOUND) message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") - endif(NOT GRGN3S_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) -endif(ENABLE_GN3S) +endif() if(ENABLE_FLEXIBAND) @@ -116,7 +116,7 @@ if(ENABLE_FLEXIBAND) find_package(TELEORBIT REQUIRED) if(NOT TELEORBIT_FOUND) message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") - endif(NOT TELEORBIT_FOUND) + endif() # Set up variables set(FLEXIBAND_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} @@ -126,7 +126,7 @@ if(ENABLE_FLEXIBAND) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) -endif(ENABLE_FLEXIBAND) +endif() if(ENABLE_ARRAY) @@ -137,12 +137,12 @@ if(ENABLE_ARRAY) if(NOT GRDBFCTTC_FOUND) message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") - endif(NOT GRDBFCTTC_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) -endif(ENABLE_ARRAY) +endif() if(ENABLE_OSMOSDR) @@ -152,8 +152,8 @@ if(ENABLE_OSMOSDR) if(NOT GROSMOSDR_FOUND) if(ENABLE_PACKAGING) list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h) - endif(ENABLE_PACKAGING) - else(NOT GROSMOSDR_FOUND) + endif() + else() # set OSMO include dirs set(OSMO_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} @@ -163,8 +163,8 @@ if(ENABLE_OSMOSDR) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS}) - endif(NOT GROSMOSDR_FOUND) -endif(ENABLE_OSMOSDR) + endif() +endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) @@ -172,27 +172,29 @@ if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS}) -endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) +endif() -set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc - gen_signal_source.cc - nsr_file_signal_source.cc - spir_file_signal_source.cc - spir_gss6450_file_signal_source.cc - rtl_tcp_signal_source.cc - labsat_signal_source.cc - ${OPT_DRIVER_SOURCES} +set(SIGNAL_SOURCE_ADAPTER_SOURCES + file_signal_source.cc + gen_signal_source.cc + nsr_file_signal_source.cc + spir_file_signal_source.cc + spir_gss6450_file_signal_source.cc + rtl_tcp_signal_source.cc + labsat_signal_source.cc + ${OPT_DRIVER_SOURCES} ) -set(SIGNAL_SOURCE_ADAPTER_HEADERS file_signal_source.h - gen_signal_source.h - nsr_file_signal_source.h - spir_file_signal_source.h - spir_gss6450_file_signal_source.h - rtl_tcp_signal_source.h - labsat_signal_source.h - ${OPT_DRIVER_HEADERS} +set(SIGNAL_SOURCE_ADAPTER_HEADERS + file_signal_source.h + gen_signal_source.h + nsr_file_signal_source.h + spir_file_signal_source.h + spir_gss6450_file_signal_source.h + rtl_tcp_signal_source.h + labsat_signal_source.h + ${OPT_DRIVER_HEADERS} ) @@ -203,7 +205,7 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} two_bit_cpx_file_signal_source.h two_bit_packed_file_signal_source.h) -endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -222,7 +224,7 @@ include_directories( if(ARCH_64BITS) add_definitions(-DARCH_64BITS=1) -endif(ARCH_64BITS) +endif() add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index b673dd897..fb94ec51c 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -20,14 +20,14 @@ if(ENABLE_RAW_UDP) find_package(PCAP) if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source") + endif() get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gr_complex_ip_packet_source.h) -endif(ENABLE_RAW_UDP) +endif() set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES @@ -69,12 +69,18 @@ include_directories( list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) -add_library(signal_source_gr_blocks ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) +add_library(signal_source_gr_blocks + ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} + ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) + target_link_libraries(signal_source_gr_blocks signal_source_lib ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} ${OPT_LIBRARIES} ) + add_dependencies(signal_source_gr_blocks glog-${glog_RELEASE}) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index af65174c0..3f2a6bbe5 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -25,10 +25,10 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif(NOT GRIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) +endif() if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) find_package(LIBIIO REQUIRED) @@ -39,7 +39,7 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - endif(NOT LIBIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) @@ -49,13 +49,13 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(LIBIIO_FOUND) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) - endif(LIBIIO_FOUND) -endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) + endif() +endif() if(ENABLE_FPGA OR ENABLE_AD9361) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) -endif(ENABLE_FPGA OR ENABLE_AD9361) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 92d258bfe..83fe5d36f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -67,6 +67,6 @@ target_link_libraries(telemetry_decoder_gr_blocks ${VOLK_GNSSSDR_LIBRARIES} ) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index db967b669..5150aa400 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -30,7 +30,7 @@ if(ENABLE_CUDA) ${OPT_TRACKING_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ) -endif(ENABLE_CUDA) +endif() if(ENABLE_FPGA) set(OPT_TRACKING_ADAPTERS_SOURCES @@ -41,7 +41,6 @@ if(ENABLE_FPGA) galileo_e5a_dll_pll_tracking_fpga.cc gps_l5_dll_pll_tracking_fpga.cc ) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} gps_l1_ca_dll_pll_tracking_fpga.h @@ -50,7 +49,7 @@ if(ENABLE_FPGA) galileo_e5a_dll_pll_tracking_fpga.h gps_l5_dll_pll_tracking_fpga.h ) -endif(ENABLE_FPGA) +endif() set(TRACKING_ADAPTER_SOURCES galileo_e1_dll_pll_veml_tracking.cc diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index fdc72cd34..2dd5b494f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -33,7 +33,7 @@ if(ENABLE_CUDA) ${OPT_TRACKING_LIBRARIES} ${CUDA_LIBRARIES} ) -endif(ENABLE_CUDA) +endif() if(ENABLE_FPGA) set(OPT_TRACKING_BLOCKS_SOURCES @@ -44,7 +44,7 @@ if(ENABLE_FPGA) ${OPT_TRACKING_BLOCKS_HEADERS} dll_pll_veml_tracking_fpga.h ) -endif(ENABLE_FPGA) +endif() set(TRACKING_GR_BLOCKS_SOURCES galileo_e1_tcp_connector_tracking_cc.cc @@ -97,12 +97,15 @@ include_directories( if(ENABLE_GENERIC_ARCH) add_definitions(-DGENERIC_ARCH=1) -endif(ENABLE_GENERIC_ARCH) +endif() list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) -add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS}) +add_library(tracking_gr_blocks + ${TRACKING_GR_BLOCKS_SOURCES} + ${TRACKING_GR_BLOCKS_HEADERS} +) source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) @@ -116,14 +119,18 @@ target_link_libraries(tracking_gr_blocks ${OPT_TRACKING_LIBRARIES} ) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) if(MATIO_FOUND) add_dependencies(tracking_gr_blocks volk_gnsssdr_module) - else(MATIO_FOUND) - add_dependencies(tracking_gr_blocks volk_gnsssdr_module matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(MATIO_FOUND) -else(NOT VOLK_GNSSSDR_FOUND) + else() + add_dependencies(tracking_gr_blocks volk_gnsssdr_module + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) + endif() +else() if(NOT MATIO_FOUND) - add_dependencies(tracking_gr_blocks matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(NOT MATIO_FOUND) -endif(NOT VOLK_GNSSSDR_FOUND) + add_dependencies(tracking_gr_blocks + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) + endif() +endif() diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 7cce9e680..6991fbd55 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -27,7 +27,7 @@ if(ENABLE_CUDA) cuda_add_library(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB) set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS}) -endif(ENABLE_CUDA) +endif() set(TRACKING_LIB_SOURCES cpu_multicorrelator.cc @@ -64,7 +64,7 @@ set(TRACKING_LIB_HEADERS if(ENABLE_FPGA) set(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} fpga_multicorrelator.cc dll_pll_conf_fpga.cc) set(TRACKING_LIB_HEADERS ${TRACKING_LIB_HEADERS} fpga_multicorrelator.h dll_pll_conf_fpga.h) -endif(ENABLE_FPGA) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -82,11 +82,11 @@ include_directories( if(ENABLE_GENERIC_ARCH) add_definitions(-DGENERIC_ARCH=1) -endif(ENABLE_GENERIC_ARCH) +endif() if(SSE3_AVAILABLE) add_definitions(-DHAVE_SSE3=1) -endif(SSE3_AVAILABLE) +endif() list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) @@ -103,8 +103,8 @@ target_link_libraries(tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} ) -if(VOLK_GNSSSDR_FOUND) +if(VOLKGNSSSDR_FOUND) add_dependencies(tracking_lib glog-${glog_RELEASE}) -else(VOLK_GNSSSDR_FOUND) +else() add_dependencies(tracking_lib glog-${glog_RELEASE} volk_gnsssdr_module) endif() diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index bbecef4d0..9557199c4 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -20,7 +20,7 @@ add_subdirectory(supl) if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() set(CORE_LIBS_SOURCES ini.cc @@ -57,4 +57,4 @@ target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARY}) if(PUGIXML_LOCAL) add_dependencies(rx_core_lib pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) -endif(PUGIXML_LOCAL) +endif() diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 65a639e10..e8e1e69a6 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -27,7 +27,7 @@ set(SUPL_SOURCES if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -40,8 +40,8 @@ include_directories( if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") - endif(CMAKE_BUILD_TYPE MATCHES "Release") -endif(CMAKE_C_COMPILER_ID MATCHES "Clang") + endif() +endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 89540b525..239e8cf00 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -34,6 +34,7 @@ set(GNSS_RECEIVER_HEADERS gnss_block_factory.h gnss_flowgraph.h in_memory_configuration.h + tcp_cmd_interface.h concurrent_map.h concurrent_queue.h control_message.h @@ -41,78 +42,86 @@ set(GNSS_RECEIVER_HEADERS if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) add_definitions(-DMODERN_GNURADIO=1) -endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) +endif() if(ENABLE_CUDA) add_definitions(-DCUDA_GPU_ACCEL=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) -endif(ENABLE_CUDA) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} + ) +endif() if(ENABLE_FPGA) add_definitions(-DENABLE_FPGA=1) -endif(ENABLE_FPGA) +endif() if(ENABLE_RAW_UDP) add_definitions(-DRAW_UDP=1) -endif(ENABLE_RAW_UDP) +endif() if(Boost_VERSION LESS 105000) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105000) +endif() if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) -endif(OPENSSL_FOUND) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) +endif() if(ENABLE_GN3S) add_definitions(-DGN3S_DRIVER=1) -endif(ENABLE_GN3S) +endif() if(ENABLE_ARRAY) add_definitions(-DRAW_ARRAY_DRIVER=1) -endif(ENABLE_ARRAY) +endif() if(ENABLE_FLEXIBAND) add_definitions(-DFLEXIBAND_DRIVER=1) -endif(ENABLE_FLEXIBAND) +endif() if(ENABLE_OSMOSDR) if(GROSMOSDR_FOUND) add_definitions(-DOSMOSDR_DRIVER=1) - endif(GROSMOSDR_FOUND) -endif(ENABLE_OSMOSDR) + endif() +endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) add_definitions(-DUHD_DRIVER=1) -endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) +endif() #Enable OpenCL if found in the system if(OPENCL_FOUND) message(STATUS "Adding processing blocks implemented using OpenCL") add_definitions(-DOPENCL_BLOCKS=1) -else(OPENCL_FOUND) +else() add_definitions(-DOPENCL_BLOCKS=0) -endif(OPENCL_FOUND) +endif() #enable SDR Hardware based on fmcomms2 if(ENABLE_PLUTOSDR) add_definitions(-DPLUTOSDR_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_PLUTOSDR) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} + ) +endif() if(ENABLE_FMCOMMS2) add_definitions(-DFMCOMMS2_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_FMCOMMS2) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} + ) +endif() if(ENABLE_AD9361) add_definitions(-DAD9361_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_AD9361) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} + ) +endif() if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif() include_directories( @@ -184,7 +193,8 @@ add_library(gnss_rx ${GNSS_RECEIVER_INTERFACE_HEADERS} ) -source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS}) +source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS}) target_link_libraries(gnss_rx ${Boost_LIBRARIES} diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 4593d8e1f..39f3231fb 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -99,8 +99,6 @@ include_directories( ${GFlags_INCLUDE_DIRS} ) -link_directories(${Boost_LIBRARY_DIR}) - list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 94a6344e6..85b250e91 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -23,28 +23,28 @@ if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}") set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif(GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + endif() +endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS}) -endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) +endif() if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() if(ENABLE_CUDA) add_definitions(-DCUDA_GPU_ACCEL=1) set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) -endif(ENABLE_CUDA) +endif() if(ORC_FOUND) set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${ORC_LIBRARIES}) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${ORC_INCLUDE_DIRS}) -endif(ORC_FOUND) +endif() include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters @@ -72,8 +72,8 @@ add_definitions(-DGNSS_SDR_VERSION="${VERSION}") if(OS_IS_MACOSX) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(MAC_LIBRARIES "-framework Accelerate -lc++") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -endif(OS_IS_MACOSX) + endif() +endif() add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) @@ -110,10 +110,10 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf RENAME default.conf) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile DESTINATION bin COMPONENT "volk_gnsssdr") install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info DESTINATION bin COMPONENT "volk_gnsssdr") -endif(NOT VOLK_GNSSSDR_FOUND) +endif() find_program(GZIP gzip @@ -135,12 +135,12 @@ if(NOT GZIP_NOTFOUND) install(FILES ${CMAKE_BINARY_DIR}/changelog.gz DESTINATION share/doc/gnss-sdr) - if(NOT VOLK_GNSSSDR_FOUND) + if(NOT VOLKGNSSSDR_FOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz") execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz") install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1) install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1) - endif(NOT VOLK_GNSSSDR_FOUND) -endif(NOT GZIP_NOTFOUND) + endif() +endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 0d8dec6f8..de39387b7 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -25,26 +25,26 @@ add_subdirectory(system-tests/libs) ################################################################################ if(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR_LOCAL $ENV{GTEST_DIR}) -endif(EXISTS $ENV{GTEST_DIR}) +endif() if(GTEST_DIR) set(GTEST_DIR_LOCAL ${GTEST_DIR}) -endif(GTEST_DIR) +endif() if(NOT GTEST_DIR_LOCAL) set(GTEST_DIR_LOCAL false) else() set(GTEST_DIR_LOCAL true) -endif(NOT GTEST_DIR_LOCAL) +endif() if(GTEST_INCLUDE_DIRS) set(GTEST_DIR_LOCAL true) -endif(GTEST_INCLUDE_DIRS) +endif() set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(GTEST_COMPILER "") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Toolchains/oe-sdk_cross.cmake") -endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) +endif() if(NOT ${GTEST_DIR_LOCAL}) # if GTEST_DIR is not defined, we download and build it @@ -60,7 +60,7 @@ if(NOT ${GTEST_DIR_LOCAL}) PATCH_COMMAND "" INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) + else() ExternalProject_Add( gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest @@ -74,7 +74,7 @@ if(NOT ${GTEST_DIR_LOCAL}) ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() # Set up variables # Set recently downloaded and build Googletest root folder @@ -87,30 +87,31 @@ if(NOT ${GTEST_DIR_LOCAL}) ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) if(OS_IS_MACOSX) if(CMAKE_GENERATOR STREQUAL Xcode) - set(binary_dir "${binary_dir}/Debug") - endif(CMAKE_GENERATOR STREQUAL Xcode) - endif(OS_IS_MACOSX) - set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(FINAL_D "d") + set(ADD_DEBUG "Debug/") + endif() + endif() + set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX}") set(GTEST_LIBRARY gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) set(GTEST_LIBRARIES - ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} + ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} ${THREAD_LIBRARIES}) set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") -else(NOT ${GTEST_DIR_LOCAL}) +else() if(GTEST_INCLUDE_DIRS) set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR}) add_library(gtest ${LIBGTEST_DEV_DIR}/src/gtest-all.cc ${LIBGTEST_DEV_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) - else(GTEST_INCLUDE_DIRS) + else() # If the variable GTEST_DIR is defined, we use the existing Googletest set(GTEST_DIR $ENV{GTEST_DIR}) set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) - endif(GTEST_INCLUDE_DIRS) + endif() target_link_libraries(gtest ${THREAD_LIBRARIES}) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() @@ -123,58 +124,57 @@ set(GNSS_SDR_TEST_OPTIONAL_HEADERS "") if(ENABLE_CUDA) set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) -endif(ENABLE_CUDA) - +endif() if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) set(GNSS_SDR_TEST_OPTIONAL_LIBS "${GNSS_SDR_TEST_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}") set(GNSS_SDR_TEST_OPTIONAL_HEADERS "${GNSS_SDR_TEST_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif(GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + endif() +endif() if(Boost_VERSION LESS 105000) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105000) +endif() if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions( -DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif() + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") + add_definitions(-DGR_GREATER_38=1) +endif() if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) set(CLANG_FLAGS "-stdlib=libc++ -lc++") - endif(OS_IS_MACOSX) -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() if(OPENCL_FOUND) add_definitions(-DOPENCL_BLOCKS_TEST=1) -endif(OPENCL_FOUND) +endif() if(ENABLE_CUDA) add_definitions(-DCUDA_BLOCKS_TEST=1) -endif(ENABLE_CUDA) +endif() if(ENABLE_FPGA) add_definitions(-DFPGA_BLOCKS_TEST=1) -endif(ENABLE_FPGA) +endif() find_package(Gnuplot) if(GNUPLOT_FOUND) add_definitions(-DGNUPLOT_EXECUTABLE="${GNUPLOT_EXECUTABLE}") -endif(GNUPLOT_FOUND) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") - add_definitions(-DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") +endif() if(ENABLE_UNIT_TESTING_MINIMAL) add_definitions(-DUNIT_TESTING_MINIMAL=1) -endif(ENABLE_UNIT_TESTING_MINIMAL) +endif() ################################################################################ @@ -186,42 +186,42 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr") - endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) - else(ENABLE_FPGA) + endif() + else() set(CROSS_INSTALL_DIR "") - endif(ENABLE_FPGA) + endif() find_package(GNSSSIMULATOR QUIET) if(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") - else(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) - ExternalProject_Add( - gnss-sim - GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator - GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - if(ENABLE_INSTALL_TESTS) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) - set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) - add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") - else(ENABLE_INSTALL_TESTS) - set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) - add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") - endif(ENABLE_INSTALL_TESTS) - endif(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + else() + ExternalProject_Add( + gnss-sim + GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator + GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + if(ENABLE_INSTALL_TESTS) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) + set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) + add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") + else() + set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) + add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") + endif() + endif() ################################################################################ # Local installation of GPSTk http://www.gpstk.org/ @@ -229,10 +229,10 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) find_package(GPSTK) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) message(STATUS "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing 'make'.") - if ("${TOOLCHAIN_ARG}" STREQUAL "") + if("${TOOLCHAIN_ARG}" STREQUAL "") set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") - endif("${TOOLCHAIN_ARG}" STREQUAL "") + endif() include(GNUInstallDirs) string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) if(CMAKE_VERSION VERSION_LESS 3.2) @@ -246,7 +246,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) UPDATE_COMMAND "" PATCH_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) + else() ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk @@ -258,24 +258,24 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) UPDATE_COMMAND "" PATCH_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") set(OWN_GPSTK True) - else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + else() set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") - endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) -endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) + endif() +endif() -if (ENABLE_UNIT_TESTING_EXTRA) +if(ENABLE_UNIT_TESTING_EXTRA) set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) -endif (ENABLE_UNIT_TESTING_EXTRA) +endif() if(ENABLE_UNIT_TESTING_EXTRA) add_definitions(-DEXTRA_TESTS) @@ -284,18 +284,18 @@ if(ENABLE_UNIT_TESTING_EXTRA) file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat SHOW_PROGRESS EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) + endif() if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) message(STATUS "Downloading some data files for testing...") file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) + endif() if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - endif(ENABLE_INSTALL_TESTS) -endif(ENABLE_UNIT_TESTING_EXTRA) + endif() +endif() if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) @@ -305,7 +305,7 @@ if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) add_definitions(-DTEST_PATH="${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/") -else(ENABLE_INSTALL_TESTS) +else() file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) @@ -313,7 +313,7 @@ else(ENABLE_INSTALL_TESTS) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/thirdparty/") -endif(ENABLE_INSTALL_TESTS) +endif() set(LIST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRECTORIES} @@ -400,44 +400,46 @@ if(ENABLE_UNIT_TESTING) ) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(run_tests gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - endif(NOT ${GTEST_DIR_LOCAL}) + endif() if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) file(REMOVE ${CMAKE_SOURCE_DIR}/install/run_tests) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) + endif() install(TARGETS run_tests RUNTIME DESTINATION bin COMPONENT "run_tests") - else(ENABLE_INSTALL_TESTS) + else() add_custom_command(TARGET run_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) - endif(ENABLE_INSTALL_TESTS) -endif(ENABLE_UNIT_TESTING) + endif() +endif() if(ENABLE_FPGA) add_executable(gps_l1_ca_dll_pll_tracking_test_fpga - ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc + ) target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - ${MATIO_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_processing_testing_lib - ) + ${Boost_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_LIBRARIES} + ${MATIO_LIBRARIES} + channel_fsm + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_processing_testing_lib + ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga - RUNTIME DESTINATION bin - COMPONENT "fpga-test") -endif(ENABLE_FPGA) + RUNTIME DESTINATION bin + COMPONENT "fpga-test" + ) +endif() @@ -451,14 +453,14 @@ function(add_system_test executable) # Ensure that executable is rebuilt if it was previously built and then removed if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES}) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + endif() add_executable(${executable} ${SYSTEM_TEST_SOURCES}) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(${executable} gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(NOT ${GTEST_DIR_LOCAL}) + else() add_dependencies(${executable} gtest) - endif(NOT ${GTEST_DIR_LOCAL}) + endif() include_directories(${OPT_INCLUDES_}) target_link_libraries(${executable} ${OPT_LIBS_}) @@ -466,14 +468,14 @@ function(add_system_test executable) if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) file(REMOVE ${CMAKE_SOURCE_DIR}/install/${executable}) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + endif() install(TARGETS ${executable} RUNTIME DESTINATION bin COMPONENT "${executable}_test") - else(ENABLE_INSTALL_TESTS) + else() add_custom_command(TARGET ${executable} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) - endif(ENABLE_INSTALL_TESTS) -endfunction(add_system_test) + endif() +endfunction() if(ENABLE_SYSTEM_TESTING) @@ -482,10 +484,10 @@ if(ENABLE_SYSTEM_TESTING) set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}") string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}") string(REPLACE "\"" "" HOST_SYSTEM "${HOST_SYSTEM}") - endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(HOST_SYSTEM "MacOS") - endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + endif() add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") #### TTFF @@ -505,32 +507,22 @@ if(ENABLE_SYSTEM_TESTING) ${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters system_testing_lib) - add_system_test(position_test) - - #if(GPSTK_FOUND OR OWN_GPSTK) - ## OBS_SYSTEM_TEST and OBS_GPS_L1_SYSTEM_TEST - # set(OPT_LIBS_ ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} - # gnss_sp_libs gnss_rx ${GPSTK_LIBRARY}) - # set(OPT_INCLUDES_ ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) - # add_system_test(obs_gps_l1_system_test) - # add_system_test(obs_system_test) - #endif(GPSTK_FOUND OR OWN_GPSTK) - else(ENABLE_SYSTEM_TESTING_EXTRA) + else() # Avoid working with old executables if they were switched ON and then OFF if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - endif(ENABLE_SYSTEM_TESTING_EXTRA) -else(ENABLE_SYSTEM_TESTING) + endif() + endif() +else() # Avoid working with old executables if they were switched ON and then OFF if(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) file(REMOVE ${CMAKE_SOURCE_DIR}/install/ttff) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) + endif() if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) -endif(ENABLE_SYSTEM_TESTING) + endif() +endif() ######################################################### @@ -550,13 +542,15 @@ target_link_libraries(flowgraph_test ${Boost_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) + add_test(flowgraph_test flowgraph_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(flowgraph_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(flowgraph_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST flowgraph_test PROPERTY TIMEOUT 30) ######################################################### @@ -569,7 +563,8 @@ add_executable(gnss_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc +) target_link_libraries(gnss_block_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} @@ -581,19 +576,21 @@ target_link_libraries(gnss_block_test ${Boost_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) add_test(gnss_block_test gnss_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnss_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(gnss_block_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST gnss_block_test PROPERTY TIMEOUT 60) ######################################################### add_executable(gnuradio_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc +) target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} @@ -605,40 +602,42 @@ target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) add_test(gnuradio_block_test gnuradio_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnuradio_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(gnuradio_block_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) ######################################################### add_executable(matio_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc) - + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc +) target_link_libraries(matio_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} ${MATIO_LIBRARIES} - gnss_system_parameters) + gnss_system_parameters +) add_test(matio_test matio_test) if(NOT ${GTEST_DIR_LOCAL}) if(MATIO_FOUND) add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(MATIO_FOUND) + else() add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(MATIO_FOUND) -else(NOT ${GTEST_DIR_LOCAL}) + endif() +else() if(MATIO_FOUND) add_dependencies(matio_test gtest) - else(MATIO_FOUND) + else() add_dependencies(matio_test gtest matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(MATIO_FOUND) -endif(NOT ${GTEST_DIR_LOCAL}) + endif() +endif() set_property(TEST matio_test PROPERTY TIMEOUT 30) ######################################################### @@ -663,9 +662,9 @@ target_link_libraries(acq_test ${Boost_LIBRARIES} add_test(acq_test acq_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(acq_test acq_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(acq_test acq_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST acq_test PROPERTY TIMEOUT 30) ######################################################### @@ -674,7 +673,8 @@ add_executable(trk_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc +) target_link_libraries(trk_test ${Boost_LIBRARIES} ${GFlags_LIBS} @@ -688,13 +688,14 @@ target_link_libraries(trk_test ${Boost_LIBRARIES} gnss_rx gnss_system_parameters signal_generator_blocks - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) add_test(trk_test trk_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(trk_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(trk_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST trk_test PROPERTY TIMEOUT 30) @@ -703,29 +704,31 @@ set_property(TEST trk_test PROPERTY TIMEOUT 30) if(NOT ENABLE_PACKAGING) add_executable(control_thread_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc + ) target_link_libraries(control_thread_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} - gnss_rx) + gnss_rx + ) add_test(control_thread_test control_thread_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(control_thread_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(NOT ${GTEST_DIR_LOCAL}) + else() add_dependencies(control_thread_test gtest) - endif(NOT ${GTEST_DIR_LOCAL}) + endif() set_property(TEST control_thread_test PROPERTY TIMEOUT 30) -endif(NOT ENABLE_PACKAGING) +endif() ######################################################### if(ENABLE_PACKAGING) add_dependencies(check flowgraph_test gnss_block_test gnuradio_block_test acq_test trk_test matio_test) -else(ENABLE_PACKAGING) +else() add_dependencies(check control_thread_test flowgraph_test gnss_block_test gnuradio_block_test acq_test trk_test matio_test) -endif(ENABLE_PACKAGING) +endif() diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 89b6970c3..178f83479 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -23,22 +23,29 @@ set(SYSTEM_TESTING_LIB_SOURCES ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} ) - file(GLOB SYSTEM_TESTING_LIB_HEADERS "*.h") list(SORT SYSTEM_TESTING_LIB_HEADERS) -add_library(system_testing_lib ${SYSTEM_TESTING_LIB_SOURCES} ${SYSTEM_TESTING_LIB_HEADERS}) + +add_library(system_testing_lib + ${SYSTEM_TESTING_LIB_SOURCES} + ${SYSTEM_TESTING_LIB_HEADERS} +) + source_group(Headers FILES ${SYSTEM_TESTING_LIB_HEADERS}) if(NOT MATIO_FOUND) - add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) -else(NOT MATIO_FOUND) - add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE}) -endif(NOT MATIO_FOUND) \ No newline at end of file + add_dependencies(system_testing_lib + armadillo-${armadillo_RELEASE} + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) +else() + add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE}) +endif() diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index 7d15075f2..d0bd655d7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -21,29 +21,36 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES acquisition_dump_reader.cc acquisition_msg_rx.cc tracking_dump_reader.cc - tlm_dump_reader.cc - observables_dump_reader.cc + tlm_dump_reader.cc + observables_dump_reader.cc tracking_true_obs_reader.cc true_observables_reader.cc ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) file(GLOB SIGNAL_PROCESSING_TESTING_LIB_HEADERS "*.h") list(SORT SIGNAL_PROCESSING_TESTING_LIB_HEADERS) -add_library(signal_processing_testing_lib ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) + +add_library(signal_processing_testing_lib + ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} + ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS} +) + source_group(Headers FILES ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) if(NOT MATIO_FOUND) - add_dependencies(signal_processing_testing_lib matio-${GNSSSDR_MATIO_LOCAL_VERSION} glog-${glog_RELEASE}) -else(NOT MATIO_FOUND) - add_dependencies(signal_processing_testing_lib glog-${glog_RELEASE}) -endif(NOT MATIO_FOUND) + add_dependencies(signal_processing_testing_lib + matio-${GNSSSDR_MATIO_LOCAL_VERSION} glog-${glog_RELEASE} + ) +else() + add_dependencies(signal_processing_testing_lib glog-${glog_RELEASE}) +endif() diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index bd1a31852..c68294b45 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -20,4 +20,4 @@ add_subdirectory(front-end-cal) if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) add_subdirectory(rinex2assist) -endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) +endif() diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 817676b30..16dfa40be 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -19,7 +19,7 @@ if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() set(FRONT_END_CAL_SOURCES front_end_cal.cc) set(FRONT_END_CAL_HEADERS front_end_cal.h) @@ -112,6 +112,5 @@ find_program(GZIP gzip if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz") - install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1) -endif(NOT GZIP_NOTFOUND) +endif() diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 0461d6185..f99b52421 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -22,7 +22,7 @@ if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) -endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) +endif() set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) @@ -48,11 +48,11 @@ target_link_libraries(rinex2assist if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) -endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) +endif() add_custom_command(TARGET rinex2assist POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${CMAKE_SOURCE_DIR}/install/$ ) install(TARGETS rinex2assist From af8d93af1a9f630538b599274431019e9c597f18 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 18:41:36 +0100 Subject: [PATCH 10/52] Remove unused variable --- .../signal_source/gnuradio_blocks/labsat23_source.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 89e535df8..34731a1c1 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -236,8 +236,8 @@ int labsat23_source::general_work(int noutput_items, //std::cout << "Section ID: " << (int)section_id << std::endl; byte_counter += 2; - uint8_t section_lenght_bytes = 0; - section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter + 1] << 8) | (memblock[byte_counter + 2] << 16) | (memblock[byte_counter + 3] << 24); + //uint8_t section_lenght_bytes = 0; + //section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter + 1] << 8) | (memblock[byte_counter + 2] << 16) | (memblock[byte_counter + 3] << 24); //std::cout << "section_lenght_bytes=" << (int)section_lenght_bytes << std::endl; byte_counter += 4; From 3f89ed8e6bfe2cd7f37e2c0a07ff138a438f6b1b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 19:23:13 +0100 Subject: [PATCH 11/52] Add missing Galileo ephemeris parameter --- src/utils/rinex2assist/main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 71b4b97fc..58cc48c0b 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -205,6 +205,7 @@ int main(int argc, char** argv) eph.i_0_2 = rne.i0; eph.omega_2 = rne.w; eph.OMEGA_dot_3 = rne.OMEGAdot; + eph.delta_n_3 = rne.dn; eph.iDot_2 = rne.idot; eph.C_uc_3 = rne.Cuc; eph.C_us_3 = rne.Cus; From 8c48b80e8b7f741a40f7395939013a59222c0398 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 23:43:48 +0100 Subject: [PATCH 12/52] Fix value --- .../galileo_navigation_message.cc | 2 +- .../gps_cnav_navigation_message.cc | 2 +- .../gps_navigation_message.cc | 2 +- src/utils/rinex2assist/README.md | 34 +++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/utils/rinex2assist/README.md diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 25a8fc241..e94179e1b 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -306,7 +306,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset Date: Sun, 25 Nov 2018 10:32:21 +0100 Subject: [PATCH 13/52] Add style improvements to CMake scripts --- .../volk_gnsssdr/CMakeLists.txt | 117 ++++++------ .../volk_gnsssdr/apps/CMakeLists.txt | 59 +++--- .../volk_gnsssdr/cmake/Modules/FindORC.cmake | 86 +++++---- .../cmake/Modules/VolkAddTest.cmake | 14 +- .../cmake/Modules/VolkBoost.cmake | 40 ++-- .../cmake/Modules/VolkBuildTypes.cmake | 66 +++---- .../cmake/Modules/VolkGnsssdrConfig.cmake.in | 30 +-- .../Modules/VolkGnsssdrConfigVersion.cmake.in | 6 +- .../cmake/Modules/VolkPython.cmake | 40 ++-- .../volk_gnsssdr/lib/CMakeLists.txt | 180 +++++++++--------- 10 files changed, 320 insertions(+), 318 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 5a75277e6..df9463121 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -44,20 +44,20 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # retrieve the compiler's version from it string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) - else("${IS_APPLE}" STREQUAL "") + else() set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) set(APPLE_STR "Apple ") # retrieve the compiler's version from it string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) - endif("${IS_APPLE}" STREQUAL "") + endif() if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") message(WARNING "\nThe compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - else(${_res} STREQUAL "0") + endif() + else() message(WARNING "\nCannot determine the version of the compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${_res} STREQUAL "0") -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() # Enable C++17 support in GCC >= 8.0.0 # Enable C++14 support in 8.0.0 > GCC >= 6.1.1 @@ -66,15 +66,15 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") + else() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + endif() + endif() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) +endif() # Enable C++17 support in Clang >= 6.0.0 # Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600 @@ -84,28 +84,28 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences if(CLANG_VERSION VERSION_LESS "600") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CLANG_VERSION VERSION_LESS "600") + else() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - endif(CLANG_VERSION VERSION_LESS "600") - else(CMAKE_SYSTEM_NAME MATCHES "Darwin") + endif() + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + else() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() + endif() + endif() +endif() if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 11) - endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) -endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + endif() +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") @@ -113,9 +113,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") if(CMAKE_VERSION VERSION_GREATER "3.0") cmake_policy(SET CMP0042 NEW) if(CMAKE_VERSION VERSION_GREATER "3.9") - cmake_policy(SET CMP0068 NEW) - endif(CMAKE_VERSION VERSION_GREATER "3.9") -endif(CMAKE_VERSION VERSION_GREATER "3.0") + cmake_policy(SET CMP0068 NEW) + endif() +endif() option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF) @@ -129,7 +129,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: defaulting to release.") endif() -VOLK_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE}) +volk_check_build_type(${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") @@ -144,14 +144,14 @@ include(VolkVersion) #setup version info ######################################################################## # Environment setup ######################################################################## -IF(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) - SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) -ENDIF() +if(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) + set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) +endif() -IF(NOT DEFINED CROSSCOMPILE_MULTILIB) - SET(CROSSCOMPILE_MULTILIB "") -ENDIF() -SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile") +if(NOT DEFINED CROSSCOMPILE_MULTILIB) + set(CROSSCOMPILE_MULTILIB "") +endif() +set(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile") if(MSVC) add_definitions(-D_USE_MATH_DEFINES) #enables math constants on all supported versions of MSVC @@ -160,16 +160,16 @@ if(MSVC) add_compile_options(/wd4752) add_compile_options(/wo4273) add_compile_options(/wo4838) -endif(MSVC) +endif() # allow 'large' files in 32 bit builds if(UNIX) - add_definitions( -D_LARGEFILE_SOURCE - -D_FILE_OFFSET_BITS=64 - -D_LARGE_FILES - -D_FORTIFY_SOURCE=2 - ) -endif(UNIX) + add_definitions(-D_LARGEFILE_SOURCE + -D_FILE_OFFSET_BITS=64 + -D_LARGE_FILES + -D_FORTIFY_SOURCE=2 + ) +endif() ######################################################################## @@ -178,9 +178,9 @@ endif(UNIX) # Python include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B -VOLK_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) -VOLK_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) -VOLK_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) +volk_python_check_module("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) +volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) +volk_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) if(NOT PYTHON_MIN_VER_FOUND) @@ -199,16 +199,16 @@ endif() # Boost if(MSVC) - if (NOT DEFINED BOOST_ALL_DYN_LINK) + if(NOT DEFINED BOOST_ALL_DYN_LINK) set(BOOST_ALL_DYN_LINK TRUE) endif() set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") if(BOOST_ALL_DYN_LINK) add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc - else(BOOST_ALL_DYN_LINK) + else() unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link - endif(BOOST_ALL_DYN_LINK) -endif(MSVC) + endif() +endif() include(VolkBoost) @@ -220,9 +220,9 @@ endif() option(ENABLE_ORC "Enable Orc" True) if(ENABLE_ORC) find_package(ORC) -else(ENABLE_ORC) +else() message(STATUS "Disabling use of ORC") -endif(ENABLE_ORC) +endif() ######################################################################## @@ -240,7 +240,7 @@ if(DOXYGEN_FOUND) WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT "Generating documentation with Doxygen" VERBATIM ) -endif(DOXYGEN_FOUND) +endif() ######################################################################## @@ -255,7 +255,8 @@ set(includedir "\${prefix}/include") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr.pc.in ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc -@ONLY) + @ONLY +) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc @@ -304,17 +305,17 @@ if(APPLE) set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE PATH "Library Install Name Destination Directory" FORCE) - endif(NOT CMAKE_INSTALL_NAME_DIR) + endif() if(NOT CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE PATH "Library Install RPath" FORCE) - endif(NOT CMAKE_INSTALL_RPATH) + endif() if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "Do Build Using Library Install RPath" FORCE) - endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) -endif(APPLE) + endif() +endif() ######################################################################## @@ -358,7 +359,7 @@ configure_file( if(NOT CMAKE_MODULES_DIR) set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake) -endif(NOT CMAKE_MODULES_DIR) +endif() install( FILES @@ -371,7 +372,7 @@ install( ######################################################################## # Option to enable QA testing, on by default ######################################################################## -OPTION(ENABLE_TESTING "Enable QA testing" ON) +option(ENABLE_TESTING "Enable QA testing" ON) if(ENABLE_TESTING) message(STATUS "QA Testing is enabled.") else() @@ -383,7 +384,7 @@ message(STATUS " Modify using: -DENABLE_TESTING=ON/OFF") ######################################################################## # Option to enable post-build profiling using volk_profile, off by default ######################################################################## -OPTION(ENABLE_PROFILING "Launch system profiler after build" OFF) +option(ENABLE_PROFILING "Launch system profiler after build" OFF) if(ENABLE_PROFILING) set(ENABLE_STATIC_LIBS ON) if(DEFINED VOLK_CONFIGPATH) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt index 00a198b5d..b1afa4ed0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt @@ -22,7 +22,7 @@ ######################################################################## if(MSVC) include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc) -endif(MSVC) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -37,26 +37,26 @@ include_directories( set(Clang_required_link "") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(Clang_required_link "c++") - endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(Clang_required_link "c++") + endif() +endif() if(ORC_FOUND) set(orc_lib ${ORC_LIBRARIES}) -elseif(ORC_FOUND) +else() set(orc_lib "") -endif(ORC_FOUND) +endif() # allow 'large' files in 32 bit builds if(UNIX) - add_definitions( -D_LARGEFILE_SOURCE - -D_FILE_OFFSET_BITS=64 - -D_LARGE_FILES - ) -endif(UNIX) + add_definitions(-D_LARGEFILE_SOURCE + -D_FILE_OFFSET_BITS=64 + -D_LARGE_FILES + ) +endif() # MAKE volk_gnsssdr_profile @@ -68,18 +68,18 @@ add_executable(volk_gnsssdr_profile if(ENABLE_STATIC_LIBS) target_link_libraries(volk_gnsssdr_profile volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) -else(ENABLE_STATIC_LIBS) +else() target_link_libraries(volk_gnsssdr_profile volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) add_dependencies(volk_gnsssdr_profile volk_gnsssdr) -endif(ENABLE_STATIC_LIBS) +endif() if(ENABLE_STRIP) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set_target_properties(volk_gnsssdr_profile - PROPERTIES LINK_FLAGS "-s") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif(ENABLE_STRIP) + PROPERTIES LINK_FLAGS "-s") + endif() +endif() install( @@ -92,18 +92,18 @@ install( # MAKE volk_gnsssdr-config-info add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_option_helpers.cc) if(ENABLE_STATIC_LIBS) - target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib}) -else(ENABLE_STATIC_LIBS) - target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib}) - add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) -endif(ENABLE_STATIC_LIBS) + target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib}) +else() + target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib}) + add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) +endif() if(ENABLE_STRIP) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set_target_properties(volk_gnsssdr-config-info - PROPERTIES LINK_FLAGS "-s") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif(ENABLE_STRIP) + PROPERTIES LINK_FLAGS "-s") + endif() +endif() install( TARGETS volk_gnsssdr-config-info @@ -114,17 +114,14 @@ install( # Launch volk_gnsssdr_profile if requested to do so if(ENABLE_PROFILING) - if(DEFINED VOLK_CONFIGPATH) + if(DEFINED VOLK_CONFIGPATH) set( VOLK_CONFIG_ARG "-p${VOLK_CONFIGPATH}" ) set( VOLK_CONFIG "${VOLK_CONFIGPATH}/volk_gnsssdr_config" ) - endif() - add_custom_command(OUTPUT ${VOLK_CONFIG} + endif() + add_custom_command(OUTPUT ${VOLK_CONFIG} COMMAND volk_gnsssdr_profile "${VOLK_CONFIG_ARG}" DEPENDS volk_gnsssdr_profile COMMENT "Launching profiler, this may take a few minutes..." ) add_custom_target(volk-gnsssdr-profile-run ALL DEPENDS ${VOLK_CONFIG}) endif() - - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake index 0341d3f7b..1154d2e7a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake @@ -16,52 +16,56 @@ # along with GNSS-SDR. If not, see . -FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") +find_package(PkgConfig) +pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") -FIND_PROGRAM(ORCC_EXECUTABLE orcc - HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) +find_program(ORCC_EXECUTABLE orcc + HINTS ${PC_ORC_TOOLSDIR} + PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin +) -FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h - HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) - - -FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} - HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -FIND_LIBRARY(ORC_LIB orc-0.4 - HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -LIST(APPEND ORC_LIBRARY - ${ORC_LIB} +find_path(ORC_INCLUDE_DIR NAMES orc/orc.h + HINTS ${PC_ORC_INCLUDEDIR} + PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 ) -SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) -SET(ORC_LIBRARIES ${ORC_LIBRARY}) -SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} + HINTS ${PC_ORC_LIBDIR} + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) +find_library(ORC_LIB orc-0.4 + HINTS ${PC_ORC_LIBRARY_DIRS} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + +list(APPEND ORC_LIBRARY + ${ORC_LIB} +) + + +set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) +set(ORC_LIBRARIES ${ORC_LIBRARY}) +set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake index b01a99594..a2097046e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake @@ -30,7 +30,7 @@ set(__INCLUDED_VOLK_ADD_TEST TRUE) function(VOLK_GEN_TEST executable_name) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) + cmake_parse_arguments(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) add_executable(${executable_name} ${VOLK_TEST_SOURCES}) target_link_libraries(${executable_name} ${VOLK_TEST_TARGET_DEPS}) endfunction() @@ -53,7 +53,7 @@ function(VOLK_ADD_TEST test_name executable_name) #parse the arguments for component names include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) + cmake_parse_arguments(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) #set the initial environs to use set(environs ${VOLK_TEST_ENVIRONS}) @@ -146,7 +146,7 @@ function(VOLK_ADD_TEST test_name executable_name) #each line sets an environment variable foreach(environ ${environs}) file(APPEND ${sh_file} "export ${environ}\n") - endforeach(environ) + endforeach() set(VOLK_TEST_ARGS "${test_name}") @@ -166,7 +166,7 @@ function(VOLK_ADD_TEST test_name executable_name) COMMAND ${SHELL} ${sh_file} ${TARGET_DIR_LIST} ) - endif(UNIX) + endif() if(WIN32) #In the land of windows, all libraries must be in the PATH. Since @@ -199,7 +199,7 @@ function(VOLK_ADD_TEST test_name executable_name) #each line sets an environment variable foreach(environ ${environs}) file(APPEND ${bat_file} "SET ${environ}\n") - endforeach(environ) + endforeach() set(VOLK_TEST_ARGS "${test_name}") @@ -213,7 +213,7 @@ function(VOLK_ADD_TEST test_name executable_name) add_test(NAME qa_${test_name} COMMAND ${bat_file} ${TARGET_DIR_LIST} ) - endif(WIN32) + endif() -endfunction(VOLK_ADD_TEST) +endfunction() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake index 56eb75d47..2aea96b2a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake @@ -31,21 +31,21 @@ set(BOOST_REQUIRED_COMPONENTS if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix -endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") +endif() if(MSVC) set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono) - if (NOT DEFINED BOOST_ALL_DYN_LINK) + if(NOT DEFINED BOOST_ALL_DYN_LINK) set(BOOST_ALL_DYN_LINK TRUE) endif() set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") if(BOOST_ALL_DYN_LINK) add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc - else(BOOST_ALL_DYN_LINK) + else() unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link - endif(BOOST_ALL_DYN_LINK) -endif(MSVC) + endif() +endif() find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) @@ -68,10 +68,10 @@ set(Boost_ADDITIONAL_VERSIONS # Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669 # Similar problems with Boost 1.46 and 1.47. -OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF) +option(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF) if(ENABLE_BAD_BOOST) - MESSAGE(STATUS "Enabling use of known bad versions of Boost.") -endif(ENABLE_BAD_BOOST) + message(STATUS "Enabling use of known bad versions of Boost.") +endif() # For any unsuitable Boost version, add the version number below in # the following format: XXYYZZ @@ -80,17 +80,17 @@ endif(ENABLE_BAD_BOOST) # YY is the minor version number ('46' for 1.46) # ZZ is the patcher version number (typically just '00') set(Boost_NOGO_VERSIONS - 104600 104601 104700 105200 - ) + 104600 104601 104700 105200 +) foreach(ver ${Boost_NOGO_VERSIONS}) - if("${Boost_VERSION}" STREQUAL "${ver}") - if(NOT ENABLE_BAD_BOOST) - MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.") - set(Boost_FOUND FALSE) - else(NOT ENABLE_BAD_BOOST) - MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.") - set(Boost_FOUND TRUE) - endif(NOT ENABLE_BAD_BOOST) - endif("${Boost_VERSION}" STREQUAL "${ver}") -endforeach(ver) + if("${Boost_VERSION}" STREQUAL "${ver}") + if(NOT ENABLE_BAD_BOOST) + message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.") + set(Boost_FOUND FALSE) + else() + message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.") + set(Boost_FOUND TRUE) + endif() + endif() +endforeach() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake index 5b2f092ec..6f45f1683 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake @@ -53,16 +53,16 @@ list(APPEND AVAIL_BUILDTYPES # the avialable build types. ######################################################################## function(VOLK_CHECK_BUILD_TYPE settype) - STRING(TOUPPER ${settype} _settype) + string(TOUPPER ${settype} _settype) foreach(btype ${AVAIL_BUILDTYPES}) - STRING(TOUPPER ${btype} _btype) + string(TOUPPER ${btype} _btype) if(${_settype} STREQUAL ${_btype}) return() # found it; exit cleanly - endif(${_settype} STREQUAL ${_btype}) - endforeach(btype) + endif() + endforeach() # Build type not found; error out message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") -endfunction(VOLK_CHECK_BUILD_TYPE) +endfunction() ######################################################################## # For GCC and Clang, we can set a build type: @@ -74,23 +74,23 @@ endfunction(VOLK_CHECK_BUILD_TYPE) # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING + set(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING "Flags used by the C++ compiler during DebugParanoid builds." FORCE) - SET(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING + set(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING "Flags used by the C compiler during DebugParanoid builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID + set(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during NoOptWithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID + set(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_DEBUGPARANOID CMAKE_C_FLAGS_DEBUGPARANOID CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID CMAKE_SHARED_LINKER_DEBUGPARANOID) -endif(NOT WIN32) +endif() ######################################################################## @@ -105,23 +105,23 @@ endif(NOT WIN32) # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING + set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING "Flags used by the C++ compiler during NoOptWithASM builds." FORCE) - SET(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING + set(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING "Flags used by the C compiler during NoOptWithASM builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM + set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during NoOptWithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM + set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_NOOPTWITHASM CMAKE_C_FLAGS_NOOPTWITHASM CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) -endif(NOT WIN32) +endif() ######################################################################## @@ -137,23 +137,23 @@ endif(NOT WIN32) ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING + set(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING "Flags used by the C++ compiler during O2WithASM builds." FORCE) - SET(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING + set(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING "Flags used by the C compiler during O2WithASM builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_O2WITHASM + set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during O2WithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM + set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during O2WithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_O2WITHASM CMAKE_C_FLAGS_O2WITHASM CMAKE_EXE_LINKER_FLAGS_O2WITHASM CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) -endif(NOT WIN32) +endif() ######################################################################## @@ -169,23 +169,23 @@ endif(NOT WIN32) ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING + set(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING "Flags used by the C++ compiler during O3WithASM builds." FORCE) - SET(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING + set(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING "Flags used by the C compiler during O3WithASM builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_O3WITHASM + set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during O3WithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM + set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during O3WithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_O3WITHASM CMAKE_C_FLAGS_O3WITHASM CMAKE_EXE_LINKER_FLAGS_O3WITHASM CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) -endif(NOT WIN32) +endif() ######################################################################## # For GCC and Clang, we can set a build type: @@ -197,14 +197,14 @@ endif(NOT WIN32) # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "Flags used by the C++ compiler during Address Sanitized builds." FORCE) - SET(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "Flags used by the C compiler during Address Sanitized builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_ASAN CMAKE_C_FLAGS_ASAN CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID CMAKE_SHARED_LINKER_DEBUGPARANOID) -endif(NOT WIN32) +endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in index 4838f13c0..af9e75169 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in @@ -15,33 +15,33 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) +include(FindPkgConfig) +pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) -FIND_PATH( +find_path( VOLK_GNSSSDR_INCLUDE_DIRS NAMES volk_gnsssdr/volk_gnsssdr.h HINTS $ENV{VOLK_DIR}/include ${PC_VOLK_INCLUDEDIR} PATHS /usr/local/include - /usr/include - /opt/local/include - "@CMAKE_INSTALL_PREFIX@/include" + /usr/include + /opt/local/include + "@CMAKE_INSTALL_PREFIX@/include" ) -FIND_LIBRARY( +find_library( VOLK_GNSSSDR_LIBRARIES NAMES volk_gnsssdr HINTS $ENV{VOLK_DIR}/lib ${PC_VOLK_LIBDIR} PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 - /opt/local/lib - "@CMAKE_INSTALL_PREFIX@/lib" + /usr/local/lib64 + /usr/lib + /usr/lib64 + /opt/local/lib + "@CMAKE_INSTALL_PREFIX@/lib" ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) -MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in index d7694fdb9..7808c7dbe 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in @@ -27,6 +27,6 @@ if(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION}) if(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) set(PACKAGE_VERSION_EXACT 1) # exact match for API version set(PACKAGE_VERSION_COMPATIBLE 1) # compat for minor/patch version - endif(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) - endif(${PACKAGE_FIND_VERSION_MINOR} EQUAL ${MINOR_VERSION}) -endif(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION}) + endif() + endif() +endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake index 809feb8e1..06c51883c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake @@ -32,30 +32,30 @@ if(CMAKE_VERSION VERSION_LESS 3.12) if(PYTHON_EXECUTABLE) message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) - else(PYTHON_EXECUTABLE) + else() message(STATUS "PYTHON_EXECUTABLE not set - using default python2") message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION}) if(NOT PYTHONINTERP_FOUND) message(STATUS "python2 not found - using python3") find_package(PythonInterp ${VOLK_PYTHON3_MIN_VERSION} REQUIRED) - endif(NOT PYTHONINTERP_FOUND) - endif(PYTHON_EXECUTABLE) + endif() + endif() find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) -else(CMAKE_VERSION VERSION_LESS 3.12) +else() if(PYTHON_EXECUTABLE) message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) - else(PYTHON_EXECUTABLE) - find_package (Python COMPONENTS Interpreter) + else() + find_package(Python COMPONENTS Interpreter) set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR}) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) - endif(PYTHON_EXECUTABLE) -endif(CMAKE_VERSION VERSION_LESS 3.12) + endif() +endif() -if (${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) +if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) set(PYTHON3 TRUE) -endif () +endif() @@ -79,7 +79,7 @@ macro(VOLK_PYTHON_CHECK_MODULE_RAW desc python_code have) message(STATUS "Python checking for ${desc} - not found") set(${have} FALSE) endif() -endmacro(VOLK_PYTHON_CHECK_MODULE_RAW) +endmacro() macro(VOLK_PYTHON_CHECK_MODULE desc mod cmd have) VOLK_PYTHON_CHECK_MODULE_RAW( @@ -92,7 +92,7 @@ except (ImportError, AssertionError): exit(-1) except: pass #########################################" "${have}") -endmacro(VOLK_PYTHON_CHECK_MODULE) +endmacro() ######################################################################## # Sets the python installation directory VOLK_PYTHON_DIR @@ -121,14 +121,14 @@ unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5] print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) add_custom_target(${_target} ALL DEPENDS ${ARGN}) -endfunction(VOLK_UNIQUE_TARGET) +endfunction() ######################################################################## # Install python sources (also builds and installs byte-compiled python) ######################################################################## function(VOLK_PYTHON_INSTALL) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) + cmake_parse_arguments(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) #################################################################### if(VOLK_PYTHON_INSTALL_FILES) @@ -162,7 +162,7 @@ function(VOLK_PYTHON_INSTALL) get_filename_component(pygen_path ${pygenfile} PATH) file(MAKE_DIRECTORY ${pygen_path}) - endforeach(pyfile) + endforeach() #the command to generate the pyc files add_custom_command( @@ -189,8 +189,8 @@ function(VOLK_PYTHON_INSTALL) #################################################################### file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) - if (CMAKE_CROSSCOMPILING) - set(pyexe_native "/usr/bin/env python") + if(CMAKE_CROSSCOMPILING) + set(pyexe_native "/usr/bin/env python") endif() foreach(pyfile ${VOLK_PYTHON_INSTALL_PROGRAMS}) @@ -220,13 +220,13 @@ function(VOLK_PYTHON_INSTALL) DESTINATION ${VOLK_PYTHON_INSTALL_DESTINATION} COMPONENT ${VOLK_PYTHON_INSTALL_COMPONENT} ) - endforeach(pyfile) + endforeach() endif() - VOLK_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) + volk_unique_target("pygen" ${python_install_gen_targets}) -endfunction(VOLK_PYTHON_INSTALL) +endfunction() ######################################################################## # Write the python helper script that generates byte code files diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index c538f7206..48c012c09 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -22,22 +22,22 @@ # header file detection ######################################################################## include(CheckIncludeFile) -CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H) +check_include_file(cpuid.h HAVE_CPUID_H) if(HAVE_CPUID_H) add_definitions(-DHAVE_CPUID_H) endif() -CHECK_INCLUDE_FILE(intrin.h HAVE_INTRIN_H) +check_include_file(intrin.h HAVE_INTRIN_H) if(HAVE_INTRIN_H) add_definitions(-DHAVE_INTRIN_H) endif() -CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H) +check_include_file(fenv.h HAVE_FENV_H) if(HAVE_FENV_H) add_definitions(-DHAVE_FENV_H) endif() -CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H) +check_include_file(dlfcn.h HAVE_DLFCN_H) if(HAVE_DLFCN_H) add_definitions(-DHAVE_DLFCN_H) list(APPEND volk_gnsssdr_libraries ${CMAKE_DL_LIBS}) @@ -62,7 +62,7 @@ endif() ######################################################################## if(COMPILER_NAME MATCHES "GNU") include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) + check_cxx_compiler_flag("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) if(HAVE_WERROR_UNUSED_CMD_LINE_ARG) set(VOLK_FLAG_CHECK_FLAGS "-Werror=unused-command-line-argument") endif() @@ -74,20 +74,20 @@ endif() ######################################################################## include(CheckSymbolExists) -CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) - +check_symbol_exists(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) + if(HAVE_POSIX_MEMALIGN) add_definitions(-DHAVE_POSIX_MEMALIGN) -endif(HAVE_POSIX_MEMALIGN) +endif() if(NOT DEFINED _XOPEN_SOURCE) add_definitions(-D_XOPEN_SOURCE=700) -endif(NOT DEFINED _XOPEN_SOURCE) +endif() ######################################################################## # detect x86 flavor of CPU ######################################################################## -if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64|AMD64)$") +if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64|AMD64)$") message(STATUS "x86* CPU detected") set(CPU_IS_x86 TRUE) endif() @@ -106,7 +106,7 @@ macro(check_arch arch_name) set(flags ${ARGN}) set(have_${arch_name} TRUE) foreach(flag ${flags}) - if (MSVC AND (${flag} STREQUAL "/arch:SSE2" OR ${flag} STREQUAL "/arch:SSE" )) + if(MSVC AND (${flag} STREQUAL "/arch:SSE2" OR ${flag} STREQUAL "/arch:SSE")) # SSE/SSE2 is supported in MSVC since VS 2005 but flag not available when compiling 64-bit so do not check else() include(CheckCXXCompilerFlag) @@ -119,27 +119,27 @@ macro(check_arch arch_name) if(VOLK_FLAG_CHECK_FLAGS) set(CMAKE_REQUIRED_FLAGS ${VOLK_FLAG_CHECK_FLAGS}) endif() - CHECK_CXX_COMPILER_FLAG(${flag} ${have_flag}) + check_cxx_compiler_flag(${flag} ${have_flag}) unset(CMAKE_REQUIRED_FLAGS) - if (NOT ${have_flag}) + if(NOT ${have_flag}) set(have_${arch_name} FALSE) endif() endif() endforeach() - if (have_${arch_name}) + if(have_${arch_name}) list(APPEND available_archs ${arch_name}) endif() -endmacro(check_arch) +endmacro() foreach(line ${arch_flag_lines}) string(REGEX REPLACE "," ";" arch_flags ${line}) check_arch(${arch_flags}) -endforeach(line) +endforeach() macro(OVERRULE_ARCH arch reason) message(STATUS "${reason}, Overruled arch ${arch}") list(REMOVE_ITEM available_archs ${arch}) -endmacro(OVERRULE_ARCH) +endmacro() ######################################################################## # eliminate AVX on if not on x86, or if the compiler does not accept @@ -150,25 +150,25 @@ set(HAVE_XGETBV 0) set(HAVE_AVX_CVTPI32_PS 0) if(CPU_IS_x86) # check to see if the compiler/linker works with xgetb instruction - if (NOT MSVC) + if(NOT MSVC) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "unsigned long long _xgetbv(unsigned int index) { unsigned int eax, edx; __asm__ __volatile__(\"xgetbv\" : \"=a\"(eax), \"=d\"(edx) : \"c\"(index)); return ((unsigned long long)edx << 32) | eax; } int main (void) { (void) _xgetbv(0); return (0); }") - else (NOT MSVC) + else() #MSVC defines an intrinsic file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "#include \n #include \n int main() { int avxSupported = 0; \n#if (_MSC_FULL_VER >= 160040219) \nint cpuInfo[4]; __cpuid(cpuInfo, 1);\nif ((cpuInfo[2] & (1 << 27) || 0) && (cpuInfo[2] & (1 << 28) || 0)) \n{\nunsigned long long xcrFeatureMask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);\n avxSupported = (xcrFeatureMask & 0x6) == 6;}\n#endif \n return 1- avxSupported; }") - endif(NOT MSVC) + endif() execute_process(COMMAND ${CMAKE_C_COMPILER} -o ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_compile_result) if(NOT ${avx_compile_result} EQUAL 0) - OVERRULE_ARCH(avx "Compiler or linker missing xgetbv instruction") + overrule_arch(avx "Compiler or linker missing xgetbv instruction") elseif(NOT CROSSCOMPILE_MULTILIB) execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_exe_result) if(NOT ${avx_exe_result} EQUAL 0) - OVERRULE_ARCH(avx "CPU missing xgetbv") + overrule_arch(avx "CPU missing xgetbv") else() set(HAVE_XGETBV 1) endif() @@ -184,7 +184,7 @@ if(CPU_IS_x86) ######################################################################### # check to see if the compiler/linker works with cvtpi32_ps instrinsic when using AVX - if (CMAKE_SIZEOF_VOID_P EQUAL 4) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c "#include \nint main (void) {__m128 __a; __m64 __b; __m128 foo = _mm_cvtpi32_ps(__a, __b); return (0); }") execute_process(COMMAND ${CMAKE_C_COMPILER} -mavx -o ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps @@ -192,13 +192,13 @@ if(CPU_IS_x86) OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_compile_result) if(NOT ${avx_compile_result} EQUAL 0) - OVERRULE_ARCH(avx "Compiler missing cvtpi32_ps instrinsic") + overrule_arch(avx "Compiler missing cvtpi32_ps instrinsic") elseif(NOT CROSSCOMPILE_MULTILIB) execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_exe_result) if(NOT ${avx_exe_result} EQUAL 0) - OVERRULE_ARCH(avx "CPU missing cvtpi32_ps") + overrule_arch(avx "CPU missing cvtpi32_ps") else() set(HAVE_AVX_CVTPI32_PS 1) endif() @@ -207,10 +207,10 @@ if(CPU_IS_x86) endif() file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c) - else(CMAKE_SIZEOF_VOID_P EQUAL 4) - # 64-bit compilations won't need this command so don't overrule AVX - set(HAVE_AVX_CVTPI32_PS 0) - endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + else() + # 64-bit compilations won't need this command so don't overrule AVX + set(HAVE_AVX_CVTPI32_PS 0) + endif() # Disable SSE4a if Clang is less than version 3.2 if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") @@ -222,14 +222,14 @@ if(CPU_IS_x86) execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE clang_version) string(REGEX MATCH "[0-9].[0-9]" CMAKE_C_COMPILER_VERSION ${clang_version}) - endif(CMAKE_VERSION VERSION_LESS "2.8.10") + endif() if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") - OVERRULE_ARCH(sse4_a "Clang >= 3.2 required for SSE4a") - endif(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") - endif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + overrule_arch(sse4_a "Clang >= 3.2 required for SSE4a") + endif() + endif() -endif(CPU_IS_x86) +endif() if(${HAVE_XGETBV}) add_definitions(-DHAVE_XGETBV) @@ -244,17 +244,17 @@ endif() ######################################################################## if(NOT CPU_IS_x86) - OVERRULE_ARCH(3dnow "Architecture is not x86 or x86_64") - OVERRULE_ARCH(mmx "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse2 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse3 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(ssse3 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse4_a "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse4_1 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse4_2 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(avx "Architecture is not x86 or x86_64") -endif(NOT CPU_IS_x86) + overrule_arch(3dnow "Architecture is not x86 or x86_64") + overrule_arch(mmx "Architecture is not x86 or x86_64") + overrule_arch(sse "Architecture is not x86 or x86_64") + overrule_arch(sse2 "Architecture is not x86 or x86_64") + overrule_arch(sse3 "Architecture is not x86 or x86_64") + overrule_arch(ssse3 "Architecture is not x86 or x86_64") + overrule_arch(sse4_a "Architecture is not x86 or x86_64") + overrule_arch(sse4_1 "Architecture is not x86 or x86_64") + overrule_arch(sse4_2 "Architecture is not x86 or x86_64") + overrule_arch(avx "Architecture is not x86 or x86_64") +endif() ######################################################################## # Select neon based on ARM ISA version @@ -265,33 +265,33 @@ endif(NOT CPU_IS_x86) include(CheckCSourceCompiles) check_c_source_compiles("#include \nint main(){ uint8_t *dest; uint8x8_t res; vst1_u8(dest, res); }" - neon_compile_result) + neon_compile_result) if(neon_compile_result) check_c_source_compiles("int main(){asm volatile(\"vrev32.8 q0, q0\");}" - have_neonv7_result ) + have_neonv7_result) check_c_source_compiles("int main(){asm volatile(\"sub v1.4s,v1.4s,v1.4s\");}" - have_neonv8_result ) + have_neonv8_result) - if (have_neonv7_result) - OVERRULE_ARCH(neonv8 "CPU is armv7") + if(have_neonv7_result) + overrule_arch(neonv8 "CPU is armv7") endif() - if (have_neonv8_result) - OVERRULE_ARCH(neonv7 "CPU is armv8") + if(have_neonv8_result) + overrule_arch(neonv7 "CPU is armv8") endif() -else(neon_compile_result) - OVERRULE_ARCH(neon "Compiler doesn't support NEON") - OVERRULE_ARCH(neonv7 "Compiler doesn't support NEON") - OVERRULE_ARCH(neonv8 "Compiler doesn't support NEON") -endif(neon_compile_result) +else() + overrule_arch(neon "Compiler doesn't support NEON") + overrule_arch(neonv7 "Compiler doesn't support NEON") + overrule_arch(neonv8 "Compiler doesn't support NEON") +endif() ######################################################################## # implement overruling in the ORC case, # since ORC always passes flag detection ######################################################################## if(NOT ORC_FOUND) - OVERRULE_ARCH(orc "ORC support not found") + overrule_arch(orc "ORC support not found") endif() ######################################################################## @@ -301,16 +301,16 @@ endif() if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86) include(CheckTypeSize) check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY) - if (${SIZEOF_CPU} EQUAL 64) - OVERRULE_ARCH(32 "CPU width is 64 bits") + if(${SIZEOF_CPU} EQUAL 64) + overrule_arch(32 "CPU width is 64 bits") endif() - if (${SIZEOF_CPU} EQUAL 32) - OVERRULE_ARCH(64 "CPU width is 32 bits") + if(${SIZEOF_CPU} EQUAL 32) + overrule_arch(64 "CPU width is 32 bits") endif() #MSVC 64 bit does not have MMX, overrule it - if (${SIZEOF_CPU} EQUAL 64 AND MSVC) - OVERRULE_ARCH(mmx "No MMX for Win64") + if(${SIZEOF_CPU} EQUAL 64 AND MSVC) + overrule_arch(mmx "No MMX for Win64") endif() endif() @@ -340,12 +340,12 @@ execute_process( foreach(arch mmx orc 64 32) foreach(machine_name ${available_machines}) string(REPLACE "_${arch}" "" machine_name_no_arch ${machine_name}) - if (${machine_name} STREQUAL ${machine_name_no_arch}) + if(${machine_name} STREQUAL ${machine_name_no_arch}) else() list(REMOVE_ITEM available_machines ${machine_name_no_arch}) endif() - endforeach(machine_name) -endforeach(arch) + endforeach() +endforeach() ######################################################################## # done overrules! print the result @@ -373,7 +373,7 @@ macro(gen_template tmpl output) ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py --input ${tmpl} --output ${output} ${ARGN} ) -endmacro(gen_template) +endmacro() file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/volk_gnsssdr) @@ -399,13 +399,13 @@ if(MSVC) elseif(MSVC11) #Visual Studio 11 set(cmake_c_compiler_version "Microsoft Visual Studio 11.0") elseif(MSVC12) #Visual Studio 12 - SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0") + set(cmake_c_compiler_version "Microsoft Visual Studio 12.0") endif() else() execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE cmake_c_compiler_version) -endif(MSVC) -set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n" ) +endif() +set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n") foreach(machine_name ${available_machines}) #generate machine source @@ -419,8 +419,8 @@ foreach(machine_name ${available_machines}) --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE ) - MESSAGE(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") - set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n" ) + message(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") + set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n") if(${machine_name}_flags AND NOT MSVC) set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}") endif() @@ -428,12 +428,12 @@ foreach(machine_name ${available_machines}) #add to available machine defs string(TOUPPER LV_MACHINE_${machine_name} machine_def) list(APPEND machine_defs ${machine_def}) -endforeach(machine_name) +endforeach() # Convert to a C string to compile and display properly string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version) string(STRIP ${COMPILER_INFO} COMPILER_INFO) -MESSAGE(STATUS "Compiler Version: ${cmake_c_compiler_version}") +message(STATUS "Compiler Version: ${cmake_c_compiler_version}") string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version}) string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO}) @@ -462,7 +462,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") # set up the assembler flags and include the source files foreach(ARCH ${ASM_ARCHS_AVAILABLE}) string(REGEX MATCH "${ARCH}" ASM_ARCH "${available_archs}") - if( ASM_ARCH STREQUAL "neonv7" ) + if(ASM_ARCH STREQUAL "neonv7") message(STATUS "---- Adding ASM files") # we always use ATT syntax message(STATUS "-- Detected neon architecture; enabling ASM") # setup architecture specific assembler flags @@ -474,23 +474,23 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") foreach(asm_file ${asm_files}) list(APPEND volk_gnsssdr_sources ${asm_file}) message(STATUS "Adding source file: ${asm_file}") - endforeach(asm_file) + endforeach() endif() enable_language(ASM) set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) message(STATUS "c flags: ${FULL_C_FLAGS}") message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") - endforeach(ARCH) + endforeach() -else(${CMAKE_VERSION} VERSION_GREATER "2.8.9") +else() message(STATUS "Not enabling ASM support. CMake >= 2.8.10 required.") foreach(machine_name ${available_machines}) string(REGEX MATCH "neon" NEON_MACHINE ${machine_name}) - if( NEON_MACHINE STREQUAL "neon") + if(NEON_MACHINE STREQUAL "neon") message(FATAL_ERROR "CMake >= 2.8.10 is required for ARM NEON support") endif() endforeach() -endif(${CMAKE_VERSION} VERSION_GREATER "2.8.9") +endif() ######################################################################## # Handle orc support @@ -517,7 +517,7 @@ if(ORC_FOUND) ) list(APPEND volk_gnsssdr_sources ${orcc_gen}) - endforeach(orc_file) + endforeach() else() message(STATUS "Did not find liborc and orcc, disabling orc support...") endif() @@ -571,7 +571,7 @@ endif() if(CMAKE_VERSION VERSION_GREATER "2.8.7") #Create a volk_gnsssdr object library (requires cmake >= 2.8.8) add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) - + #Add dynamic library add_library(volk_gnsssdr SHARED $) target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES}) @@ -597,7 +597,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7") install(TARGETS volk_gnsssdr_static ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" ) - endif(ENABLE_STATIC_LIBS) + endif() #Older cmake versions (slower to build when building dynamic/static libs) else() @@ -619,14 +619,14 @@ else() if(NOT WIN32) set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) - endif(NOT WIN32) + endif() install(TARGETS volk_gnsssdr_static ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file ) - endif(ENABLE_STATIC_LIBS) + endif() +endif() -endif(CMAKE_VERSION VERSION_GREATER "2.8.7") ######################################################################## # Build the QA test application ######################################################################## @@ -641,7 +641,7 @@ if(ENABLE_TESTING) ) include(VolkAddTest) - VOLK_GEN_TEST("volk_gnsssdr_test_all" + volk_gen_test("volk_gnsssdr_test_all" SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc TARGET_DEPS volk_gnsssdr @@ -649,7 +649,7 @@ if(ENABLE_TESTING) foreach(kernel ${h_files}) get_filename_component(kernel ${kernel} NAME) string(REPLACE ".h" "" kernel ${kernel}) - VOLK_ADD_TEST(${kernel} "volk_gnsssdr_test_all") + volk_add_test(${kernel} "volk_gnsssdr_test_all") endforeach() -endif(ENABLE_TESTING) +endif() From b755f4a895b1efa300d89a0b674d7f2b2a23ee6c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 10:32:56 +0100 Subject: [PATCH 14/52] Fix value --- src/core/system_parameters/galileo_navigation_message.cc | 2 +- src/core/system_parameters/gps_cnav_navigation_message.cc | 2 +- src/core/system_parameters/gps_navigation_message.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index e94179e1b..4e72f62d3 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -306,7 +306,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset Date: Sun, 25 Nov 2018 12:29:56 +0100 Subject: [PATCH 15/52] Add ability to read compressed RINEX navigation files --- src/utils/rinex2assist/CMakeLists.txt | 2 ++ src/utils/rinex2assist/README.md | 28 ++++++++++++++++++----- src/utils/rinex2assist/main.cc | 32 ++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index f99b52421..c87b1cd69 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -26,6 +26,8 @@ endif() set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) +find_package(Boost COMPONENTS iostreams serialization REQUIRED) + include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${GFlags_INCLUDE_DIRS} diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index bc3246374..147c3a17f 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -1,7 +1,7 @@ Rinex2assist ------------ -This program generates ephemeris XML files from RINEX navigation data files. The usage is as follows: +This program reads data from RINEX navigation files and generates XML files that can be read by GNSS-SDR as Assisted GNSS data. The usage is as follows: ``` $ rinex2assist /path/to/RINEX_nav_file @@ -9,16 +9,34 @@ $ rinex2assist /path/to/RINEX_nav_file The argument is mandatory (the name of the RINEX navigation file). The name `gps_ephemeris.xml` is given to the output if GPS NAV data is fould. If the RINEX file contains Galileo data, the corresponding `gal_ephemeris.xml` file will be generated. The program is also able to extract parameters of the UTC and the Ionospheric models from the RINEX header, if available. They will be called `gps_utc_model.xml`, `gps_iono.xml`, `gal_utc_model.xml` and `gal_iono.xml`. - -The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file. - There are some servers available for downloading RINEX navigation files. For instance: * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) Just make sure to pick up a [station near you](http://gpspp.sakura.ne.jp/gmap/igsnet.htm). -An example of GNSS-SDR configuration using ephemeris and UTC and ionospheric model parameters for GPS L1 and Galileo signals is shown below: +The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`). + +Examples: + +``` +$ rinex2assist EBRE00ESP_R_20183290400_01H_GN.rnx.gz +Generated file: gps_ephemeris.xml +Generated file: gps_utc_model.xml +Generated file: gps_iono.xml +``` + +and + +``` +$ rinex2assist EBRE00ESP_R_20183290000_01H_EN.rnx.gz +Generated file: gal_ephemeris.xml +Generated file: gal_utc_model.xml +Generated file: gal_iono.xml +``` + + +An example of GNSS-SDR configuration using ephemeris, UTC and ionospheric model parameters for GPS L1 and Galileo signals is shown below: ``` GNSS-SDR.AGNSS_XML_enabled=true diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 58cc48c0b..d09a1f933 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -42,6 +42,9 @@ #include #include #include +#include +#include +#include #include @@ -70,6 +73,33 @@ int main(int argc, char** argv) } std::string xml_filename; + // Uncompress if RINEX file is gzipped + std::string rinex_filename(argv[1]); + std::size_t found = rinex_filename.find_last_of("."); + if (found != std::string::npos) + { + if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0)) + { + std::cerr << "Hello" << std::endl; + std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); + boost::iostreams::filtering_streambuf in; + try + { + in.push(boost::iostreams::gzip_decompressor()); + } + catch (const boost::exception& e) + { + std::cerr << "Could not decompress file " << rinex_filename << std::endl; + return 1; + } + in.push(file); + std::string rinex_filename_unzipped = rinex_filename.substr(0, found); + std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary); + boost::iostreams::copy(in, output_file); + rinex_filename = rinex_filename_unzipped; + } + } + std::map eph_map; std::map eph_gal_map; @@ -83,7 +113,7 @@ int main(int argc, char** argv) try { // Read nav file - gpstk::Rinex3NavStream rnffs(argv[1]); // Open navigation data file + gpstk::Rinex3NavStream rnffs(rinex_filename.c_str()); // Open navigation data file gpstk::Rinex3NavData rne; gpstk::Rinex3NavHeader hdr; From d1f21d2cb090c3bef4c2d7523060261b21a3eedf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 13:00:37 +0100 Subject: [PATCH 16/52] Update link to map with IGS stations --- src/utils/rinex2assist/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index 147c3a17f..dbd69ba5b 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -13,7 +13,7 @@ There are some servers available for downloading RINEX navigation files. For ins * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) -Just make sure to pick up a [station near you](http://gpspp.sakura.ne.jp/gmap/igsnet.htm). +Just make sure to pick up a [station near you](http://www.igs.org/network). The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`). From 89bbc565a8659f17d18caff3f132440a14540705 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 14:20:19 +0100 Subject: [PATCH 17/52] Fix building if boost iostreams is not present --- src/utils/rinex2assist/CMakeLists.txt | 63 +++++++++++++++------------ 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index c87b1cd69..81c8fa4de 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -26,38 +26,43 @@ endif() set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) -find_package(Boost COMPONENTS iostreams serialization REQUIRED) +find_package(Boost COMPONENTS iostreams serialization QUIET) -include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GPSTK_INCLUDE_DIR}/gpstk - ${GPSTK_INCLUDE_DIR} -) +if(Boost_FOUND) + include_directories( + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GPSTK_INCLUDE_DIR}/gpstk + ${GPSTK_INCLUDE_DIR} + ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") -add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) + add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) -target_link_libraries(rinex2assist - ${Boost_LIBRARIES} - ${GPSTK_LIBRARY} - ${GFlags_LIBS} - gnss_sp_libs - gnss_rx -) + target_link_libraries(rinex2assist + ${Boost_LIBRARIES} + ${GPSTK_LIBRARY} + ${GFlags_LIBS} + gnss_sp_libs + gnss_rx + ) -if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) + if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) + endif() + + add_custom_command(TARGET rinex2assist POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ + ) + + install(TARGETS rinex2assist + RUNTIME DESTINATION bin + COMPONENT "rinex2assist" + ) +else() + message(STATUS "Boost iostrems library not found.") + message(STATUS "rinex2assist will not be built.") endif() - -add_custom_command(TARGET rinex2assist POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ -) - -install(TARGETS rinex2assist - RUNTIME DESTINATION bin - COMPONENT "rinex2assist" -) From 6d46561c38926748ba3febb33e75d3b0cb5b79d8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 19:21:20 +0100 Subject: [PATCH 18/52] Remove garbage --- src/utils/rinex2assist/main.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index d09a1f933..c37c50143 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -80,7 +80,6 @@ int main(int argc, char** argv) { if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0)) { - std::cerr << "Hello" << std::endl; std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); boost::iostreams::filtering_streambuf in; try From 88e91e6912428eaac88fbf924de8ec964197ab7f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 20:17:00 +0100 Subject: [PATCH 19/52] Fix typo --- src/utils/rinex2assist/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 81c8fa4de..7532e25d6 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -63,6 +63,6 @@ if(Boost_FOUND) COMPONENT "rinex2assist" ) else() - message(STATUS "Boost iostrems library not found.") + message(STATUS "Boost Iostreams library not found.") message(STATUS "rinex2assist will not be built.") endif() From 1f514f156c7eb925d3a2854a38d69a81bbdbe8e2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 20:52:52 +0100 Subject: [PATCH 20/52] Add ability to read compressed .Z RINEX navigation files --- src/utils/rinex2assist/main.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index c37c50143..ad6dc2eb5 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -81,6 +82,11 @@ int main(int argc, char** argv) if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0)) { std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); + if (file.fail()) + { + std::cerr << "Could not open file " << rinex_filename << std::endl; + return 1; + } boost::iostreams::filtering_streambuf in; try { @@ -97,6 +103,24 @@ int main(int argc, char** argv) boost::iostreams::copy(in, output_file); rinex_filename = rinex_filename_unzipped; } + if ((rinex_filename.substr(found + 1, found + 2).compare("Z") == 0)) + { + std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); + if (file.fail()) + { + std::cerr << "Could not open file" << rinex_filename << std::endl; + return 1; + } + file.close(); + // option k is not always available, so we save a copy of the original file + std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); + std::system(argum.c_str()); + std::string argum2 = std::string("/usr/bin/uncompress -f " + rinex_filename); + std::system(argum2.c_str()); + std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); + std::system(argum3.c_str()); + rinex_filename = rinex_filename.substr(0, found); + } } std::map eph_map; From c596ed472630ddf679a0879803894f250f0fc482 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 20:55:49 +0100 Subject: [PATCH 21/52] Document ability to read compressed .Z RINEX navigation files --- src/utils/rinex2assist/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index dbd69ba5b..e3f3594e2 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -15,7 +15,7 @@ There are some servers available for downloading RINEX navigation files. For ins Just make sure to pick up a [station near you](http://www.igs.org/network). -The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`). +The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz` or `.Z`). Examples: From c8c8146a5e49f957ed6ce4e1bed997ad887c269a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 11:50:12 +0100 Subject: [PATCH 22/52] Find uncompress program in more environments --- src/utils/rinex2assist/CMakeLists.txt | 12 +++++++++ src/utils/rinex2assist/main.cc | 37 +++++++++++++++++++-------- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 7532e25d6..344c0694b 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -28,6 +28,18 @@ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) find_package(Boost COMPONENTS iostreams serialization QUIET) +find_program(UNCOMPRESS_EXECUTABLE uncompress + PATHS /bin + /usr/bin + /usr/sbin +) + +if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) + add_definitions(-DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") +else() + add_definitions(-DUNCOMPRESS_EXECUTABLE="") +endif() + if(Boost_FOUND) include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index ad6dc2eb5..66ccb2e45 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -76,6 +76,7 @@ int main(int argc, char** argv) // Uncompress if RINEX file is gzipped std::string rinex_filename(argv[1]); + std::string input_filename = rinex_filename; std::size_t found = rinex_filename.find_last_of("."); if (found != std::string::npos) { @@ -99,9 +100,14 @@ int main(int argc, char** argv) } in.push(file); std::string rinex_filename_unzipped = rinex_filename.substr(0, found); - std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary); + std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + if (file.fail()) + { + std::cerr << "Could not create file " << rinex_filename_unzipped << std::endl; + return 1; + } boost::iostreams::copy(in, output_file); - rinex_filename = rinex_filename_unzipped; + input_filename = rinex_filename_unzipped; } if ((rinex_filename.substr(found + 1, found + 2).compare("Z") == 0)) { @@ -112,14 +118,23 @@ int main(int argc, char** argv) return 1; } file.close(); - // option k is not always available, so we save a copy of the original file - std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); - std::system(argum.c_str()); - std::string argum2 = std::string("/usr/bin/uncompress -f " + rinex_filename); - std::system(argum2.c_str()); - std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); - std::system(argum3.c_str()); - rinex_filename = rinex_filename.substr(0, found); + std::string uncompress_executable(UNCOMPRESS_EXECUTABLE); + if (!uncompress_executable.empty()) + { + // option k is not always available, so we save a copy of the original file + std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); + std::system(argum.c_str()); + std::string argum2 = std::string(uncompress_executable + " -f " + rinex_filename); + std::system(argum2.c_str()); + std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); + std::system(argum3.c_str()); + input_filename = rinex_filename.substr(0, found); + } + else + { + std::cerr << "uncompress program not found." << std::endl; + return 1; + } } } @@ -136,7 +151,7 @@ int main(int argc, char** argv) try { // Read nav file - gpstk::Rinex3NavStream rnffs(rinex_filename.c_str()); // Open navigation data file + gpstk::Rinex3NavStream rnffs(input_filename.c_str()); // Open navigation data file gpstk::Rinex3NavData rne; gpstk::Rinex3NavHeader hdr; From e71cbc9f244b4ef7f52314191235a7788cd53390 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 12:04:34 +0100 Subject: [PATCH 23/52] Fix warning --- src/utils/rinex2assist/main.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 66ccb2e45..2ec31e1dd 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -123,12 +123,17 @@ int main(int argc, char** argv) { // option k is not always available, so we save a copy of the original file std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); - std::system(argum.c_str()); + int s1 = std::system(argum.c_str()); std::string argum2 = std::string(uncompress_executable + " -f " + rinex_filename); - std::system(argum2.c_str()); + int s2 = std::system(argum2.c_str()); std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); - std::system(argum3.c_str()); + int s3 = std::system(argum3.c_str()); input_filename = rinex_filename.substr(0, found); + if ((s1 != 0) or (s2 != 0) or (s3 != 0)) + { + std::cerr << "Failure uncompressing file." << std::endl; + return 1; + } } else { From 6fc09273859943f82f960e4b9d1d79b66f738924 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 15:03:12 +0100 Subject: [PATCH 24/52] Fix reading of Galileo ephemeris --- src/utils/rinex2assist/main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 2ec31e1dd..31fcd3ebb 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -291,6 +291,7 @@ int main(int argc, char** argv) eph.af0_4 = rne.af0; eph.af1_4 = rne.af1; eph.af2_4 = rne.af2; + eph.WN_5 = rne.weeknum; eph_gal_map[j] = eph; j++; } From ed3396905fb007d94c38e2256ec7915755e9f6ae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 20:01:25 +0100 Subject: [PATCH 25/52] Improve documentation --- src/utils/rinex2assist/README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index e3f3594e2..6ed346cdb 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -1,7 +1,35 @@ Rinex2assist ------------ -This program reads data from RINEX navigation files and generates XML files that can be read by GNSS-SDR as Assisted GNSS data. The usage is as follows: +This program reads data from RINEX navigation files and generates XML files that can be read by GNSS-SDR as Assisted GNSS data. + +### Building + +This program is built along with GNSS-SDR if the options `ENABLE_UNIT_TESTING_EXTRA` or `ENABLE_SYSTEM_TESTING_EXTRA` are set to `ON` when calling CMake: + +``` +$ cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. +$ make +$ sudo make intall +``` + +The last step is optional. Without it, you will get the executable at `../install/rinex2assist`. + +The building requires two extra dependencies: the Boost Iostreams library and the program `uncompress`: + + * The Boost Iostreams library can be installed through a package: + - In Debian / Ubuntu: `sudo apt-get install libboost-iostreams-dev` + - In Fedora / CentOS: `sudo yum install boost-iostreams` + - In OpenSUSE: `sudo zypper install libboost_iostreams-devel` + - In Arch Linux: included in `boost-libs` package. + - In MacOS: included in Macports / Homebrew `boost` package. + * The program `uncompress` is available by default in most UNIX and GNU/Linux systems. + - In Fedora / CentOS: `sudo yum install ncompress` + - In OpenSUSE: `sudo zypper install ncompress` + +### Usage + +The usage is as follows: ``` $ rinex2assist /path/to/RINEX_nav_file @@ -9,7 +37,7 @@ $ rinex2assist /path/to/RINEX_nav_file The argument is mandatory (the name of the RINEX navigation file). The name `gps_ephemeris.xml` is given to the output if GPS NAV data is fould. If the RINEX file contains Galileo data, the corresponding `gal_ephemeris.xml` file will be generated. The program is also able to extract parameters of the UTC and the Ionospheric models from the RINEX header, if available. They will be called `gps_utc_model.xml`, `gps_iono.xml`, `gal_utc_model.xml` and `gal_iono.xml`. -There are some servers available for downloading RINEX navigation files. For instance: +There are some servers available for downloading recent RINEX navigation files. For instance: * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) From 880c6715c113b3e0c990abb82587de3e6045bc76 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 21:00:47 +0100 Subject: [PATCH 26/52] Reorder XML file and remove duplicated parameter --- src/core/system_parameters/galileo_ephemeris.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index d2555790c..fd844adf2 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -123,10 +123,7 @@ public: { }; - archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris); - archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris); - archive& BOOST_SERIALIZATION_NVP(IOD_nav_1); - archive& BOOST_SERIALIZATION_NVP(SV_ID_PRN_4); + archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN); archive& BOOST_SERIALIZATION_NVP(M0_1); archive& BOOST_SERIALIZATION_NVP(delta_n_3); @@ -155,6 +152,10 @@ public: archive& BOOST_SERIALIZATION_NVP(Galileo_satClkDrift); archive& BOOST_SERIALIZATION_NVP(Galileo_dtr); + archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris); + archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris); + archive& BOOST_SERIALIZATION_NVP(IOD_nav_1); + archive& BOOST_SERIALIZATION_NVP(SISA_3); archive& BOOST_SERIALIZATION_NVP(E5a_HS); archive& BOOST_SERIALIZATION_NVP(E5b_HS_5); @@ -165,8 +166,6 @@ public: archive& BOOST_SERIALIZATION_NVP(BGD_E1E5a_5); archive& BOOST_SERIALIZATION_NVP(BGD_E1E5b_5); - - archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN); } }; From f416a06304452258857fa15a09fed2b8c6397958 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 21:18:45 +0100 Subject: [PATCH 27/52] Update Galileo ephemeris schema --- docs/xml-schemas/gal_ephemeris_map.xsd | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd index 06c541af5..bf6c5ea20 100644 --- a/docs/xml-schemas/gal_ephemeris_map.xsd +++ b/docs/xml-schemas/gal_ephemeris_map.xsd @@ -1,4 +1,4 @@ - +< @@ -16,6 +16,7 @@ + @@ -34,6 +35,22 @@ + + + + + + + + + + + + + + + + From 2c6e3e621dfc48fb4437c341b4755d261ba6af99 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 22:13:33 +0100 Subject: [PATCH 28/52] Update changelog --- docs/changelog | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/changelog b/docs/changelog index dece16401..96dcc4b6a 100644 --- a/docs/changelog +++ b/docs/changelog @@ -16,6 +16,7 @@ Next release will have several improvements in different dimensions, addition of - Redesign of the time counter for enhanced continuity. - Improved flow graph in multisystem configurations: the receiver does not get stalled anymore if no signal is found from the first system. - Improved acquisition and tracking sensitivity. +- Added mechanisms for Assisted GNSS, thus shortening the Time-To-First-Fix. Provision of data via XML files or via SUPL v1.0. Documented at https://gnss-sdr.org/docs/sp-blocks/global-parameters/ - Other minor bug fixes. @@ -27,6 +28,7 @@ Next release will have several improvements in different dimensions, addition of - New volk_gnsssdr kernels: volk_gnsssdr_16i_xn_resampler_16i_xn.h, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h, volk_gnsssdr_32f_xn_resampler_32f_xn.h, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h - Some AVX2 implementations added to the volk_gnsssdr library. - Improvement in C++ usage: Use of const container calls when result is immediately converted to a const iterator. Using these members removes an implicit conversion from iterator to const_iterator. +- Output printers can be shut down, with some savings in memory and storage requirements. - A number of code optimizations here and there. @@ -34,7 +36,8 @@ Next release will have several improvements in different dimensions, addition of - A number of new parameters have been exposed to the configuration system. - Possibility to choose Pilot or Data component for tracking of GPS L5 and Galileo E5a signals. -- Enabled extended coherent integration times. +- Enabled extended coherent integration times for signal tracking. +- Configurable coherent and/or non-coherent signal acquisition. - Some configuration parameters can now be overridden by commandline flags for easier use in scripts. @@ -48,11 +51,14 @@ Next release will have several improvements in different dimensions, addition of - Added five more signal sources: "Fmcomms2_Signal_Source" (requires gr-iio), "Plutosdr_Signal Source" (requires gr-iio), "Spir_GSS6450_File_Signal_Source", "Labsat_Signal_Source" and "Custom_UDP_Signal_Source" (requires libpcap). Documented in https://gnss-sdr.org/docs/sp-blocks/signal-source/ - Improved support for BladeRF, HackRF and RTL-SDR front-ends. - Added tools for the interaction with front-ends based on the AD9361 chipset. -- Intermediate results are now saved in .mat binary format, readable from Matlab/Octave and from Python via h5py. +- Intermediate results are now saved in MAT-file format (.mat), readable from Matlab/Octave and from Python via h5py. - Added the GPX output format. -- Fixed a bug in the format of NMEA sentences when latitude or longitude minutes were >10. +- Improvements in the generation of KML files. +- Improvements in the NMEA output. The receiver can produce GPGGA, GPRMC, GPGSA, GPGSV, GAGSA and GAGSV sentences. - Improvements in the RTCM server stability. - Improvements in the correctness of generated RINEX files. +- The receiver can read and make use of Galileo almanac XML files published by the European GNSS Service Centre at https://www.gsc-europa.eu/system-status/almanac-data +- Added program rinex2assist to convert RINEX navigation files into XML files usable for AGNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist ### Improvements in Maintainability: @@ -64,6 +70,8 @@ Next release will have several improvements in different dimensions, addition of - Improvement in C++ usage: The override special identifier is now used when overriding a virtual function. This helps the compiler to check for type changes in the base class, making the detection of errors easier. - Improvement in C++ usage: A number of unused includes have been removed. Order of includes set to: local (in-source) headers, then library headers, then system headers. This helps to detect missing includes. - Improvement in C++ usage: Enhanced const correctness. Misuses of those variables are detected by the compiler. +- Applied some style rules to CMake scripts. +- Minimal versions of dependencies identified and detected. ### Improvements in Portability: @@ -76,15 +84,16 @@ Next release will have several improvements in different dimensions, addition of - The Ninja build system can be used in replacement of make. - The volk_gnsssdr library can be built using Python 2.7 or Python 3.6. - The volk_gnsssdr library is now ready for AArch64 NEON instructions. -- Ready for GNU Radio 3.8 C++ API (as per current next branch of GNU Radio upstream repository). +- Ready for GNU Radio 3.8 C++ API (as per current master branch of GNU Radio upstream repository). - Improved detection of required and optional dependencies in many GNU/Linux distributions and processor architectures. -- Improvement in C++ usage: The library has been replaced by the more modern and portable . +- Improvement in C++ usage: The library has been replaced by the more modern and portable (except for the interaction with RTKLIB). - Improvement in C++ usage: The library has been replaced by the more modern and portable for file handling. - Improvement in C++ usage: C++ libraries preferred over C libraries (e.g., instead of , instead of ). - Fixes required by Debian packaging. - Fixes required by Macports packaging. - A downside in portability: BLAS and LAPACK libraries are now required even in ARM devices. - A downside in portability: the matio library >= 1.5.3 is a new required dependency. If not found, it is downloaded and built automatically at building time, but this requires libtool, automake and hdf5 already installed in the system. +- A downside in portability: the PugiXML library is a new required dependency. If not found, it is downloaded and built automatically at building time. ### Improvements in Reliability: @@ -93,6 +102,7 @@ Next release will have several improvements in different dimensions, addition of - Improved flow graph stabiliy. - Introduction of high-integrity C++ practices into the source code and included in the coding style guide. See https://gnss-sdr.org/coding-style/ - Fixed a number of defects detected by Coverity Scan. +- Improvement of QA code and addition of a number of new tests. Documented at https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2/ - Improvement in C++ usage: rand() function replaced by library. - Improvement in C++ usage: strlen and strncpy have been replaced by safer C++ counterparts. - Improvement in C++ usage: Some destructors have been fixed, avoiding segmentation faults when exiting the program. @@ -122,9 +132,10 @@ Next release will have several improvements in different dimensions, addition of - All Observables block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. - All PVT block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. -- Misleading parameter name GNSS-SDR.internal_fs_hz has been replaced by GNSS-SDR.internal_fs_sps. The old parameter name is still read. If found, a warning is provided to the user. -- Updated and improved documentation of processing blocks at https://gnss-sdr.org/docs/sp-blocks/ +- Misleading parameter name GNSS-SDR.internal_fs_hz has been replaced by GNSS-SDR.internal_fs_sps. The old parameter name is still read. If found, a warning is provided to the user. The old name will be removed in future releases. +- Updated and improved online documentation of processing blocks at https://gnss-sdr.org/docs/sp-blocks/ - Improved documentation of required dependency packages in several GNU/Linux distributions. +- Dump and output files can now be stored anywhere. - Parameter names with the same role have been harmonized within different block implementations. - Added a changelog, a code of conduct, a contributing guide and a pull-request template in the source tree. - Added colors to the commandline user interface. From d518b19ef10c1588d06560f830a9b5511357d92e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 22:18:27 +0100 Subject: [PATCH 29/52] Update changelog --- docs/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 96dcc4b6a..2382a4779 100644 --- a/docs/changelog +++ b/docs/changelog @@ -58,7 +58,8 @@ Next release will have several improvements in different dimensions, addition of - Improvements in the RTCM server stability. - Improvements in the correctness of generated RINEX files. - The receiver can read and make use of Galileo almanac XML files published by the European GNSS Service Centre at https://www.gsc-europa.eu/system-status/almanac-data -- Added program rinex2assist to convert RINEX navigation files into XML files usable for AGNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist +- Own-defined XML schemas for navigation data published at https://github.com/gnss-sdr/gnss-sdr/tree/next/docs/xml-schemas +- Added program rinex2assist to convert RINEX navigation files into XML files usable for Assisted GNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist ### Improvements in Maintainability: From 6c4de4b14419dc9c62d73d019c93ea0078195e0b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 22:39:27 +0100 Subject: [PATCH 30/52] Add link to rinex2assist --- docs/xml-schemas/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index e85c643fe..007d520c0 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -12,14 +12,14 @@ GPS L1 C/A - [iono_model.xsd](./iono_model.xsd) - GPS NAV message ionospheric model parameters. - [utc_model.xsd](./utc_model.xsd) - GPS NAV message UTC model parameters. - [gps_almanac_map.xsd](./gps_almanac_map.xsd) - GPS NAV message almanac. - - + + GPS L2C and L5 -------------- - + - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) - GPS CNAV message ephemeris parameters. - - + + Galileo ------- @@ -31,4 +31,5 @@ Galileo ------- Please check https://gnss-sdr.org/docs/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. - + +You could find useful the utility program [rinex2assist](https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist) for the generation of compatible XML files from recent, publicly available RINEX navigation data files. From c74b9527cd67ee217cb7ccc73832776fa4ed261c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 23:08:05 +0100 Subject: [PATCH 31/52] Add UNAVCO FTP link for RINEX navigation data files --- src/utils/rinex2assist/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index 6ed346cdb..9d378d797 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -32,7 +32,7 @@ The building requires two extra dependencies: the Boost Iostreams library and th The usage is as follows: ``` -$ rinex2assist /path/to/RINEX_nav_file +$ rinex2assist /path/to/RINEX_nav_file ``` The argument is mandatory (the name of the RINEX navigation file). The name `gps_ephemeris.xml` is given to the output if GPS NAV data is fould. If the RINEX file contains Galileo data, the corresponding `gal_ephemeris.xml` file will be generated. The program is also able to extract parameters of the UTC and the Ionospheric models from the RINEX header, if available. They will be called `gps_utc_model.xml`, `gps_iono.xml`, `gal_utc_model.xml` and `gal_iono.xml`. @@ -40,8 +40,9 @@ The argument is mandatory (the name of the RINEX navigation file). The name `gps There are some servers available for downloading recent RINEX navigation files. For instance: * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) + * UNAVCO: [ftp://data-out.unavco.org/pub/hourly/rinex/](ftp://data-out.unavco.org/pub/hourly/rinex/) -Just make sure to pick up a [station near you](http://www.igs.org/network). +Just make sure to pick up a recent file from a [station near you](http://www.igs.org/network). The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz` or `.Z`). From 514b9dd35f52137834f5d8a2ee1c07d55d10bcc8 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Thu, 29 Nov 2018 17:09:30 +0100 Subject: [PATCH 32/52] Improving tracking pull-in algorithm --- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 76 +++++++------------ .../gnuradio_blocks/dll_pll_veml_tracking.h | 2 +- 2 files changed, 30 insertions(+), 48 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 09f1cf8bf..0801d6862 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1,8 +1,8 @@ /*! * \file dll_pll_veml_tracking.cc * \brief Implementation of a code DLL + carrier PLL tracking block. + * \author Javier Arribas, 2018. jarribas(at)cttc.es * \author Antonio Ramos, 2018 antonio.ramosdet(at)gmail.com - * Javier Arribas, 2018. jarribas(at)cttc.es * * Code DLL + carrier PLL according to the algorithms described in: * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, @@ -402,7 +402,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_carrier_phase_step_rad = 0.0; d_carrier_phase_rate_step_rad = 0.0; d_rem_code_phase_chips = 0.0; - d_code_phase_samples = 0.0; d_last_prompt = gr_complex(0.0, 0.0); d_state = 0; // initial state: standby clear_tracking_vars(); @@ -464,36 +463,6 @@ void dll_pll_veml_tracking::start_tracking() d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; - int64_t acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); - double acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / trk_parameters.fs_in; - DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples; - DLOG(INFO) << "Number of seconds between Acquisition and Tracking = " << acq_trk_diff_seconds; - // Doppler effect Fd = (C / (C + Vr)) * F - double radial_velocity = (d_signal_carrier_freq + d_acq_carrier_doppler_hz) / d_signal_carrier_freq; - // new chip and PRN sequence periods based on acq Doppler - d_code_freq_chips = radial_velocity * d_code_chip_rate; - d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in; - d_code_phase_rate_step_chips = 0.0; - double T_chip_mod_seconds = 1.0 / d_code_freq_chips; - double T_prn_mod_seconds = T_chip_mod_seconds * static_cast(d_code_length_chips); - double T_prn_mod_samples = T_prn_mod_seconds * trk_parameters.fs_in; - - //d_current_prn_length_samples = std::round(T_prn_mod_samples); - d_current_prn_length_samples = std::floor(T_prn_mod_samples); - - double T_prn_true_seconds = static_cast(d_code_length_chips) / d_code_chip_rate; - double T_prn_true_samples = T_prn_true_seconds * trk_parameters.fs_in; - double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; - double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; - double corrected_acq_phase_samples = std::fmod(d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * trk_parameters.fs_in, T_prn_true_samples); - if (corrected_acq_phase_samples < 0.0) - { - corrected_acq_phase_samples += T_prn_mod_samples; - } - double delay_correction_samples = d_acq_code_phase_samples - corrected_acq_phase_samples; - - d_acq_code_phase_samples = corrected_acq_phase_samples; - d_carrier_doppler_hz = d_acq_carrier_doppler_hz; d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in; d_carrier_phase_rate_step_rad = 0.0; @@ -590,7 +559,6 @@ void dll_pll_veml_tracking::start_tracking() d_local_code_shift_chips[2] = trk_parameters.early_late_space_chips * static_cast(d_code_samples_per_chip); } - d_code_phase_samples = d_acq_code_phase_samples; d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_hz); d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_hz); d_carrier_loop_filter.set_pdi(static_cast(d_code_period)); @@ -598,16 +566,13 @@ void dll_pll_veml_tracking::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of " << systemName << " " << signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking pull-in d_state = 1; d_cloop = true; d_Prompt_buffer_deque.clear(); d_last_prompt = gr_complex(0.0, 0.0); - LOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz - << ". Code Phase correction [samples] = " << delay_correction_samples - << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; } @@ -1391,17 +1356,34 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) case 1: // Pull-in { // Signal alignment (skip samples until the incoming signal is aligned with local replica) - uint64_t acq_to_trk_delay_samples = static_cast(d_sample_counter - d_acq_sample_stamp); - double acq_trk_shif_correction_samples = static_cast(d_current_prn_length_samples) - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); - int32_t samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); - if (samples_offset < 0) - { - samples_offset = 0; - } - d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * d_acq_code_phase_samples; + int64_t acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); + double acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / trk_parameters.fs_in; + double delta_trk_to_acq_prn_start_samples = static_cast(acq_trk_diff_samples) - d_acq_code_phase_samples; + + // Doppler effect Fd = (C / (C + Vr)) * F + double radial_velocity = (d_signal_carrier_freq + d_acq_carrier_doppler_hz) / d_signal_carrier_freq; + // new chip and PRN sequence periods based on acq Doppler + d_code_freq_chips = radial_velocity * d_code_chip_rate; + d_code_freq_chips = d_code_chip_rate; + d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in; + d_code_phase_rate_step_chips = 0.0; + double T_chip_mod_seconds = 1.0 / d_code_freq_chips; + double T_prn_mod_seconds = T_chip_mod_seconds * static_cast(d_code_length_chips); + double T_prn_mod_samples = T_prn_mod_seconds * trk_parameters.fs_in; + + d_acq_code_phase_samples = T_prn_mod_samples - std::fmod(delta_trk_to_acq_prn_start_samples, T_prn_mod_samples); + d_current_prn_length_samples = round(T_prn_mod_samples); + + int32_t samples_offset = round(d_acq_code_phase_samples); + d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * static_cast(samples_offset); d_state = 2; - d_sample_counter += static_cast(samples_offset); // count for the processed samples - consume_each(samples_offset); // shift input to perform alignment with local replica + d_sample_counter += samples_offset; // count for the processed samples + + DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)"; + DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz + << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; + + consume_each(samples_offset); // shift input to perform alignment with local replica return 0; } case 2: // Wide tracking and symbol synchronization diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index 37997bb84..59a980b31 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -1,6 +1,7 @@ /*! * \file dll_pll_veml_tracking.h * \brief Implementation of a code DLL + carrier PLL tracking block. + * \author Javier Arribas, 2018. jarribas(at)cttc.es * \author Antonio Ramos, 2018 antonio.ramosdet(at)gmail.com * * ------------------------------------------------------------------------- @@ -173,7 +174,6 @@ private: double d_carrier_doppler_hz; double d_acc_carrier_phase_rad; double d_rem_code_phase_chips; - double d_code_phase_samples; double T_chip_seconds; double T_prn_seconds; double T_prn_samples; From 130261461335874626b2da1db5895c5033251517 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Thu, 29 Nov 2018 17:53:01 +0100 Subject: [PATCH 33/52] Improving SPIR GSS6450 signal source --- .../spir_gss6450_file_signal_source.cc | 3 +- .../unpack_spir_gss6450_samples.cc | 112 ++++++++++++------ .../unpack_spir_gss6450_samples.h | 9 +- 3 files changed, 77 insertions(+), 47 deletions(-) diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index 8b124a3fd..874cbe2f8 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -153,7 +153,8 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* valve_vec_.push_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_)); if (dump_) { - sink_vec_.push_back(gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str())); + std::string tmp_str = dump_filename_ + "_ch" + std::to_string(i); + sink_vec_.push_back(gr::blocks::file_sink::make(sizeof(gr_complex), tmp_str.c_str())); } if (enable_throttle_control_) { diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index 84d7ad0fc..8722288d3 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -3,6 +3,7 @@ * * \brief Unpacks SPIR int samples * \author Antonio Ramos, antonio(at)cttc.es + * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) @@ -45,10 +46,6 @@ unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) { adc_bits = adc_nbit; samples_per_int = 16 / adc_bits; - i_data.resize(adc_bits, false); - q_data.resize(adc_bits, false); - adc_bits_two_pow = static_cast(std::exp2(adc_bits)); - two_compl_thres = adc_bits_two_pow / 2; } @@ -56,50 +53,87 @@ unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples() { } - -int unpack_spir_gss6450_samples::compute_two_complement(unsigned long data) +void unpack_spir_gss6450_samples::decode_4bits_word(uint32_t input_uint32, gr_complex* out, int adc_bits) { - int res = 0; - if (static_cast(data) < two_compl_thres) + int8_t tmp_char; + float Q; + float I; + switch (adc_bits) { - res = static_cast(data); - } - else - { - res = static_cast(data) - adc_bits_two_pow; - } - return res; -} + case 2: + //four bits per complex sample (2 I + 2 Q), 8 samples per int32[s0,s1,s2,s3,s4,s5,s6,s7] + for (int i = 0; i < 8; i++) + { + tmp_char = input_uint32 & 3; + if (tmp_char >= 2) + { + I = (tmp_char - 4); + } + else + { + I = tmp_char; + } + input_uint32 = input_uint32 >> 2; + tmp_char = input_uint32 & 3; + if (tmp_char >= 2) + { + Q = (tmp_char - 4); + } + else + { + Q = tmp_char; + } + input_uint32 = input_uint32 >> 2; + + out[7 - i] = gr_complex(I, Q); + } + break; + case 4: + //eight bits per complex sample (4 I + 4 Q), 4 samples per int32= [s0,s1,s2,s3] + for (int i = 0; i < 4; i++) + { + tmp_char = input_uint32 & 0x0F; + + if (tmp_char >= 8) + { + I = (tmp_char - 16); + } + else + { + I = tmp_char; + } + input_uint32 = input_uint32 >> 4; + tmp_char = input_uint32 & 0x0F; + if (tmp_char >= 8) + { + Q = (tmp_char - 16); + } + else + { + Q = tmp_char; + } + input_uint32 = input_uint32 >> 4; + + out[3 - i] = gr_complex(I, Q); + } + break; + } +} int unpack_spir_gss6450_samples::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items) { - const int* in = reinterpret_cast(input_items[0]); + const int32_t* in = reinterpret_cast(input_items[0]); gr_complex* out = reinterpret_cast(output_items[0]); - unsigned int n_sample = 0; - unsigned int in_counter = 0; - std::bitset<32> bs; - for (int i = 0; i < noutput_items; i++) + int n_sample = 0; + int in_counter = 0; + do { - bs = in[in_counter]; - int i_shift = adc_bits * 2 * (samples_per_int - n_sample - 1) + adc_bits; - int q_shift = adc_bits * 2 * (samples_per_int - n_sample - 1); - for (unsigned int k = 0; k < adc_bits; k++) - { - i_data[k] = bs[i_shift + k]; - q_data[k] = bs[q_shift + k]; - } - //out[i] = gr_complex(static_cast(compute_two_complement(i_data.to_ulong())) + 0.5, - // static_cast(compute_two_complement(q_data.to_ulong())) + 0.5); - out[i] = gr_complex(static_cast(compute_two_complement(q_data.to_ulong())) + 0.5, - static_cast(compute_two_complement(i_data.to_ulong())) + 0.5); - n_sample++; - if (n_sample == samples_per_int) - { - n_sample = 0; - in_counter++; - } + decode_4bits_word(in[in_counter++], &out[n_sample], adc_bits); + n_sample += samples_per_int; } + while (n_sample < noutput_items); + return noutput_items; } diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index a604982f1..a8f4b47f9 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -3,6 +3,7 @@ * * \brief Unpacks SPIR int samples * \author Antonio Ramos, antonio.ramos(at)cttc.es + * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) @@ -32,7 +33,6 @@ #define GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H #include -#include class unpack_spir_gss6450_samples; @@ -47,18 +47,13 @@ public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); + void decode_4bits_word(uint32_t input_int32, gr_complex *out, int adc_bits); unpack_spir_gss6450_samples(unsigned int adc_nbit); ~unpack_spir_gss6450_samples(); private: - int compute_two_complement(unsigned long data); - unsigned int adc_bits; unsigned int samples_per_int; - int two_compl_thres; - int adc_bits_two_pow; - boost::dynamic_bitset<> i_data; - boost::dynamic_bitset<> q_data; }; #endif From 6dd47336066d41da69352b18bedbb5af28c9df58 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Thu, 29 Nov 2018 21:29:21 +0100 Subject: [PATCH 34/52] Fix duplicated satellites observables test to not demand true observables file --- .../observables/hybrid_observables_test.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 9422e144a..4883b3c60 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -1763,8 +1763,11 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } else { - ASSERT_EQ(ReadRinexObs(&true_obs_vec, gnss_synchro_master), true) - << "Failure reading RINEX file"; + if (!FLAGS_duplicated_satellites_test) + { + ASSERT_EQ(ReadRinexObs(&true_obs_vec, gnss_synchro_master), true) + << "Failure reading RINEX file"; + } } //read measured values observables_dump_reader estimated_observables(tracking_ch_vec.size()); @@ -1825,10 +1828,13 @@ TEST_F(HybridObservablesTest, ValidationOfResults) measured_obs_vec.at(n).shed_rows(0, index(0)); } - index = arma::find(measured_obs_vec.at(n).col(0) >= true_obs_vec.at(n)(0, 0), 1, "first"); - if ((index.size() > 0) and (index(0) > 0)) + if (!FLAGS_duplicated_satellites_test) { - measured_obs_vec.at(n).shed_rows(0, index(0)); + index = arma::find(measured_obs_vec.at(n).col(0) >= true_obs_vec.at(n)(0, 0), 1, "first"); + if ((index.size() > 0) and (index(0) > 0)) + { + measured_obs_vec.at(n).shed_rows(0, index(0)); + } } } From 961f8cee1f84dd2e179d61b83fb03c1f9f224ea7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 1 Dec 2018 19:09:44 +0100 Subject: [PATCH 35/52] =?UTF-8?q?Offer=20a=20=5FROOT=C2=A0CMa?= =?UTF-8?q?ke=20and=C2=A0environment=20variable=20as=20a=20way=20to=20defi?= =?UTF-8?q?ne=20a=20base=20path=20to=20find=20packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/Modules/FindGFLAGS.cmake | 77 +++++++++++++++------------ cmake/Modules/FindGFORTRAN.cmake | 2 + cmake/Modules/FindGLOG.cmake | 4 ++ cmake/Modules/FindGNSSSIMULATOR.cmake | 13 +++-- cmake/Modules/FindGNURADIO.cmake | 32 ++++++----- cmake/Modules/FindGPERFTOOLS.cmake | 28 ++++++++-- cmake/Modules/FindGPSTK.cmake | 17 ++++-- cmake/Modules/FindGRDBFCTTC.cmake | 6 +++ cmake/Modules/FindGRGN3S.cmake | 6 +++ cmake/Modules/FindGRIIO.cmake | 16 +++--- cmake/Modules/FindGROSMOSDR.cmake | 19 +++++-- cmake/Modules/FindLIBIIO.cmake | 6 +++ cmake/Modules/FindLIBOSMOSDR.cmake | 16 ++++-- cmake/Modules/FindLOG4CPP.cmake | 6 +++ cmake/Modules/FindMATIO.cmake | 18 ++++++- cmake/Modules/FindOPENBLAS.cmake | 27 ++++++---- cmake/Modules/FindORC.cmake | 61 ++++++++++++--------- cmake/Modules/FindPCAP.cmake | 19 +++++-- cmake/Modules/FindPUGIXML.cmake | 44 ++++++++------- cmake/Modules/FindTELEORBIT.cmake | 16 +++--- cmake/Modules/FindUHD.cmake | 16 +++--- cmake/Modules/FindVOLK.cmake | 12 +++-- cmake/Modules/FindVOLKGNSSSDR.cmake | 16 +++--- 23 files changed, 319 insertions(+), 158 deletions(-) diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake index 76a832ca5..31739e216 100644 --- a/cmake/Modules/FindGFLAGS.cmake +++ b/cmake/Modules/FindGFLAGS.cmake @@ -17,8 +17,9 @@ # - Try to find GFlags # -# The following variables are optionally searched for defaults -# GFlags_ROOT_DIR: Base directory where all GFlags components are found +# The following CMake and environment variables are optionally searched +# for defaults: +# GFLAGS_ROOT: Base directory where all GFlags components are found # # The following are set after configuration is done: # GFlags_FOUND @@ -30,39 +31,45 @@ if(APPLE) find_path(GFlags_ROOT_DIR libgflags.dylib PATHS - /opt/local/lib - /usr/local/lib + /opt/local/lib + /usr/local/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib ) else() find_path(GFlags_ROOT_DIR libgflags.so HINTS - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/powerpc-linux-gnuspe - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/i386-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i386-kfreebsd-gnu - /usr/lib/m68k-linux-gnu - /usr/lib/sh4-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/alpha-linux-gnu - /usr/lib64 - /usr/lib + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ${GFLAGS_ROOT}/lib64 + $ENV{GFLAGS_ROOT}/lib64 ) endif() @@ -71,10 +78,12 @@ if(GFlags_ROOT_DIR) find_path(GFlags_INCLUDE_DIRS gflags/gflags.h HINTS - /opt/local/include - /usr/local/include - /usr/include - ${GFlags_ROOT_DIR}/src + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ${GFLAGS_ROOT}/include + $ENV{GFLAGS_ROOT}/include ) # Find the libraries diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index f3299fefb..f19ccd77a 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -142,6 +142,8 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/gcc/powerpc64le-linux-gnu/8 /usr/lib/gcc/s390x-linux-gnu/8 /usr/lib/gcc/alpha-linux-gnu/8 + ${GFORTRAN_ROOT}/lib + $ENV{GFORTRAN_ROOT}/lib ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 50231f585..2d8f154f3 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -68,6 +68,10 @@ macro(_FIND_GLOG_LIBRARIES _var) /usr/lib/alpha-linux-gnu /usr/lib64 /usr/lib + ${GLOG_ROOT}/lib + $ENV{GLOG_ROOT}/lib + ${GLOG_ROOT}/lib64 + $ENV{GLOG_ROOT}/lib64 PATH_SUFFIXES lib ) mark_as_advanced(${_var}) diff --git a/cmake/Modules/FindGNSSSIMULATOR.cmake b/cmake/Modules/FindGNSSSIMULATOR.cmake index 5d4294548..66aa9176a 100644 --- a/cmake/Modules/FindGNSSSIMULATOR.cmake +++ b/cmake/Modules/FindGNSSSIMULATOR.cmake @@ -17,11 +17,14 @@ find_program(SW_GENERATOR_BIN gnss_sim PATHS /usr/bin - /usr/local/bin - /opt/local/bin - ${CMAKE_INSTALL_PREFIX}/bin - PATH_SUFFIXES bin) + /usr/local/bin + /opt/local/bin + ${CMAKE_INSTALL_PREFIX}/bin + ${GNSSSIMULATOR_ROOT}/bin + $ENV{GNSSSIMULATOR_ROOT}/bin + PATH_SUFFIXES bin +) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) +find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) mark_as_advanced(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index c6811ba7f..7f5deb3ab 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -65,29 +65,29 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) # look for include files - find_path( - ${INCVAR_NAME} + find_path(${INCVAR_NAME} NAMES ${INCFILE} HINTS $ENV{GNURADIO_RUNTIME_DIR}/include - ${PC_INCDIR} - ${CMAKE_INSTALL_PREFIX}/include - ${GNURADIO_INSTALL_PREFIX}/include + ${PC_INCDIR} + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) # look for libs foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) - find_library( - ${LIBVAR_NAME}_${libname} + find_library(${LIBVAR_NAME}_${libname} NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib - ${PC_LIBDIR} - ${CMAKE_INSTALL_PREFIX}/lib/ - ${CMAKE_INSTALL_PREFIX}/lib64/ - ${GNURADIO_INSTALL_PREFIX}/lib/ - ${GNURADIO_INSTALL_PREFIX}/lib64 + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_INSTALL_PREFIX}/lib64 PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -115,6 +115,10 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_ROOT}/lib + $ENV{GNURADIO_ROOT}/lib + ${GNURADIO_ROOT}/lib64 + $ENV{GNURADIO_ROOT}/lib64 ) list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) endforeach() @@ -174,6 +178,8 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) if(GNURADIO_VERSION_GREATER_THAN_373) set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") @@ -187,6 +193,8 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) if(GNURADIO_VERSION_GREATER_THAN_38) set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake index 3278caf92..67dfff8af 100644 --- a/cmake/Modules/FindGPERFTOOLS.cmake +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -24,7 +24,7 @@ # Variables used by this module, they can change the default behaviour and need # to be set before calling find_package: # -# Gperftools_ROOT_DIR Set this variable to the root installation of +# GPERFTOOLS_ROOT Set this variable to the root installation of # Gperftools if the module has problems finding # the proper installation path. # @@ -36,19 +36,37 @@ find_library(GPERFTOOLS_TCMALLOC NAMES tcmalloc - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_library(GPERFTOOLS_PROFILER NAMES profiler - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER NAMES tcmalloc_and_profiler - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h - HINTS ${Gperftools_ROOT_DIR}/include) + HINTS ${Gperftools_ROOT_DIR}/include + ${GPERFTOOLS_ROOT}/include + $ENV{GPERFTOOLS_ROOT}/include +) set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index c3270a6eb..f5ecb667e 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -24,14 +24,23 @@ find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp HINTS /usr/include - /usr/local/include - /opt/local/include) + /usr/local/include + /opt/local/include + ${GPSTK_ROOT}/include + $ENV{GPSTK_ROOT}/include +) set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) + find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} HINTS /usr/lib - /usr/local/lib - /opt/local/lib) + /usr/local/lib + /opt/local/lib + ${GPSTK_ROOT}/lib + $ENV{GPSTK_ROOT}/lib + ${GPSTK_ROOT}/lib64 + $ENV{GPSTK_ROOT}/lib64 +) # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake index 4b99f3702..e0689aeaf 100644 --- a/cmake/Modules/FindGRDBFCTTC.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -30,6 +30,8 @@ find_path( PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/include /usr/local/include + ${GRDBFCTTC_ROOT}/include + $ENV{GRDBFCTTC_ROOT}/include ) find_library( @@ -43,6 +45,10 @@ find_library( /usr/lib64 /usr/local/lib /usr/local/lib64 + ${GRDBFCTTC_ROOT}/lib + $ENV{GRDBFCTTC_ROOT}/lib + ${GRDBFCTTC_ROOT}/lib64 + $ENV{GRDBFCTTC_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake index 119a75eed..93f7bda89 100644 --- a/cmake/Modules/FindGRGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -30,6 +30,8 @@ find_path( PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${GRGN3S_ROOT}/include + $ENV{GRGN3S_ROOT}/include ) find_library( @@ -43,6 +45,10 @@ find_library( /usr/local/lib64 /usr/lib /usr/lib64 + ${GRGN3S_ROOT}/lib + $ENV{GRGN3S_ROOT}/lib + ${GRGN3S_ROOT}/lib64 + $ENV{GRGN3S_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 5575e3122..6d341e7fd 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -18,21 +18,21 @@ include(FindPkgConfig) pkg_check_modules(PC_IIO gnuradio-iio) -find_path( - IIO_INCLUDE_DIRS +find_path(IIO_INCLUDE_DIRS NAMES gnuradio/iio/api.h HINTS $ENV{IIO_DIR}/include - ${PC_IIO_INCLUDEDIR} + ${PC_IIO_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${GRIIO_ROOT}/include + $ENV{GRIIO_ROOT}/include ) -find_library( - IIO_LIBRARIES +find_library(IIO_LIBRARIES NAMES gnuradio-iio HINTS $ENV{IIO_DIR}/lib - ${PC_IIO_LIBDIR} + ${PC_IIO_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 /usr/local/lib @@ -61,6 +61,10 @@ find_library( /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/sh4-linux-gnu + ${GRIIO_ROOT}/lib + $ENV{GRIIO_ROOT}/lib + ${GRIIO_ROOT}/lib64 + $ENV{GRIIO_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index e78541806..48379ed76 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -34,14 +34,20 @@ # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers +include(FindPkgConfig) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) + find_path(GROSMOSDR_INCLUDE_DIR - NAMES osmosdr/source.h + NAMES + osmosdr/source.h osmosdr/api.h PATHS - ${GROSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include + ${GROSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + /opt/local/include + ${GROSMOSDR_ROOT}/include + $ENV{GROSMOSDR_ROOT}/include ) find_library(GROSMOSDR_LIBRARIES @@ -50,6 +56,7 @@ find_library(GROSMOSDR_LIBRARIES ${GROSMOSDR_PKG_LIBRARY_DIRS} /usr/lib /usr/local/lib + /opt/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabihf @@ -74,6 +81,10 @@ find_library(GROSMOSDR_LIBRARIES /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 + ${GROSMOSDR_ROOT}/lib + $ENV{GROSMOSDR_ROOT}/lib + ${GROSMOSDR_ROOT}/lib64 + $ENV{GROSMOSDR_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake index f8b6d10b9..a76180ca2 100644 --- a/cmake/Modules/FindLIBIIO.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -27,6 +27,8 @@ find_path( /usr/local/include /usr/include /opt/local/include + ${LIBIIO_ROOT}/include + $ENV{LIBIIO_ROOT}/include ) find_library( @@ -63,6 +65,10 @@ find_library( /usr/lib/x86_64-linux-gnux32 /usr/lib/sh4-linux-gnu /Library/Frameworks/iio.framework/ + ${LIBIIO_ROOT}/lib + $ENV{LIBIIO_ROOT}/lib + ${LIBIIO_ROOT}/lib64 + $ENV{LIBIIO_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 72f459e72..1e3aaf5e0 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -28,12 +28,16 @@ # LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers +include(FindPkgConfig) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) + find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h PATHS - ${LIBOSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + ${LIBOSMOSDR_ROOT}/include + $ENV{LIBOSMOSDR_ROOT}/include ) find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr @@ -65,7 +69,11 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 - ) + ${LIBOSMOSDR_ROOT}/lib + $ENV{LIBOSMOSDR_ROOT}/lib + ${LIBOSMOSDR_ROOT}/lib64 + $ENV{LIBOSMOSDR_ROOT}/lib64 +) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake index b14ac009a..283c3ddf9 100644 --- a/cmake/Modules/FindLOG4CPP.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -32,6 +32,8 @@ find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh /opt/local/include /usr/local/include /usr/include + ${LOG4CPP_ROOT}/include + $ENV{LOG4CPP_ROOT}/include ) set(LOG4CPP_NAMES log4cpp) @@ -68,6 +70,10 @@ find_library(LOG4CPP_LIBRARY /usr/lib /usr/local/lib /opt/local/lib + ${LOG4CPP_ROOT}/lib + $ENV{LOG4CPP_ROOT}/lib + ${LOG4CPP_ROOT}/lib64 + $ENV{LOG4CPP_ROOT}/lib64 ) if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index e9d66c65b..08facf069 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -60,10 +60,24 @@ # # Look for the header file. -find_path(MATIO_INCLUDE_DIR NAMES matio.h DOC "The MATIO include directory") +find_path(MATIO_INCLUDE_DIR + NAMES matio.h + HINTS + ${MATIO_ROOT}/include + $ENV{MATIO_ROOT}/include + DOC "The MATIO include directory" +) # Look for the library. -find_library(MATIO_LIBRARY NAMES matio DOC "The MATIO library") +find_library(MATIO_LIBRARY + NAMES matio + HINTS + ${MATIO_ROOT}/lib + $ENV{MATIO_ROOT}/lib + ${MATIO_ROOT}/lib64 + $ENV{MATIO_ROOT}/lib64 + DOC "The MATIO library" +) if(MATIO_INCLUDE_DIR) # --------------------------------------------------- diff --git a/cmake/Modules/FindOPENBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake index 0704a9681..8ff70d65f 100644 --- a/cmake/Modules/FindOPENBLAS.cmake +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -20,17 +20,22 @@ # The following environment variable is optionally searched # OPENBLAS_HOME: Base directory where all OpenBlas components are found -set(OPEN_BLAS_SEARCH_PATHS /lib/ - /lib64/ - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/OpenBLAS/lib - /opt/local/lib - /usr/lib/openblas-base - $ENV{OPENBLAS_HOME}/lib - ) +set(OPEN_BLAS_SEARCH_PATHS + /lib + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib + ${OPENBLAS_ROOT}/lib + $ENV{OPENBLAS_ROOT}/lib + ${OPENBLAS_ROOT}/lib64 + $ENV{OPENBLAS_ROOT}/lib64 +) find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 7bd013e67..fea12b98f 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -20,41 +20,50 @@ pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") find_program(ORCC_EXECUTABLE orcc HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) + PATHS ${ORC_ROOT}/bin + ${CMAKE_INSTALL_PREFIX}/bin +) -find_path(ORC_INCLUDE_DIR NAMES orc/orc.h +find_path(ORC_INCLUDE_DIR + NAMES orc/orc.h HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) + PATHS ${ORC_ROOT}/include/orc-0.4 + ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 +) - -find_path(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + ${ORC_ROOT}/lib + $ENV{ORC_ROOT}/lib + PATHS + ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) find_library(ORC_LIB orc-0.4 HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -list(APPEND ORC_LIBRARY - ${ORC_LIB} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} ) +list(APPEND ORC_LIBRARY ${ORC_LIB}) set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) set(ORC_LIBRARIES ${ORC_LIBRARY}) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index d91524ff4..af746c852 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -48,10 +48,12 @@ if(EXISTS $ENV{PCAPDIR}) find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include NO_DEFAULT_PATH ) find_library(PCAP_LIBRARY @@ -59,18 +61,25 @@ if(EXISTS $ENV{PCAPDIR}) pcap PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib NO_DEFAULT_PATH ) else() find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h + HINTS + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include ) - find_library(PCAP_LIBRARY NAMES pcap + HINTS + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib ) endif() diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index da7de4188..236a4c95a 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -26,28 +26,36 @@ find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp PATHS ${PUGIXML_HOME}/include - /usr/include - /usr/local/include - /opt/local/include) + /usr/include + /usr/local/include + /opt/local/include + ${PUGIXML_ROOT}/include + $ENV{PUGIXML_ROOT}/include +) find_library(PUGIXML_LIBRARY NAMES pugixml PATHS ${PUGIXML_HOME}/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/aarch64-linux-gnu - /usr/lib/arm-linux-gnueabi - /usr/lib/arm-linux-gnueabihf - /usr/lib/i386-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/local/lib - /opt/local/lib - /usr/lib - /usr/lib64 - /usr/local/lib64) + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib + /usr/lib64 + /usr/local/lib64 + ${PUGIXML_ROOT}/lib + $ENV{PUGIXML_ROOT}/lib + ${PUGIXML_ROOT}/lib64 + $ENV{PUGIXML_ROOT}/lib64 +) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index 0f78ed339..eb2420687 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -18,27 +18,31 @@ include(FindPkgConfig) pkg_check_modules(PC_TELEORBIT teleorbit) -find_path( - TELEORBIT_INCLUDE_DIRS +find_path(TELEORBIT_INCLUDE_DIRS NAMES teleorbit/api.h HINTS $ENV{TELEORBIT_DIR}/include - ${PC_TELEORBIT_INCLUDEDIR} + ${PC_TELEORBIT_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${TELEORBIT_ROOT}/include + $ENV{TELEORBIT_ROOT}/include ) -find_library( - TELEORBIT_LIBRARIES +find_library(TELEORBIT_LIBRARIES NAMES gnuradio-teleorbit HINTS $ENV{TELEORBIT_DIR}/lib - ${PC_TELEORBIT_LIBDIR} + ${PC_TELEORBIT_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 + ${TELEORBIT_ROOT}/lib + $ENV{TELEORBIT_ROOT}/lib + ${TELEORBIT_ROOT}/lib64 + $ENV{TELEORBIT_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index fc12a9cdd..31d299937 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -22,21 +22,21 @@ include(FindPkgConfig) pkg_check_modules(PC_UHD uhd) -find_path( - UHD_INCLUDE_DIRS +find_path(UHD_INCLUDE_DIRS NAMES uhd/config.hpp HINTS $ENV{UHD_DIR}/include - ${PC_UHD_INCLUDEDIR} + ${PC_UHD_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${UHD_ROOT}/include + $ENV{UHD_ROOT}/include ) -find_library( - UHD_LIBRARIES +find_library(UHD_LIBRARIES NAMES uhd HINTS $ENV{UHD_DIR}/lib - ${PC_UHD_LIBDIR} + ${PC_UHD_LIBDIR} PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -64,6 +64,10 @@ find_library( /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${UHD_ROOT}/lib + $ENV{UHD_ROOT}/lib + ${UHD_ROOT}/lib64 + $ENV{UHD_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index d491c08b0..97191179c 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -22,18 +22,18 @@ include(FindPkgConfig) pkg_check_modules(PC_VOLK volk) -find_path( - VOLK_INCLUDE_DIRS +find_path(VOLK_INCLUDE_DIRS NAMES volk/volk.h HINTS $ENV{VOLK_DIR}/include ${PC_VOLK_INCLUDEDIR} PATHS /usr/local/include /usr/include ${CMAKE_INSTALL_PREFIX}/include + ${VOLK_ROOT}/include + $ENV{VOLK_ROOT}/include ) -find_library( - VOLK_LIBRARIES +find_library(VOLK_LIBRARIES NAMES volk HINTS $ENV{VOLK_DIR}/lib ${PC_VOLK_LIBDIR} @@ -65,6 +65,10 @@ find_library( /usr/lib/alpha-linux-gnu /usr/lib64 ${CMAKE_INSTALL_PREFIX}/lib + ${VOLK_ROOT}/lib + $ENV{VOLK_ROOT}/lib + ${VOLK_ROOT}/lib64 + $ENV{VOLK_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake index cd5cac918..5cdc4e61d 100644 --- a/cmake/Modules/FindVOLKGNSSSDR.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -22,26 +22,30 @@ include(FindPkgConfig) pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) -find_path( - VOLK_GNSSSDR_INCLUDE_DIRS +find_path(VOLK_GNSSSDR_INCLUDE_DIRS NAMES volk_gnsssdr/volk_gnsssdr.h HINTS $ENV{VOLK_GNSSSDR_DIR}/include - ${PC_VOLK_GNSSSDR_INCLUDEDIR} + ${PC_VOLK_GNSSSDR_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${VOLKGNSSSDR_ROOT}/include + $ENV{VOLKGNSSSDR_ROOT}/include ) -find_library( - VOLK_GNSSSDR_LIBRARIES +find_library(VOLK_GNSSSDR_LIBRARIES NAMES volk_gnsssdr HINTS $ENV{VOLK_GNSSSDR_DIR}/lib - ${PC_VOLK_GNSSSDR_LIBDIR} + ${PC_VOLK_GNSSSDR_LIBDIR} PATHS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 ${GNURADIO_INSTALL_PREFIX}/lib + ${VOLKGNSSSDR_ROOT}/lib + $ENV{VOLKGNSSSDR_ROOT}/lib + ${VOLKGNSSSDR_ROOT}/lib64 + $ENV{VOLKGNSSSDR_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) From ae5a52b6faf9b81feed5d61745465f3a1c2f01bd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 1 Dec 2018 20:11:17 +0100 Subject: [PATCH 36/52] Apply style rules to CMake scripts --- cmake/Toolchains/oe-sdk_cross.cmake | 22 +++++++++++----------- cmake/cmake_uninstall.cmake.in | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmake/Toolchains/oe-sdk_cross.cmake b/cmake/Toolchains/oe-sdk_cross.cmake index aac39094e..dd7aedf5f 100644 --- a/cmake/Toolchains/oe-sdk_cross.cmake +++ b/cmake/Toolchains/oe-sdk_cross.cmake @@ -18,20 +18,20 @@ ########################################################## # Toolchain file for Open Embedded ########################################################## -set( CMAKE_SYSTEM_NAME Linux ) +set(CMAKE_SYSTEM_NAME Linux) string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT}) string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) -set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) -set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) #same flags for C sources -set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) #same flags for C sources -set( CMAKE_LIBRARY_PATH $ENV{OECORE_TARGET_SYSROOT}/usr/lib ) +set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE) # same flags for C sources +set(CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) # same flags for C sources +set(CMAKE_LIBRARY_PATH $ENV{OECORE_TARGET_SYSROOT}/usr/lib) -set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} ) -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) -set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) -set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) +set(CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set ( ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4 ) -set ( ORC_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib ) +set(ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4) +set(ORC_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 9b3887185..a0004acc5 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -17,7 +17,7 @@ if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif() file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") @@ -28,11 +28,11 @@ foreach(file ${files}) COMMAND @CMAKE_COMMAND@ -E remove \"$ENV{DESTDIR}${file}\" OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval - ) + ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + endif() + else() message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) + endif() +endforeach() From 3bb47ff75528cf37ed16a30fcaf6b2764f4d8226 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 05:29:11 +0100 Subject: [PATCH 37/52] Improve const correctness, fix string comparisons --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 46 +++++++++-------- src/algorithms/PVT/adapters/rtklib_pvt.h | 2 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 16 +++--- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 10 ++-- src/algorithms/PVT/libs/rtklib_solver.cc | 2 +- src/algorithms/PVT/libs/rtklib_solver.h | 2 +- ...lileo_e1_pcps_8ms_ambiguous_acquisition.cc | 48 +++++++++-------- ...alileo_e1_pcps_8ms_ambiguous_acquisition.h | 5 +- .../galileo_e1_pcps_ambiguous_acquisition.cc | 43 +++++++++------- .../galileo_e1_pcps_ambiguous_acquisition.h | 5 +- ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 22 +++++--- ...lileo_e1_pcps_ambiguous_acquisition_fpga.h | 3 +- ...eo_e1_pcps_cccwsr_ambiguous_acquisition.cc | 47 +++++++++-------- ...leo_e1_pcps_cccwsr_ambiguous_acquisition.h | 5 +- ...e1_pcps_quicksync_ambiguous_acquisition.cc | 51 ++++++++++--------- ..._e1_pcps_quicksync_ambiguous_acquisition.h | 5 +- ...ileo_e1_pcps_tong_ambiguous_acquisition.cc | 47 +++++++++-------- ...lileo_e1_pcps_tong_ambiguous_acquisition.h | 5 +- ...ileo_e5a_noncoherent_iq_acquisition_caf.cc | 41 ++++++++------- ...lileo_e5a_noncoherent_iq_acquisition_caf.h | 5 +- .../adapters/galileo_e5a_pcps_acquisition.cc | 33 +++++++----- .../adapters/galileo_e5a_pcps_acquisition.h | 5 +- .../galileo_e5a_pcps_acquisition_fpga.cc | 23 +++++---- .../galileo_e5a_pcps_acquisition_fpga.h | 5 +- .../glonass_l1_ca_pcps_acquisition.cc | 42 ++++++++------- .../adapters/glonass_l1_ca_pcps_acquisition.h | 5 +- .../glonass_l2_ca_pcps_acquisition.cc | 42 ++++++++------- .../adapters/glonass_l2_ca_pcps_acquisition.h | 5 +- .../adapters/gps_l1_ca_pcps_acquisition.cc | 42 ++++++++------- .../adapters/gps_l1_ca_pcps_acquisition.h | 5 +- ...gps_l1_ca_pcps_acquisition_fine_doppler.cc | 22 +++++--- .../gps_l1_ca_pcps_acquisition_fine_doppler.h | 5 +- .../gps_l1_ca_pcps_acquisition_fpga.cc | 22 +++++--- .../gps_l1_ca_pcps_acquisition_fpga.h | 3 +- .../gps_l1_ca_pcps_assisted_acquisition.cc | 22 +++++--- .../gps_l1_ca_pcps_assisted_acquisition.h | 5 +- .../gps_l1_ca_pcps_opencl_acquisition.cc | 44 +++++++++------- .../gps_l1_ca_pcps_opencl_acquisition.h | 5 +- .../gps_l1_ca_pcps_quicksync_acquisition.cc | 49 +++++++++--------- .../gps_l1_ca_pcps_quicksync_acquisition.h | 5 +- .../gps_l1_ca_pcps_tong_acquisition.cc | 46 +++++++++-------- .../gps_l1_ca_pcps_tong_acquisition.h | 5 +- .../adapters/gps_l2_m_pcps_acquisition.cc | 44 +++++++++------- .../adapters/gps_l2_m_pcps_acquisition.h | 5 +- .../gps_l2_m_pcps_acquisition_fpga.cc | 22 +++++--- .../adapters/gps_l2_m_pcps_acquisition_fpga.h | 5 +- .../adapters/gps_l5i_pcps_acquisition.cc | 44 +++++++++------- .../adapters/gps_l5i_pcps_acquisition.h | 5 +- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 24 +++++---- .../adapters/gps_l5i_pcps_acquisition_fpga.h | 5 +- src/algorithms/channel/adapters/channel.cc | 26 +++++----- .../two_bit_packed_file_signal_source.cc | 2 +- .../two_bit_packed_file_signal_source.h | 2 +- src/core/interfaces/configuration_interface.h | 11 ++-- src/core/libs/INIReader.cc | 4 +- src/core/libs/INIReader.h | 3 +- src/core/libs/string_converter.cc | 50 +++++++++++++++--- src/core/libs/string_converter.h | 11 ++-- src/core/monitor/gnss_synchro_monitor.cc | 4 +- src/core/receiver/control_message_factory.cc | 6 +-- src/core/receiver/control_message_factory.h | 2 +- src/core/receiver/control_thread.cc | 6 +-- src/core/receiver/file_configuration.cc | 50 ++++++++++++++---- src/core/receiver/file_configuration.h | 11 ++-- src/core/receiver/gnss_block_factory.cc | 22 ++++---- src/core/receiver/gnss_flowgraph.cc | 2 +- src/core/receiver/gnss_flowgraph.h | 4 +- src/core/receiver/in_memory_configuration.cc | 38 +++++++++----- src/core/receiver/in_memory_configuration.h | 13 +++-- src/core/receiver/tcp_cmd_interface.cc | 8 +-- src/core/receiver/tcp_cmd_interface.h | 27 +++++----- 71 files changed, 772 insertions(+), 534 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 05ea52e5f..e6b2d09cb 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -49,30 +49,10 @@ namespace bc = boost::integer; using google::LogMessage; -bool RtklibPvt::get_latest_PVT(double* longitude_deg, - double* latitude_deg, - double* height_m, - double* ground_speed_kmh, - double* course_over_ground_deg, - time_t* UTC_time) -{ - return pvt_->get_latest_PVT(longitude_deg, - latitude_deg, - height_m, - ground_speed_kmh, - course_over_ground_deg, - UTC_time); -} - -void RtklibPvt::clear_ephemeris() -{ - pvt_->clear_ephemeris(); -} - RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, - unsigned int out_streams) : role_(role), + unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { @@ -537,6 +517,28 @@ RtklibPvt::~RtklibPvt() } +bool RtklibPvt::get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time) +{ + return pvt_->get_latest_PVT(longitude_deg, + latitude_deg, + height_m, + ground_speed_kmh, + course_over_ground_deg, + UTC_time); +} + + +void RtklibPvt::clear_ephemeris() +{ + pvt_->clear_ephemeris(); +} + + std::map RtklibPvt::get_gps_ephemeris() const { return pvt_->get_gps_ephemeris_map(); diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index ed2bf7da4..d222ce565 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -46,7 +46,7 @@ class RtklibPvt : public PvtInterface { public: RtklibPvt(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 7e6753b48..96ed65700 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -29,11 +29,11 @@ */ #include "rtklib_pvt_cc.h" +#include "display.h" #include "galileo_almanac.h" #include "galileo_almanac_helper.h" -#include "pvt_conf.h" -#include "display.h" #include "gnss_sdr_create_directory.h" +#include "pvt_conf.h" #include #include #include @@ -59,7 +59,7 @@ using google::LogMessage; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk) + const rtk_t& rtk) { return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, conf_, @@ -268,9 +268,9 @@ void rtklib_pvt_cc::clear_ephemeris() rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", - gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), - gr::io_signature::make(0, 0, 0)) + const rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", + gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), + gr::io_signature::make(0, 0, 0)) { d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; @@ -858,7 +858,7 @@ bool rtklib_pvt_cc::send_sys_v_ttff_msg(ttff_msgbuf ttff) } -bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string file_name) +bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) { if (gnss_observables_map.empty() == false) { @@ -885,7 +885,7 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string file_name) } -bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string file_name) +bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name) { // load from xml (boost serialize) std::ifstream ifs; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 2f6bd32f0..558bc74f0 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -59,7 +59,7 @@ typedef boost::shared_ptr rtklib_pvt_cc_sptr; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, const Pvt_Conf& conf_, - rtk_t& rtk); + const rtk_t& rtk); /*! * \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library @@ -69,7 +69,7 @@ class rtklib_pvt_cc : public gr::sync_block private: friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk); + const rtk_t& rtk); void msg_handler_telemetry(pmt::pmt_t msg); @@ -131,9 +131,9 @@ private: bool send_sys_v_ttff_msg(ttff_msgbuf ttff); std::chrono::time_point start, end; - bool save_gnss_synchro_map_xml(const std::string file_name); //debug helper function + bool save_gnss_synchro_map_xml(const std::string& file_name); //debug helper function - bool load_gnss_synchro_map_xml(const std::string file_name); //debug helper function + bool load_gnss_synchro_map_xml(const std::string& file_name); //debug helper function bool d_xml_storage; std::string xml_base_path; @@ -147,7 +147,7 @@ private: public: rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk); + const rtk_t& rtk); /*! * \brief Get latest set of ephemeris from PVT block diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 1481dea0e..fb62643c4 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -63,7 +63,7 @@ using google::LogMessage; -rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t &rtk) +rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk) { // init empty ephemeris for all the available GNSS channels d_nchannels = nchannels; diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 293c0e06d..8651432ca 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -87,7 +87,7 @@ private: public: sol_t pvt_sol; ssat_t pvt_ssat[MAXSAT]; - rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); + rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk); ~rtklib_solver(); bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 0c451be34..442f1f85c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,12 +39,14 @@ using google::LogMessage; -void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() -{ -} + GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +57,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -86,7 +87,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_, @@ -107,7 +108,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -125,10 +126,15 @@ GalileoE1Pcps8msAmbiguousAcquisition::~GalileoE1Pcps8msAmbiguousAcquisition() } +void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -137,7 +143,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -152,7 +158,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -163,7 +169,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -173,7 +179,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -184,7 +190,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -193,7 +199,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1Pcps8msAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -213,10 +219,10 @@ void GalileoE1Pcps8msAmbiguousAcquisition::init() void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -238,7 +244,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() void GalileoE1Pcps8msAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -267,7 +273,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -276,7 +282,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block) void GalileoE1Pcps8msAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index d64c0f28b..59cd5c649 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -48,7 +48,8 @@ class GalileoE1Pcps8msAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1Pcps8msAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1Pcps8msAmbiguousAcquisition(); @@ -144,7 +145,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 7efab9681..a9cf7d51a 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -35,20 +35,20 @@ #include "Galileo_E1.h" #include "gnss_sdr_flags.h" #include "acq_conf.h" -#include #include #include using google::LogMessage; -void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters; configuration_ = configuration; @@ -59,7 +59,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -128,7 +128,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -146,6 +146,11 @@ GalileoE1PcpsAmbiguousAcquisition::~GalileoE1PcpsAmbiguousAcquisition() } +void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -155,7 +160,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -214,7 +219,7 @@ void GalileoE1PcpsAmbiguousAcquisition::init() void GalileoE1PcpsAmbiguousAcquisition::set_local_code() { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -277,15 +282,15 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -302,15 +307,15 @@ void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -325,15 +330,15 @@ void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index 657f03064..4f4a3c657 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -51,7 +51,8 @@ class GalileoE1PcpsAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsAmbiguousAcquisition(); @@ -154,7 +155,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 041039147..90fd0f911 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -41,13 +41,14 @@ using google::LogMessage; -void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() -{ -} GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //printf("top acq constructor start\n"); pcpsconf_fpga_t acq_parameters; @@ -59,8 +60,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in; //if_ = configuration_->property(role + ".if", 0); //acq_parameters.freq = if_; @@ -296,7 +297,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( channel_ = 0; //threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; //printf("top acq constructor end\n"); } @@ -310,6 +311,11 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::~GalileoE1PcpsAmbiguousAcquisitionFpga() } +void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() +{ +} + + void GalileoE1PcpsAmbiguousAcquisitionFpga::set_channel(unsigned int channel) { //printf("top acq set channel start\n"); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h index ebb326337..8ea13f0e4 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h @@ -52,7 +52,8 @@ class GalileoE1PcpsAmbiguousAcquisitionFpga : public AcquisitionInterface { public: GalileoE1PcpsAmbiguousAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsAmbiguousAcquisitionFpga(); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 46a3b1974..809924e89 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,13 +39,14 @@ using google::LogMessage; -void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +56,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -88,7 +88,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition code_data_ = new gr_complex[vector_length_]; code_pilot_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_, @@ -109,7 +109,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -128,10 +128,15 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::~GalileoE1PcpsCccwsrAmbiguousAcquisitio } +void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -140,7 +145,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) { - // float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_+ std::to_string(channel_) + ".pfa", 0.0); // if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0); @@ -157,7 +162,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -168,7 +173,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppl { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -178,7 +183,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppl void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -188,7 +193,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -197,7 +202,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -217,10 +222,10 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::init() void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); char signal[3]; @@ -241,7 +246,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() void GalileoE1PcpsCccwsrAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -264,7 +269,7 @@ float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -273,7 +278,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_blo void GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index 47c19becb..9fde5d723 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -48,7 +48,8 @@ class GalileoE1PcpsCccwsrAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsCccwsrAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition(); @@ -145,7 +146,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_data_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index 36ed925df..574f86b21 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,13 +39,14 @@ using google::LogMessage; -void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,7 +57,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -119,7 +119,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui << ", Folding factor: " << folding_factor_ << ", Sampled ms: " << sampled_ms_ << ", Code Length: " << code_length_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, @@ -142,7 +142,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -160,10 +160,15 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::~GalileoE1PcpsQuickSyncAmbiguousAcqu } +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -172,7 +177,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channe void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -187,7 +192,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -198,7 +203,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int do { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -208,7 +213,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int do void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -218,7 +223,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -228,7 +233,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1PcpsQuickSyncAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -248,10 +253,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::init() void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -269,14 +274,14 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() acquisition_cc_->set_local_code(code_); delete[] code; - code = NULL; + code = nullptr; } } void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -284,7 +289,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_state(state); } @@ -314,7 +319,7 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -323,7 +328,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 1d7b25880..844856260 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -49,7 +49,8 @@ class GalileoE1PcpsQuickSyncAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsQuickSyncAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition(); @@ -150,7 +151,7 @@ private: unsigned int sampled_ms_; unsigned int max_dwells_; unsigned int folding_factor_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 4d7038364..06d606d50 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,13 +39,14 @@ using google::LogMessage; -void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,7 +57,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -90,7 +90,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, @@ -112,7 +112,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -130,10 +130,15 @@ GalileoE1PcpsTongAmbiguousAcquisition::~GalileoE1PcpsTongAmbiguousAcquisition() } +void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -142,7 +147,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -157,7 +162,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -168,7 +173,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -178,7 +183,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -189,7 +194,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -198,7 +203,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1PcpsTongAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -218,10 +223,10 @@ void GalileoE1PcpsTongAmbiguousAcquisition::init() void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -243,7 +248,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() void GalileoE1PcpsTongAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -278,7 +283,7 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -287,7 +292,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block void GalileoE1PcpsTongAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index 8524fc8d1..8e56c4044 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -48,7 +48,8 @@ class GalileoE1PcpsTongAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsTongAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsTongAmbiguousAcquisition(); @@ -149,7 +150,7 @@ private: unsigned int tong_init_val_; unsigned int tong_max_val_; unsigned int tong_max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index e24970d63..fd6f24e32 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -36,7 +36,6 @@ */ #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include #include #include #include "galileo_e5_signal_processing.h" @@ -46,13 +45,14 @@ using google::LogMessage; -void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() -{ -} GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -62,7 +62,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -101,7 +101,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( { both_signal_components = true; } - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_, @@ -117,7 +117,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,10 +136,15 @@ GalileoE5aNoncoherentIQAcquisitionCaf::~GalileoE5aNoncoherentIQAcquisitionCaf() } +void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() +{ +} + + void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -148,7 +153,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -163,7 +168,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -174,7 +179,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_max(unsigned int doppler { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -184,7 +189,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_max(unsigned int doppler void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -195,7 +200,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -204,7 +209,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -224,7 +229,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::init() void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* codeI = new std::complex[code_length_]; std::complex* codeQ = new std::complex[code_length_]; @@ -281,7 +286,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() void GalileoE5aNoncoherentIQAcquisitionCaf::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 6beed3472..4175a0741 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -49,7 +49,8 @@ class GalileoE5aNoncoherentIQAcquisitionCaf : public AcquisitionInterface { public: GalileoE5aNoncoherentIQAcquisitionCaf(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE5aNoncoherentIQAcquisitionCaf(); @@ -150,7 +151,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; int Zero_padding; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 2bd081e3e..3177705ae 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -34,7 +34,6 @@ #include "Galileo_E5a.h" #include "gnss_sdr_flags.h" #include "acq_conf.h" -#include #include #include #include @@ -42,12 +41,13 @@ using google::LogMessage; -void GalileoE5aPcpsAcquisition::stop_acquisition() -{ -} GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -58,7 +58,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -91,11 +91,11 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -118,7 +118,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,6 +136,11 @@ GalileoE5aPcpsAcquisition::~GalileoE5aPcpsAcquisition() } +void GalileoE5aPcpsAcquisition::stop_acquisition() +{ +} + + void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -145,7 +150,7 @@ void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) void GalileoE5aPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -264,11 +269,11 @@ void GalileoE5aPcpsAcquisition::set_state(int state) void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute__((unused))) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } @@ -281,11 +286,11 @@ void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute void GalileoE5aPcpsAcquisition::disconnect(gr::top_block_sptr top_block __attribute__((unused))) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 49099cd42..063c79ff2 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -43,7 +43,8 @@ class GalileoE5aPcpsAcquisition : public AcquisitionInterface { public: GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE5aPcpsAcquisition(); @@ -157,7 +158,7 @@ private: unsigned int in_streams_; unsigned int out_streams_; - long fs_in_; + int64_t fs_in_; float threshold_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 30f2195b9..ef99a0fe7 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -33,7 +33,6 @@ #include "galileo_e5_signal_processing.h" #include "Galileo_E5a.h" #include "gnss_sdr_flags.h" -#include #include #include #include @@ -41,12 +40,13 @@ using google::LogMessage; -void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() -{ -} GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //printf("creating the E5A acquisition"); pcpsconf_fpga_t acq_parameters; @@ -58,8 +58,8 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf //item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in; //acq_parameters.freq = 0; @@ -209,7 +209,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf channel_ = 0; //threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; //printf("creating the E5A acquisition end"); } @@ -221,6 +221,11 @@ GalileoE5aPcpsAcquisitionFpga::~GalileoE5aPcpsAcquisitionFpga() } +void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; @@ -231,7 +236,7 @@ void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold) { - // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); // // if (pfa == 0.0) // { diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h index 94b768438..91788c733 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -45,7 +45,8 @@ class GalileoE5aPcpsAcquisitionFpga : public AcquisitionInterface { public: GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE5aPcpsAcquisitionFpga(); @@ -160,7 +161,7 @@ private: unsigned int in_streams_; unsigned int out_streams_; - long fs_in_; + int64_t fs_in_; float threshold_; diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 5b3d1c531..a2448a81e 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GlonassL1CaPcpsAcquisition::stop_acquisition() -{ -} GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -60,7 +61,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GLONASS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -94,7 +95,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -114,7 +115,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -123,7 +124,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -141,6 +142,11 @@ GlonassL1CaPcpsAcquisition::~GlonassL1CaPcpsAcquisition() } +void GlonassL1CaPcpsAcquisition::stop_acquisition() +{ +} + + void GlonassL1CaPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -261,15 +267,15 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa) void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -284,15 +290,15 @@ void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -309,15 +315,15 @@ void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 1b519f91e..3c0c14ab1 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -51,7 +51,8 @@ class GlonassL1CaPcpsAcquisition : public AcquisitionInterface { public: GlonassL1CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GlonassL1CaPcpsAcquisition(); @@ -153,7 +154,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index 06ef7aae6..208989dee 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -42,13 +42,14 @@ using google::LogMessage; -void GlonassL2CaPcpsAcquisition::stop_acquisition() -{ -} GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -59,7 +60,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GLONASS_L2_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -93,7 +94,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -113,7 +114,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -122,7 +123,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -140,6 +141,11 @@ GlonassL2CaPcpsAcquisition::~GlonassL2CaPcpsAcquisition() } +void GlonassL2CaPcpsAcquisition::stop_acquisition() +{ +} + + void GlonassL2CaPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -260,15 +266,15 @@ float GlonassL2CaPcpsAcquisition::calculate_threshold(float pfa) void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -285,15 +291,15 @@ void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -308,15 +314,15 @@ void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index b679f4c26..3c093c5cd 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -50,7 +50,8 @@ class GlonassL2CaPcpsAcquisition : public AcquisitionInterface { public: GlonassL2CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GlonassL2CaPcpsAcquisition(); @@ -152,7 +153,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 30d7aa42d..7787b34cb 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -45,13 +45,14 @@ using google::LogMessage; -void GpsL1CaPcpsAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -61,7 +62,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -95,7 +96,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -109,7 +110,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -118,7 +119,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,6 +137,11 @@ GpsL1CaPcpsAcquisition::~GpsL1CaPcpsAcquisition() } +void GpsL1CaPcpsAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -249,15 +255,15 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -274,15 +280,15 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -297,15 +303,15 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 011bb96bf..5aee6bc7a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -55,7 +55,8 @@ class GpsL1CaPcpsAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisition(); @@ -157,7 +158,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index dd69ed24f..eacd4b6a6 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -42,13 +42,14 @@ using google::LogMessage; -void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() -{ -} GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -57,7 +58,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( Acq_Conf acq_parameters = Acq_Conf(); item_type_ = configuration->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -80,7 +81,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( acq_parameters.samples_per_ms = vector_length_; code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters); @@ -94,7 +95,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -112,6 +113,11 @@ GpsL1CaPcpsAcquisitionFineDoppler::~GpsL1CaPcpsAcquisitionFineDoppler() } +void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() +{ +} + + void GpsL1CaPcpsAcquisitionFineDoppler::set_channel(unsigned int channel) { channel_ = channel; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index 338ea683a..4a4bb9a19 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -49,7 +49,8 @@ class GpsL1CaPcpsAcquisitionFineDoppler : public AcquisitionInterface { public: GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisitionFineDoppler(); @@ -142,7 +143,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index f9778bfb8..f46b7c305 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -48,13 +48,14 @@ using google::LogMessage; -void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() -{ -} GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { pcpsconf_fpga_t acq_parameters; configuration_ = configuration; @@ -62,8 +63,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( DLOG(INFO) << "role " << role; - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); //fs_in = fs_in/2.0; // downampling filter //printf("####### DEBUG Acq: fs_in = %d\n", fs_in); acq_parameters.fs_in = fs_in; @@ -173,7 +174,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; } @@ -183,6 +184,11 @@ GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga() } +void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 8f6d1f3ff..4d0d7339f 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -53,7 +53,8 @@ class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisitionFpga(); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index da1377ac2..993c77e36 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -42,13 +42,14 @@ using google::LogMessage; -void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./data/acquisition.dat"; @@ -56,7 +57,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -71,7 +72,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_, @@ -87,7 +88,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -105,6 +106,11 @@ GpsL1CaPcpsAssistedAcquisition::~GpsL1CaPcpsAssistedAcquisition() } +void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsAssistedAcquisition::set_channel(unsigned int channel) { channel_ = channel; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index ca650bc77..1f6094b6d 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -49,7 +49,8 @@ class GpsL1CaPcpsAssistedAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsAssistedAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAssistedAcquisition(); @@ -140,7 +141,7 @@ private: int doppler_min_; unsigned int sampled_ms_; int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 1037a1778..494f8d543 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -40,13 +40,14 @@ using google::LogMessage; -void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,7 +58,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -85,7 +86,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, @@ -106,7 +107,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -124,10 +125,15 @@ GpsL1CaPcpsOpenClAcquisition::~GpsL1CaPcpsOpenClAcquisition() } +void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -136,7 +142,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -153,7 +159,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -163,7 +169,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -173,7 +179,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -183,7 +189,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step) void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -192,7 +198,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) signed int GpsL1CaPcpsOpenClAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -212,7 +218,7 @@ void GpsL1CaPcpsOpenClAcquisition::init() void GpsL1CaPcpsOpenClAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* code = new std::complex[code_length_]; @@ -233,7 +239,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code() void GpsL1CaPcpsOpenClAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -265,7 +271,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -274,7 +280,7 @@ void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsOpenClAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 0c6c21f49..60c78b2e0 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -48,7 +48,8 @@ class GpsL1CaPcpsOpenClAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsOpenClAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsOpenClAcquisition(); @@ -144,7 +145,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index 888d44586..2abe0c8ea 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -41,13 +41,14 @@ using google::LogMessage; -void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +57,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -112,7 +113,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( << ", Sampled ms: " << sampled_ms_ << ", Code Length: " << code_length_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, @@ -135,7 +136,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -153,10 +154,15 @@ GpsL1CaPcpsQuickSyncAcquisition::~GpsL1CaPcpsQuickSyncAcquisition() } +void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -165,9 +171,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + - boost::lexical_cast(channel_) + ".pfa", - 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -184,7 +188,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -194,7 +198,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -204,7 +208,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -214,7 +218,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -223,7 +227,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchr signed int GpsL1CaPcpsQuickSyncAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -243,13 +247,12 @@ void GpsL1CaPcpsQuickSyncAcquisition::init() void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* code = new std::complex[code_length_](); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - for (unsigned int i = 0; i < (sampled_ms_ / folding_factor_); i++) { memcpy(&(code_[i * code_length_]), code, @@ -266,7 +269,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() void GpsL1CaPcpsQuickSyncAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -275,7 +278,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::reset() void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_state(state); } @@ -304,7 +307,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -313,7 +316,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsQuickSyncAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index c35f97370..e18fb1704 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -50,7 +50,8 @@ class GpsL1CaPcpsQuickSyncAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsQuickSyncAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsQuickSyncAcquisition(); @@ -151,7 +152,7 @@ private: unsigned int sampled_ms_; unsigned int max_dwells_; unsigned int folding_factor_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 5c55d802a..5dc2f425b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -40,13 +40,14 @@ using google::LogMessage; -void GpsL1CaPcpsTongAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +57,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -76,7 +77,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_, @@ -97,7 +98,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -115,10 +116,15 @@ GpsL1CaPcpsTongAcquisition::~GpsL1CaPcpsTongAcquisition() } +void GpsL1CaPcpsTongAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -127,7 +133,7 @@ void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -144,7 +150,7 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -154,7 +160,7 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) void GpsL1CaPcpsTongAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -164,7 +170,7 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -174,7 +180,7 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step) void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -183,7 +189,7 @@ void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) signed int GpsL1CaPcpsTongAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -202,7 +208,7 @@ void GpsL1CaPcpsTongAcquisition::init() void GpsL1CaPcpsTongAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* code = new std::complex[code_length_]; @@ -223,7 +229,7 @@ void GpsL1CaPcpsTongAcquisition::set_local_code() void GpsL1CaPcpsTongAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -232,7 +238,7 @@ void GpsL1CaPcpsTongAcquisition::reset() void GpsL1CaPcpsTongAcquisition::set_state(int state) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_state(state); } @@ -263,7 +269,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -272,7 +278,7 @@ void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsTongAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index 562d63e39..76cf2b8e0 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -49,7 +49,8 @@ class GpsL1CaPcpsTongAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsTongAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsTongAcquisition(); @@ -150,7 +151,7 @@ private: unsigned int tong_init_val_; unsigned int tong_max_val_; unsigned int tong_max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 32b426777..1e4560388 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL2MPcpsAcquisition::stop_acquisition() -{ -} GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -61,7 +62,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); //float pfa = configuration_->property(role + ".pfa", 0.0); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -97,7 +98,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -116,7 +117,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -125,7 +126,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; num_codes_ = acq_parameters.sampled_ms / acq_parameters.ms_per_code; if (in_streams_ > 1) { @@ -144,6 +145,11 @@ GpsL2MPcpsAcquisition::~GpsL2MPcpsAcquisition() } +void GpsL2MPcpsAcquisition::stop_acquisition() +{ +} + + void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -153,7 +159,7 @@ void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) void GpsL2MPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -263,15 +269,15 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -288,15 +294,15 @@ void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -311,15 +317,15 @@ void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 27c463cf3..4a0c96c60 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -53,7 +53,8 @@ class GpsL2MPcpsAcquisition : public AcquisitionInterface { public: GpsL2MPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL2MPcpsAcquisition(); @@ -154,7 +155,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index db53d3815..1b1315d2a 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL2MPcpsAcquisitionFpga::stop_acquisition() -{ -} GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //pcpsconf_t acq_parameters; pcpsconf_fpga_t acq_parameters; @@ -62,7 +63,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( item_type_ = configuration_->property(role + ".item_type", default_item_type); //float pfa = configuration_->property(role + ".pfa", 0.0); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; //if_ = configuration_->property(role + ".if", 0); @@ -153,7 +154,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; // vector_length_ = code_length_; @@ -206,6 +207,11 @@ GpsL2MPcpsAcquisitionFpga::~GpsL2MPcpsAcquisitionFpga() } +void GpsL2MPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; @@ -215,7 +221,7 @@ void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold) { - // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); // // if (pfa == 0.0) // { diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h index b9aba8787..7effb0cf6 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h @@ -54,7 +54,8 @@ class GpsL2MPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL2MPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL2MPcpsAcquisitionFpga(); @@ -157,7 +158,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; //long if_; bool dump_; bool blocking_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 36d6e4f7a..6e1de1582 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL5iPcpsAcquisition::stop_acquisition() -{ -} GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -60,7 +61,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -89,7 +90,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -108,7 +109,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -116,7 +117,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -134,6 +135,11 @@ GpsL5iPcpsAcquisition::~GpsL5iPcpsAcquisition() } +void GpsL5iPcpsAcquisition::stop_acquisition() +{ +} + + void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -143,7 +149,7 @@ void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) void GpsL5iPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -251,15 +257,15 @@ float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -276,15 +282,15 @@ void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -299,15 +305,15 @@ void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 3c4d2ad46..c9f1cd95d 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -53,7 +53,8 @@ class GpsL5iPcpsAcquisition : public AcquisitionInterface { public: GpsL5iPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL5iPcpsAcquisition(); @@ -154,7 +155,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index 124999dc9..8e6930ebc 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL5iPcpsAcquisitionFpga::stop_acquisition() -{ -} GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //printf("L5 ACQ CLASS CREATED\n"); pcpsconf_fpga_t acq_parameters; @@ -61,8 +62,8 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( //item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in; //if_ = configuration_->property(role + ".if", 0); //acq_parameters.freq = if_; @@ -207,7 +208,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( channel_ = 0; // threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; //printf("L5 ACQ CLASS FINISHED\n"); } @@ -219,6 +220,11 @@ GpsL5iPcpsAcquisitionFpga::~GpsL5iPcpsAcquisitionFpga() } +void GpsL5iPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; @@ -228,7 +234,7 @@ void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold) { - // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); // // if (pfa == 0.0) // { diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h index af916d3d5..571f01193 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -54,7 +54,8 @@ class GpsL5iPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL5iPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL5iPcpsAcquisitionFpga(); @@ -157,7 +158,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; //long if_; bool dump_; bool blocking_; diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 8e4a3120d..a3d6c9bf3 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -32,7 +32,6 @@ #include "channel.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include #include #include @@ -44,14 +43,14 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr trk, std::shared_ptr nav, std::string role, std::string implementation, gr::msg_queue::sptr queue) { - pass_through_ = pass_through; - acq_ = acq; - trk_ = trk; - nav_ = nav; - role_ = role; - implementation_ = implementation; + pass_through_ = std::move(pass_through); + acq_ = std::move(acq); + trk_ = std::move(trk); + nav_ = std::move(nav); + role_ = std::move(role); + implementation_ = std::move(implementation); channel_ = channel; - queue_ = queue; + queue_ = std::move(queue); channel_fsm_ = std::make_shared(); flag_enable_fpga = configuration->property("Channel.enable_FPGA", false); @@ -59,6 +58,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, trk_->set_channel(channel_); nav_->set_channel(channel_); + gnss_synchro_ = Gnss_Synchro(); gnss_synchro_.Channel_ID = channel_; acq_->set_gnss_synchro(&gnss_synchro_); trk_->set_gnss_synchro(&gnss_synchro_); @@ -76,21 +76,21 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, // IMPORTANT: Do not change the order between set_doppler_step and set_threshold - uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step", 0); + uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0); if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); if (FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; acq_->set_doppler_step(doppler_step); - float threshold = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".threshold", 0.0); + float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0); if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); acq_->set_threshold(threshold); acq_->init(); - repeat_ = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".repeat_satellite", false); + repeat_ = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".repeat_satellite", false); DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_; channel_fsm_->set_acquisition(acq_); @@ -107,7 +107,9 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, // Destructor -Channel::~Channel() {} +Channel::~Channel() = default; + + void Channel::connect(gr::top_block_sptr top_block) { if (connected_) diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index cdde62a3b..c20ca2962 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -55,7 +55,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac std::string default_sample_type = "real"; double default_seconds_to_skip = 0.0; - samples_ = configuration->property(role + ".samples", 0L); + samples_ = configuration->property(role + ".samples", 0ULL); sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); filename_ = configuration->property(role + ".filename", default_filename); diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 2a1db00bc..71ed81dbd 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -129,7 +129,7 @@ public: } private: - unsigned long long samples_; + uint64_t samples_; long sampling_frequency_; std::string filename_; std::string item_type_; diff --git a/src/core/interfaces/configuration_interface.h b/src/core/interfaces/configuration_interface.h index 48e6eefa1..9e1947b79 100644 --- a/src/core/interfaces/configuration_interface.h +++ b/src/core/interfaces/configuration_interface.h @@ -35,6 +35,7 @@ #ifndef GNSS_SDR_CONFIGURATION_INTERFACE_H_ #define GNSS_SDR_CONFIGURATION_INTERFACE_H_ +#include #include /*! @@ -54,10 +55,12 @@ public: virtual ~ConfigurationInterface() {} virtual std::string property(std::string property_name, std::string default_value) = 0; virtual bool property(std::string property_name, bool default_value) = 0; - virtual long property(std::string property_name, long default_value) = 0; - virtual int property(std::string property_name, int default_value) = 0; - virtual unsigned int property(std::string property_name, unsigned int default_value) = 0; - virtual unsigned short property(std::string property_name, unsigned short default_value) = 0; + virtual int64_t property(std::string property_name, int64_t default_value) = 0; + virtual uint64_t property(std::string property_name, uint64_t default_value) = 0; + virtual int32_t property(std::string property_name, int32_t default_value) = 0; + virtual uint32_t property(std::string property_name, uint32_t default_value) = 0; + virtual int16_t property(std::string property_name, int16_t default_value) = 0; + virtual uint16_t property(std::string property_name, uint16_t default_value) = 0; virtual float property(std::string property_name, float default_value) = 0; virtual double property(std::string property_name, double default_value) = 0; virtual void set_property(std::string property_name, std::string value) = 0; diff --git a/src/core/libs/INIReader.cc b/src/core/libs/INIReader.cc index 1a8a63815..1caaae967 100644 --- a/src/core/libs/INIReader.cc +++ b/src/core/libs/INIReader.cc @@ -70,13 +70,13 @@ std::string INIReader::Get(std::string section, std::string name, std::string de } -long INIReader::GetInteger(std::string section, std::string name, long default_value) +int64_t INIReader::GetInteger(std::string section, std::string name, int64_t default_value) { std::string valstr = Get(section, name, ""); const char* value = valstr.c_str(); char* end; // This parses "1234" (decimal) and also "0x4D2" (hex) - long n = strtol(value, &end, 0); + int64_t n = strtol(value, &end, 0); return end > value ? n : default_value; } diff --git a/src/core/libs/INIReader.h b/src/core/libs/INIReader.h index 3e70d819e..0680cb89e 100644 --- a/src/core/libs/INIReader.h +++ b/src/core/libs/INIReader.h @@ -48,6 +48,7 @@ #ifndef __INIREADER_H__ #define __INIREADER_H__ +#include #include #include @@ -69,7 +70,7 @@ public: std::string default_value); //! Get an integer (long) value from INI file, returning default_value if not found. - long GetInteger(std::string section, std::string name, long default_value); + int64_t GetInteger(std::string section, std::string name, int64_t default_value); private: int _error; diff --git a/src/core/libs/string_converter.cc b/src/core/libs/string_converter.cc index 15360400d..8675c586c 100644 --- a/src/core/libs/string_converter.cc +++ b/src/core/libs/string_converter.cc @@ -55,11 +55,11 @@ bool StringConverter::convert(const std::string& value, bool default_value) } -long StringConverter::convert(const std::string& value, long default_value) +int64_t StringConverter::convert(const std::string& value, int64_t default_value) { std::stringstream stream(value); - long result; + int64_t result; stream >> result; if (stream.fail()) @@ -73,7 +73,25 @@ long StringConverter::convert(const std::string& value, long default_value) } -int StringConverter::convert(const std::string& value, int default_value) +uint64_t StringConverter::convert(const std::string& value, uint64_t default_value) +{ + std::stringstream stream(value); + + uint64_t result; + stream >> result; + + if (stream.fail()) + { + return default_value; + } + else + { + return result; + } +} + + +int32_t StringConverter::convert(const std::string& value, int32_t default_value) { std::stringstream stream(value); @@ -91,11 +109,11 @@ int StringConverter::convert(const std::string& value, int default_value) } -unsigned int StringConverter::convert(const std::string& value, unsigned int default_value) +uint32_t StringConverter::convert(const std::string& value, uint32_t default_value) { std::stringstream stream(value); - unsigned int result; + uint32_t result; stream >> result; if (stream.fail()) @@ -109,11 +127,29 @@ unsigned int StringConverter::convert(const std::string& value, unsigned int def } -unsigned short StringConverter::convert(const std::string& value, unsigned short default_value) +uint16_t StringConverter::convert(const std::string& value, uint16_t default_value) { std::stringstream stream(value); - unsigned short result; + uint16_t result; + stream >> result; + + if (stream.fail()) + { + return default_value; + } + else + { + return result; + } +} + + +int16_t StringConverter::convert(const std::string& value, int16_t default_value) +{ + std::stringstream stream(value); + + int16_t result; stream >> result; if (stream.fail()) diff --git a/src/core/libs/string_converter.h b/src/core/libs/string_converter.h index c1a480a78..1514db265 100644 --- a/src/core/libs/string_converter.h +++ b/src/core/libs/string_converter.h @@ -33,6 +33,7 @@ #ifndef GNSS_SDR_STRING_CONVERTER_H_ #define GNSS_SDR_STRING_CONVERTER_H_ +#include #include /*! @@ -46,10 +47,12 @@ public: virtual ~StringConverter(); bool convert(const std::string& value, bool default_value); - long convert(const std::string& value, long default_value); - int convert(const std::string& value, int default_value); - unsigned int convert(const std::string& value, unsigned int default_value); - unsigned short convert(const std::string& value, unsigned short default_value); + int64_t convert(const std::string& value, int64_t default_value); + uint64_t convert(const std::string& value, uint64_t default_value); + int32_t convert(const std::string& value, int32_t default_value); + uint32_t convert(const std::string& value, uint32_t default_value); + int16_t convert(const std::string& value, int16_t default_value); + uint16_t convert(const std::string& value, uint16_t default_value); float convert(const std::string& value, float default_value); double convert(const std::string& value, double default_value); }; diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index d788b52b0..4f3918d8a 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -69,9 +69,7 @@ gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, } -gnss_synchro_monitor::~gnss_synchro_monitor() -{ -} +gnss_synchro_monitor::~gnss_synchro_monitor() = default; int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& input_items, diff --git a/src/core/receiver/control_message_factory.cc b/src/core/receiver/control_message_factory.cc index 2210713c9..d2871d39e 100644 --- a/src/core/receiver/control_message_factory.cc +++ b/src/core/receiver/control_message_factory.cc @@ -35,11 +35,11 @@ using google::LogMessage; // Constructor -ControlMessageFactory::ControlMessageFactory() {} +ControlMessageFactory::ControlMessageFactory() = default; // Destructor -ControlMessageFactory::~ControlMessageFactory() {} +ControlMessageFactory::~ControlMessageFactory() = default; gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what) @@ -53,7 +53,7 @@ gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsig } -std::shared_ptr>> ControlMessageFactory::GetControlMessages(gr::message::sptr queue_message) +std::shared_ptr>> ControlMessageFactory::GetControlMessages(const gr::message::sptr& queue_message) { std::shared_ptr>> control_messages = std::make_shared>>(); unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); diff --git a/src/core/receiver/control_message_factory.h b/src/core/receiver/control_message_factory.h index 53339cea5..3aac015a9 100644 --- a/src/core/receiver/control_message_factory.h +++ b/src/core/receiver/control_message_factory.h @@ -58,7 +58,7 @@ public: virtual ~ControlMessageFactory(); gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what); - std::shared_ptr>> GetControlMessages(gr::message::sptr queue_message); + std::shared_ptr>> GetControlMessages(const gr::message::sptr& queue_message); }; #endif /*GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_*/ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index fa7001e97..c80c78de5 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -166,7 +166,7 @@ void ControlThread::init() else { // fill agnss_ref_time_ - struct tm tm; + struct tm tm = {}; if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) { agnss_ref_time_.d_tv_sec = timegm(&tm); @@ -190,8 +190,6 @@ void ControlThread::init() ControlThread::~ControlThread() { - // save navigation data to files - // if (save_assistance_to_XML() == true) {} if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); } @@ -878,7 +876,7 @@ std::vector> ControlThread::get_visible_sats(time std::vector visible_gps; std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); - struct tm tstruct; + struct tm tstruct = {}; char buf[80]; tstruct = *gmtime(&rx_utc_time); strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 43f177502..614d9268c 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -34,8 +34,8 @@ */ #include "file_configuration.h" -#include "in_memory_configuration.h" #include "INIReader.h" +#include "in_memory_configuration.h" #include "string_converter.h" #include #include @@ -45,7 +45,7 @@ using google::LogMessage; FileConfiguration::FileConfiguration(std::string filename) { - filename_ = filename; + filename_ = std::move(filename); init(); } @@ -84,13 +84,13 @@ bool FileConfiguration::property(std::string property_name, bool default_value) } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } -long FileConfiguration::property(std::string property_name, long default_value) +int64_t FileConfiguration::property(std::string property_name, int64_t default_value) { if (overrided_->is_present(property_name)) { @@ -98,7 +98,21 @@ long FileConfiguration::property(std::string property_name, long default_value) } else { - std::string empty = ""; + std::string empty; + return converter_->convert(property(property_name, empty), default_value); + } +} + + +uint64_t FileConfiguration::property(std::string property_name, uint64_t default_value) +{ + if (overrided_->is_present(property_name)) + { + return overrided_->property(property_name, default_value); + } + else + { + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -112,7 +126,7 @@ int FileConfiguration::property(std::string property_name, int default_value) } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -126,13 +140,13 @@ unsigned int FileConfiguration::property(std::string property_name, unsigned int } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } -unsigned short FileConfiguration::property(std::string property_name, unsigned short default_value) +uint16_t FileConfiguration::property(std::string property_name, uint16_t default_value) { if (overrided_->is_present(property_name)) { @@ -140,7 +154,21 @@ unsigned short FileConfiguration::property(std::string property_name, unsigned s } else { - std::string empty = ""; + std::string empty; + return converter_->convert(property(property_name, empty), default_value); + } +} + + +int16_t FileConfiguration::property(std::string property_name, int16_t default_value) +{ + if (overrided_->is_present(property_name)) + { + return overrided_->property(property_name, default_value); + } + else + { + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -154,7 +182,7 @@ float FileConfiguration::property(std::string property_name, float default_value } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -168,7 +196,7 @@ double FileConfiguration::property(std::string property_name, double default_val } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } diff --git a/src/core/receiver/file_configuration.h b/src/core/receiver/file_configuration.h index 2484438d8..0e2ccb53e 100644 --- a/src/core/receiver/file_configuration.h +++ b/src/core/receiver/file_configuration.h @@ -37,6 +37,7 @@ #define GNSS_SDR_FILE_CONFIGURATION_H_ #include "configuration_interface.h" +#include #include #include @@ -62,10 +63,12 @@ public: ~FileConfiguration(); std::string property(std::string property_name, std::string default_value); bool property(std::string property_name, bool default_value); - long property(std::string property_name, long default_value); - int property(std::string property_name, int default_value); - unsigned int property(std::string property_name, unsigned int default_value); - unsigned short property(std::string property_name, unsigned short default_value); + int64_t property(std::string property_name, int64_t default_value); + uint64_t property(std::string property_name, uint64_t default_value); + int32_t property(std::string property_name, int32_t default_value); + uint32_t property(std::string property_name, uint32_t default_value); + int16_t property(std::string property_name, int16_t default_value); + uint16_t property(std::string property_name, uint16_t default_value); float property(std::string property_name, float default_value); double property(std::string property_name, double default_value); void set_property(std::string property_name, std::string value); diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 7ef051d26..9f8b320c9 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -172,10 +172,10 @@ using google::LogMessage; -GNSSBlockFactory::GNSSBlockFactory() {} +GNSSBlockFactory::GNSSBlockFactory() = default; -GNSSBlockFactory::~GNSSBlockFactory() {} +GNSSBlockFactory::~GNSSBlockFactory() = default; std::unique_ptr GNSSBlockFactory::GetSignalSource( @@ -355,7 +355,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1C" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1C" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -420,7 +420,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2S" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2S" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -488,7 +488,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1B" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1B" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -556,7 +556,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_5X" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_5X" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -625,7 +625,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1G" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -694,7 +694,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2G" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -762,7 +762,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_L5" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_L5" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type.compare(trk_item_type) != 0) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -1505,7 +1505,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( else if (implementation.compare("GPS_L1_CA_KF_Tracking") == 0) { std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, - out_streams)); + out_streams)); block = std::move(block_); } else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) @@ -1886,7 +1886,7 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( else if (implementation.compare("GPS_L1_CA_KF_Tracking") == 0) { std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, - out_streams)); + out_streams)); block = std::move(block_); } else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index e00fe7847..f290975ff 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1611,7 +1611,7 @@ void GNSSFlowgraph::set_channels_state() } -Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool pop, bool tracked) +Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal, bool pop, bool tracked) { Gnss_Signal result; bool untracked_satellite = true; diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index d5e25543a..b279f6f67 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -148,7 +148,7 @@ private: void set_signals_list(); void set_channels_state(); // Initializes the channels state (start acquisition or keep standby) // using the configuration parameters (number of channels and max channels in acquisition) - Gnss_Signal search_next_signal(std::string searched_signal, bool pop, bool tracked = false); + Gnss_Signal search_next_signal(const std::string& searched_signal, bool pop, bool tracked = false); bool connected_; bool running_; int sources_count_; @@ -200,7 +200,7 @@ private: bool enable_monitor_; gr::basic_block_sptr GnssSynchroMonitor_; - std::vector split_string(const std::string &s, char delim); + std::vector split_string(const std::string& s, char delim); }; #endif /*GNSS_SDR_GNSS_FLOWGRAPH_H_*/ diff --git a/src/core/receiver/in_memory_configuration.cc b/src/core/receiver/in_memory_configuration.cc index 75b520362..ffca0eed1 100644 --- a/src/core/receiver/in_memory_configuration.cc +++ b/src/core/receiver/in_memory_configuration.cc @@ -64,49 +64,63 @@ std::string InMemoryConfiguration::property(std::string property_name, std::stri bool InMemoryConfiguration::property(std::string property_name, bool default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -long InMemoryConfiguration::property(std::string property_name, long default_value) +int64_t InMemoryConfiguration::property(std::string property_name, int64_t default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -int InMemoryConfiguration::property(std::string property_name, int default_value) +uint64_t InMemoryConfiguration::property(std::string property_name, uint64_t default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -unsigned int InMemoryConfiguration::property(std::string property_name, unsigned int default_value) +int32_t InMemoryConfiguration::property(std::string property_name, int32_t default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -unsigned short InMemoryConfiguration::property(std::string property_name, unsigned short default_value) +uint32_t InMemoryConfiguration::property(std::string property_name, uint32_t default_value) { - std::string empty = ""; + std::string empty; + return converter_->convert(property(property_name, empty), default_value); +} + + +uint16_t InMemoryConfiguration::property(std::string property_name, uint16_t default_value) +{ + std::string empty; + return converter_->convert(property(property_name, empty), default_value); +} + + +int16_t InMemoryConfiguration::property(std::string property_name, int16_t default_value) +{ + std::string empty; return converter_->convert(property(property_name, empty), default_value); } float InMemoryConfiguration::property(std::string property_name, float default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } double InMemoryConfiguration::property(std::string property_name, double default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } @@ -124,7 +138,7 @@ void InMemoryConfiguration::supersede_property(std::string property_name, std::s } -bool InMemoryConfiguration::is_present(std::string property_name) +bool InMemoryConfiguration::is_present(const std::string& property_name) { return (properties_.find(property_name) != properties_.end()); } diff --git a/src/core/receiver/in_memory_configuration.h b/src/core/receiver/in_memory_configuration.h index 59c1f1baf..698071a36 100644 --- a/src/core/receiver/in_memory_configuration.h +++ b/src/core/receiver/in_memory_configuration.h @@ -36,6 +36,7 @@ #define GNSS_SDR_IN_MEMORY_CONFIGURATION_H_ #include "configuration_interface.h" +#include #include #include #include @@ -56,15 +57,17 @@ public: virtual ~InMemoryConfiguration(); std::string property(std::string property_name, std::string default_value); bool property(std::string property_name, bool default_value); - long property(std::string property_name, long default_value); - int property(std::string property_name, int default_value); - unsigned int property(std::string property_name, unsigned int default_value); - unsigned short property(std::string property_name, unsigned short default_value); + int64_t property(std::string property_name, int64_t default_value); + uint64_t property(std::string property_name, uint64_t default_value); + int32_t property(std::string property_name, int32_t default_value); + uint32_t property(std::string property_name, uint32_t default_value); + int16_t property(std::string property_name, int16_t default_value); + uint16_t property(std::string property_name, uint16_t default_value); float property(std::string property_name, float default_value); double property(std::string property_name, double default_value); void set_property(std::string property_name, std::string value); void supersede_property(std::string property_name, std::string value); - bool is_present(std::string property_name); + bool is_present(const std::string& property_name); private: std::map properties_; diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index ecb175e5f..220d4effb 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -142,7 +142,7 @@ std::string TcpCmdInterface::status(const std::vector &commandLine &course_over_ground_deg, &UTC_time) == true) { - struct tm tstruct; + struct tm tstruct = {}; char buf1[80]; tstruct = *gmtime(&UTC_time); strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct); @@ -173,7 +173,7 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin if (commandLine.size() > 5) { // Read commandline time parameter - struct tm tm; + struct tm tm = {}; if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { response = "ERROR: time parameter malformed\n"; @@ -219,7 +219,7 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi { std::string tmp_str; // Read commandline time parameter - struct tm tm; + struct tm tm = {}; tmp_str = commandLine.at(1) + commandLine.at(2); if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { @@ -336,7 +336,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) { try { - if (cmd_vector.at(0).compare("exit") == 0) + if (cmd_vector.at(0) == "exit") { error = boost::asio::error::eof; // send cmd response diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 2323e357d..841270668 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -28,23 +28,24 @@ * * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_TCPCMDINTERFACE_H_ -#define GNSS_SDR_TCPCMDINTERFACE_H_ +#ifndef GNSS_SDR_TCP_CMD_INTERFACE_H_ +#define GNSS_SDR_TCP_CMD_INTERFACE_H_ #include "pvt_interface.h" +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include + class TcpCmdInterface { @@ -53,10 +54,12 @@ public: virtual ~TcpCmdInterface(); void run_cmd_server(int tcp_port); void set_msg_queue(gr::msg_queue::sptr control_queue); + /*! * \brief gets the UTC time parsed from the last TC command issued */ time_t get_utc_time(); + /*! * \brief gets the Latitude, Longitude and Altitude vector from the last TC command issued */ @@ -89,4 +92,4 @@ private: std::shared_ptr PVT_sptr_; }; -#endif /* GNSS_SDR_TCPCMDINTERFACE_H_ */ +#endif /* GNSS_SDR_TCP_CMD_INTERFACE_H_ */ From 1ed73eb2f8bc1fba64c07f49ec9e4749edd53070 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 12:11:59 +0100 Subject: [PATCH 38/52] Fix building --- .../adapters/two_bit_packed_file_signal_source.cc | 15 ++++++++++----- .../adapters/two_bit_packed_file_signal_source.h | 7 ++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index c20ca2962..fdbbab1b6 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -46,8 +46,13 @@ using google::LogMessage; TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, + unsigned int in_streams, + unsigned int out_streams, + boost::shared_ptr queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams), + queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -56,7 +61,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac double default_seconds_to_skip = 0.0; samples_ = configuration->property(role + ".samples", 0ULL); - sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); + sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL); filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present @@ -72,7 +77,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip); - long bytes_to_skip = 0; + int64_t bytes_to_skip = 0; if (item_type_.compare("byte") == 0) { @@ -122,7 +127,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac if (seconds_to_skip > 0) { - bytes_to_skip = static_cast( + bytes_to_skip = static_cast( seconds_to_skip * sampling_frequency_ / 4); if (is_complex_) { diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 71ed81dbd..00019ce4c 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -98,12 +99,12 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } @@ -130,7 +131,7 @@ public: private: uint64_t samples_; - long sampling_frequency_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; From 5f01161af6e80e203588da2b0a2e7e9e0141024a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 12:24:44 +0100 Subject: [PATCH 39/52] Fix building --- .../two_bit_cpx_file_signal_source.cc | 19 +++++++++++-------- .../adapters/two_bit_cpx_file_signal_source.h | 15 +++++++++------ .../two_bit_packed_file_signal_source.cc | 18 +++++++++--------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index 78a08500c..256e73952 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -44,8 +44,13 @@ using google::LogMessage; TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, + unsigned int in_streams, + unsigned int out_streams, + boost::shared_ptr queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams), + queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -56,8 +61,8 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; + if (FLAGS_s != "-") filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); @@ -65,7 +70,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); - if (item_type_.compare("byte") == 0) + if (item_type_ == "byte") { item_size_ = sizeof(char); } @@ -177,9 +182,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con } -TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource() -{ -} +TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource() = default; void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index c0f58687e..0088e1287 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -54,8 +55,10 @@ class ConfigurationInterface; class TwoBitCpxFileSignalSource : public GNSSBlockInterface { public: - TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, + TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, + unsigned int out_streams, boost::shared_ptr queue); virtual ~TwoBitCpxFileSignalSource(); @@ -97,19 +100,19 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } private: - unsigned long long samples_; - long sampling_frequency_; + uint64_t samples_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index fdbbab1b6..dc46291c5 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -60,13 +60,13 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac std::string default_sample_type = "real"; double default_seconds_to_skip = 0.0; - samples_ = configuration->property(role + ".samples", 0ULL); - sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL); + samples_ = configuration->property(role + ".samples", 0); + sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; + if (FLAGS_s != "-") filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); big_endian_items_ = configuration->property(role + ".big_endian_items", true); @@ -79,11 +79,11 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip); int64_t bytes_to_skip = 0; - if (item_type_.compare("byte") == 0) + if (item_type_ == "byte") { item_size_ = sizeof(char); } - else if (item_type_.compare("short") == 0) + else if (item_type_ == "short") { // If we have shorts stored in little endian format, might as // well read them in as bytes. @@ -102,16 +102,16 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac item_size_ = sizeof(char); } - if (sample_type_.compare("real") == 0) + if (sample_type_ == "real") { is_complex_ = false; } - else if (sample_type_.compare("iq") == 0) + else if (sample_type_ == "iq") { is_complex_ = true; reverse_interleaving_ = false; } - else if (sample_type_.compare("qi") == 0) + else if (sample_type_ == "qi") { is_complex_ = true; reverse_interleaving_ = true; From cc58fbe30f89f444ef45a86838a9a7628a3afeaf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 14:32:22 +0100 Subject: [PATCH 40/52] Improve data types and string comparisons --- src/core/system_parameters/GPS_CNAV.h | 6 +- src/core/system_parameters/GPS_L1_CA.h | 2 +- src/core/system_parameters/Galileo_E1.h | 4 +- src/core/system_parameters/Galileo_E5a.h | 2 +- .../galileo_almanac_helper.h | 4 +- .../system_parameters/galileo_fnav_message.cc | 58 +++++++++++-------- .../system_parameters/galileo_fnav_message.h | 18 +++--- .../galileo_navigation_message.cc | 50 ++++++++-------- .../galileo_navigation_message.h | 18 +++--- .../system_parameters/galileo_utc_model.cc | 4 +- .../system_parameters/galileo_utc_model.h | 5 +- src/core/system_parameters/gnss_satellite.cc | 34 +++++------ src/core/system_parameters/gnss_signal.cc | 6 +- src/core/system_parameters/gps_almanac.cc | 2 +- .../gps_cnav_navigation_message.cc | 20 +++---- .../gps_cnav_navigation_message.h | 6 +- .../system_parameters/gps_cnav_utc_model.cc | 2 +- src/core/system_parameters/gps_ephemeris.cc | 2 +- .../gps_navigation_message.cc | 22 +++---- .../gps_navigation_message.h | 8 +-- src/core/system_parameters/gps_utc_model.cc | 2 +- 21 files changed, 140 insertions(+), 135 deletions(-) diff --git a/src/core/system_parameters/GPS_CNAV.h b/src/core/system_parameters/GPS_CNAV.h index 2fbad6e2d..5ab606bc4 100644 --- a/src/core/system_parameters/GPS_CNAV.h +++ b/src/core/system_parameters/GPS_CNAV.h @@ -171,11 +171,11 @@ const double CNAV_DELTA_TLS_LSB = 1; const std::vector > CNAV_TOT({{172, 16}}); const double CNAV_TOT_LSB = TWO_P4; const std::vector > CNAV_WN_OT({{188, 13}}); -const double CNAV_WN_OT_LSB = 1; +const int32_t CNAV_WN_OT_LSB = 1; const std::vector > CNAV_WN_LSF({{201, 13}}); -const double CNAV_WN_LSF_LSB = 1; +const int32_t CNAV_WN_LSF_LSB = 1; const std::vector > CNAV_DN({{214, 4}}); -const double CNAV_DN_LSB = 1; +const int32_t CNAV_DN_LSB = 1; const std::vector > CNAV_DELTA_TLSF({{218, 8}}); const double CNAV_DELTA_TLSF_LSB = 1; diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index e3a3871f7..9879716e4 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -221,7 +221,7 @@ const std::vector> HEALTH_SV32({{283, 6}}); // page 25 - Health (PRN 1 - 24) const std::vector> T_OA({{69, 8}}); -const double T_OA_LSB = TWO_P12; +const int32_t T_OA_LSB = TWO_P12; const std::vector> WN_A({{77, 8}}); const std::vector> HEALTH_SV1({{91, 6}}); const std::vector> HEALTH_SV2({{97, 6}}); diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index e25501e08..7cb1ac433 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -205,7 +205,7 @@ const std::vector> TOW_6_bit({{106, 20}}); const std::vector> IOD_a_7_bit({{7, 4}}); const std::vector> WN_a_7_bit({{11, 2}}); const std::vector> t0a_7_bit({{13, 10}}); -const double t0a_7_LSB = 600; +const int32_t t0a_7_LSB = 600; const std::vector> SVID1_7_bit({{23, 6}}); const std::vector> DELTA_A_7_bit({{29, 13}}); const double DELTA_A_7_LSB = TWO_N9; @@ -250,7 +250,7 @@ const double Omega_dot_8_LSB = TWO_N33; const std::vector> IOD_a_9_bit({{7, 4}}); const std::vector> WN_a_9_bit({{11, 2}}); const std::vector> t0a_9_bit({{13, 10}}); -const double t0a_9_LSB = 600; +const int32_t t0a_9_LSB = 600; const std::vector> M0_9_bit({{23, 16}}); const double M0_9_LSB = TWO_N15; const std::vector> af0_9_bit({{39, 16}}); diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index ea84ab3c9..b8540d32c 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -174,7 +174,7 @@ const std::vector> FNAV_TOW_4_bit({{190, 20}}); const std::vector> FNAV_IODa_5_bit({{7, 4}}); const std::vector> FNAV_WNa_5_bit({{11, 2}}); const std::vector> FNAV_t0a_5_bit({{13, 10}}); -const double FNAV_t0a_5_LSB = 600; +const int32_t FNAV_t0a_5_LSB = 600; const std::vector> FNAV_SVID1_5_bit({{23, 6}}); const std::vector> FNAV_Deltaa12_1_5_bit({{29, 13}}); const double FNAV_Deltaa12_5_LSB = TWO_N9; diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index 1b2e1b28e..960ccd09e 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -45,7 +45,7 @@ public: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; int32_t WN_a_7; - double t0a_7; + int32_t t0a_7; int32_t SVID1_7; double DELTA_A_7; double e_7; @@ -73,7 +73,7 @@ public: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) int32_t IOD_a_9; int32_t WN_a_9; - double t0a_9; + int32_t t0a_9; double M0_9; double af0_9; double af1_9; diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 33cd59056..03d74680b 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -41,7 +41,7 @@ #include -typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_Galileo_FNAV_type; +using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; void Galileo_Fnav_Message::reset() { @@ -84,7 +84,7 @@ void Galileo_Fnav_Message::reset() FNAV_region4_1 = false; FNAV_region5_1 = false; FNAV_BGD_1 = 0.0; - FNAV_E5ahs_1 = 0.0; + FNAV_E5ahs_1 = 0; FNAV_WN_1 = 0.0; FNAV_TOW_1 = 0.0; FNAV_E5advs_1 = false; @@ -134,8 +134,8 @@ void Galileo_Fnav_Message::reset() // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time FNAV_IODa_5 = 0; - FNAV_WNa_5 = 0.0; - FNAV_t0a_5 = 0.0; + FNAV_WNa_5 = 0; + FNAV_t0a_5 = 0; FNAV_SVID1_5 = 0; FNAV_Deltaa12_1_5 = 0.0; FNAV_e_1_5 = 0.0; @@ -160,7 +160,7 @@ void Galileo_Fnav_Message::reset() FNAV_M0_2_6 = 0.0; FNAV_af0_2_6 = 0.0; FNAV_af1_2_6 = 0.0; - FNAV_E5ahs_2_6 = 0.0; + FNAV_E5ahs_2_6 = 0; FNAV_SVID3_6 = 0; FNAV_Deltaa12_3_6 = 0.0; FNAV_e_3_6 = 0.0; @@ -171,7 +171,7 @@ void Galileo_Fnav_Message::reset() FNAV_M0_3_6 = 0.0; FNAV_af0_3_6 = 0.0; FNAV_af1_3_6 = 0.0; - FNAV_E5ahs_3_6 = 0.0; + FNAV_E5ahs_3_6 = 0; } @@ -181,7 +181,7 @@ Galileo_Fnav_Message::Galileo_Fnav_Message() } -void Galileo_Fnav_Message::split_page(std::string page_string) +void Galileo_Fnav_Message::split_page(const std::string& page_string) { std::string message_word = page_string.substr(0, 214); std::string CRC_data = page_string.substr(214, 24); @@ -231,7 +231,7 @@ bool Galileo_Fnav_Message::_CRC_test(std::bitset b } -void Galileo_Fnav_Message::decode_page(std::string data) +void Galileo_Fnav_Message::decode_page(const std::string& data) { std::bitset data_bits(data); page_type = read_navigation_unsigned(data_bits, FNAV_PAGE_TYPE_bit); @@ -346,8 +346,8 @@ void Galileo_Fnav_Message::decode_page(std::string data) break; case 5: // Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time FNAV_IODa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit)); - FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); - FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); + FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); + FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); FNAV_t0a_5 *= FNAV_t0a_5_LSB; FNAV_SVID1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit)); FNAV_Deltaa12_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_1_5_bit)); @@ -368,7 +368,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) FNAV_af0_1_5 *= FNAV_af0_5_LSB; FNAV_af1_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_5_bit)); FNAV_af1_1_5 *= FNAV_af1_5_LSB; - FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); + FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); FNAV_SVID2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit)); FNAV_Deltaa12_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_2_5_bit)); FNAV_Deltaa12_2_5 *= FNAV_Deltaa12_5_LSB; @@ -404,7 +404,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) FNAV_af0_2_6 *= FNAV_af0_5_LSB; FNAV_af1_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_2_6_bit)); FNAV_af1_2_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); + FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); FNAV_SVID3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit)); FNAV_Deltaa12_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_3_6_bit)); FNAV_Deltaa12_3_6 *= FNAV_Deltaa12_5_LSB; @@ -424,7 +424,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) FNAV_af0_3_6 *= FNAV_af0_5_LSB; FNAV_af1_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_3_6_bit)); FNAV_af1_3_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); + FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); flag_almanac_2 = true; break; @@ -432,7 +432,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) } -uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { uint64_t value = 0ULL; int num_of_slices = parameter.size(); @@ -441,7 +441,7 @@ uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset(bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j]) == 1) { value += 1; // insert the bit } @@ -451,13 +451,13 @@ uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { int64_t value = 0LL; int num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[0].first] == 1) + if (static_cast(bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[0].first]) == 1) { value ^= 0x0FFFFFFFFFFFFFFF; // 64 bits variable } @@ -472,7 +472,7 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset(bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j]) == 1) { value += 1; // insert the bit } @@ -504,7 +504,9 @@ bool Galileo_Fnav_Message::have_new_ephemeris() // Check if we have a new ephem } } else - return false; + { + return false; + } } @@ -513,10 +515,12 @@ bool Galileo_Fnav_Message::have_new_iono_and_GST() // Check if we have a new io if ((flag_iono_and_GST == true) and (flag_utc_model == true)) // the condition on flag_utc_model is added to have a time stamp for iono { flag_iono_and_GST = false; // clear the flag - return true; } else - return false; + { + return false; + } + return true; } @@ -525,10 +529,12 @@ bool Galileo_Fnav_Message::have_new_utc_model() // Check if we have a new utc d if (flag_utc_model == true) { flag_utc_model = false; // clear the flag - return true; } else - return false; + { + return false; + } + return true; } @@ -540,10 +546,12 @@ bool Galileo_Fnav_Message::have_new_almanac() // Check if we have a new almanac flag_almanac_1 = false; flag_almanac_2 = false; flag_all_almanac = true; - return true; } else - return false; + { + return false; + } + return true; } diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index 2a16578be..c08c6d7c7 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -57,7 +57,7 @@ class Galileo_Fnav_Message { public: - void split_page(std::string page_string); + void split_page(const std::string& page_string); void reset(); bool have_new_ephemeris(); bool have_new_iono_and_GST(); @@ -109,7 +109,7 @@ public: bool FNAV_region4_1; bool FNAV_region5_1; double FNAV_BGD_1; - double FNAV_E5ahs_1; + int32_t FNAV_E5ahs_1; double FNAV_WN_1; double FNAV_TOW_1; bool FNAV_E5advs_1; @@ -159,8 +159,8 @@ public: // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time int32_t FNAV_IODa_5; - double FNAV_WNa_5; - double FNAV_t0a_5; + int32_t FNAV_WNa_5; + int32_t FNAV_t0a_5; int32_t FNAV_SVID1_5; double FNAV_Deltaa12_1_5; double FNAV_e_1_5; @@ -185,7 +185,7 @@ public: double FNAV_M0_2_6; double FNAV_af0_2_6; double FNAV_af1_2_6; - double FNAV_E5ahs_2_6; + int32_t FNAV_E5ahs_2_6; int32_t FNAV_SVID3_6; double FNAV_Deltaa12_3_6; double FNAV_e_3_6; @@ -196,13 +196,13 @@ public: double FNAV_M0_3_6; double FNAV_af0_3_6; double FNAV_af1_3_6; - double FNAV_E5ahs_3_6; + int32_t FNAV_E5ahs_3_6; private: bool _CRC_test(std::bitset bits, uint32_t checksum); - void decode_page(std::string data); - uint64_t read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - int64_t read_navigation_signed(std::bitset bits, const std::vector> parameter); + void decode_page(const std::string& data); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); std::string omega0_1; //std::string omega0_2; diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 4e72f62d3..ded7a075a 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -37,7 +37,7 @@ #include -typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_Galileo_INAV_type; +using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; void Galileo_Navigation_Message::reset() @@ -139,15 +139,15 @@ void Galileo_Navigation_Message::reset() Delta_tLS_6 = 0.0; t0t_6 = 0.0; WNot_6 = 0.0; - WN_LSF_6 = 0.0; - DN_6 = 0.0; + WN_LSF_6 = 0; + DN_6 = 0; Delta_tLSF_6 = 0.0; TOW_6 = 0.0; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; WN_a_7 = 0; - t0a_7 = 0.0; + t0a_7 = 0; SVID1_7 = 0; DELTA_A_7 = 0.0; e_7 = 0.0; @@ -174,7 +174,7 @@ void Galileo_Navigation_Message::reset() // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = 0; WN_a_9 = 0; - t0a_9 = 0.0; + t0a_9 = 0; M0_9 = 0.0; af0_9 = 0.0; af1_9 = 0.0; @@ -260,7 +260,7 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset b } -uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector > parameter) +uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector >& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -269,7 +269,7 @@ uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset(bits[GALILEO_DATA_JK_BITS - parameter[i].first - j]) == 1) { value += 1; // insert the bit } @@ -279,7 +279,7 @@ uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector > parameter) +uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset bits, const std::vector >& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -288,7 +288,7 @@ uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset(bits[GALILEO_PAGE_TYPE_BITS - parameter[i].first - j]) == 1) { value += 1ULL; // insert the bit } @@ -298,13 +298,13 @@ uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset bits, const std::vector > parameter) +int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector >& parameter) { int64_t value = 0LL; int32_t num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1) + if (static_cast(bits[GALILEO_DATA_JK_BITS - parameter[0].first]) == 1) { value ^= 0xFFFFFFFFFFFFFFFFLL; // 64 bits variable } @@ -319,7 +319,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset(bits[GALILEO_DATA_JK_BITS - parameter[i].first - j]) == 1) { value += 1LL; // insert the bit } @@ -329,10 +329,10 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector > parameter) +bool Galileo_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector >& parameter) { bool value; - if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1) + if (static_cast(static_cast(bits[GALILEO_DATA_JK_BITS - parameter[0].first])) == 1) { value = true; } @@ -356,7 +356,7 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int32_t fla if (page_string.at(0) == '1') // if page is odd { // std::cout<< "page_string.at(0) split page="< 32) { @@ -170,7 +168,7 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) PRN = PRN_; } } - else if (system.compare("Glonass") == 0) + else if (system == "Glonass") { if (PRN_ < 1 or PRN_ > 24) { @@ -182,7 +180,7 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) PRN = PRN_; } } - else if (system.compare("SBAS") == 0) + else if (system == "SBAS") { if (PRN_ == 120) { @@ -214,7 +212,7 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) PRN = 0; } } - else if (system.compare("Galileo") == 0) + else if (system == "Galileo") { if (PRN_ < 1 or PRN_ > 36) { @@ -280,7 +278,7 @@ std::string Gnss_Satellite::get_block() const std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_) { std::string block_ = "Unknown"; - if (system_.compare("GPS") == 0) + if (system_ == "GPS") { // info from https://www.navcen.uscg.gov/?Do=constellationStatus switch (PRN_) @@ -386,7 +384,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ } } - if (system_.compare("Glonass") == 0) + if (system_ == "Glonass") { // Info from http://www.sdcm.ru/smglo/grupglo?version=eng&site=extern // See also http://www.glonass-center.ru/en/GLONASS/ @@ -492,7 +490,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ block_ = std::string("Unknown"); } } - if (system_.compare("SBAS") == 0) + if (system_ == "SBAS") { switch (PRN_) { @@ -518,7 +516,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ block_ = std::string("Unknown"); } } - if (system_.compare("Galileo") == 0) + if (system_ == "Galileo") { // Check http://en.wikipedia.org/wiki/List_of_Galileo_satellites and https://www.gsc-europa.eu/system-status/Constellation-Information switch (PRN_) diff --git a/src/core/system_parameters/gnss_signal.cc b/src/core/system_parameters/gnss_signal.cc index cc2e8effd..0c25a7841 100644 --- a/src/core/system_parameters/gnss_signal.cc +++ b/src/core/system_parameters/gnss_signal.cc @@ -50,9 +50,7 @@ Gnss_Signal::Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& si } -Gnss_Signal::~Gnss_Signal() -{ -} +Gnss_Signal::~Gnss_Signal() = default; std::string Gnss_Signal::get_signal_str() const @@ -80,7 +78,7 @@ bool operator==(const Gnss_Signal& sig1, const Gnss_Signal& sig2) if (sig1.get_satellite() == sig2.get_satellite()) { - if (sig1.get_signal_str().compare(sig1.get_signal_str()) == 0) + if (sig1.get_signal_str() == sig1.get_signal_str()) { equal = true; } diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc index 987032668..ec0bd828a 100644 --- a/src/core/system_parameters/gps_almanac.cc +++ b/src/core/system_parameters/gps_almanac.cc @@ -36,7 +36,7 @@ Gps_Almanac::Gps_Almanac() { i_satellite_PRN = 0U; d_Delta_i = 0.0; - i_Toa = 0.0; + i_Toa = 0; i_WNa = 0; d_M_0 = 0.0; d_e_eccentricity = 0.0; diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 642695469..b0605bae9 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -72,11 +72,11 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() } -bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) { bool value; - if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first]) == 1) { value = true; } @@ -88,7 +88,7 @@ bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -97,7 +97,7 @@ uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j]) == 1) { value += 1ULL; // insert the bit } @@ -107,13 +107,13 @@ uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { int64_t value = 0LL; int32_t num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first]) == 1) { value ^= 0xFFFFFFFFFFFFFFFFLL; // 64 bits variable } @@ -128,7 +128,7 @@ int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j]) == 1) { value += 1LL; // insert the bit } @@ -306,13 +306,13 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset(read_navigation_signed(data_bits, CNAV_TOT)); utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB; - utc_model_record.i_WN_T = static_cast(read_navigation_signed(data_bits, CNAV_WN_OT)); + utc_model_record.i_WN_T = static_cast(read_navigation_signed(data_bits, CNAV_WN_OT)); utc_model_record.i_WN_T = utc_model_record.i_WN_T * CNAV_WN_OT_LSB; - utc_model_record.i_WN_LSF = static_cast(read_navigation_signed(data_bits, CNAV_WN_LSF)); + utc_model_record.i_WN_LSF = static_cast(read_navigation_signed(data_bits, CNAV_WN_LSF)); utc_model_record.i_WN_LSF = utc_model_record.i_WN_LSF * CNAV_WN_LSF_LSB; - utc_model_record.i_DN = static_cast(read_navigation_signed(data_bits, CNAV_DN)); + utc_model_record.i_DN = static_cast(read_navigation_signed(data_bits, CNAV_DN)); utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB; utc_model_record.d_DeltaT_LSF = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_TLSF)); diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index cdd6447b0..f34e33e91 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -56,9 +56,9 @@ class Gps_CNAV_Navigation_Message { private: - uint64_t read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - int64_t read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); + bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); Gps_CNAV_Ephemeris ephemeris_record; Gps_CNAV_Iono iono_record; diff --git a/src/core/system_parameters/gps_cnav_utc_model.cc b/src/core/system_parameters/gps_cnav_utc_model.cc index 90e1a4af2..565993f06 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.cc +++ b/src/core/system_parameters/gps_cnav_utc_model.cc @@ -84,7 +84,7 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week * proper accommodation of the leap second event with a possible week number * transition is provided by the following expression for UTC: */ - int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = static_cast(fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400)) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); // implement something to handle a leap second event! } diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index c7f394efc..abec83103 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -31,8 +31,8 @@ */ #include "gps_ephemeris.h" -#include "gnss_satellite.h" #include "GPS_L1_CA.h" +#include "gnss_satellite.h" #include Gps_Ephemeris::Gps_Ephemeris() diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index e4a7f1db1..01e8ce430 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -160,11 +160,11 @@ void Gps_Navigation_Message::print_gps_word_bytes(uint32_t GPS_word) } -bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) { bool value; - if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_SUBFRAME_BITS - parameter[0].first]) == 1) { value = true; } @@ -176,7 +176,7 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset } -uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -185,7 +185,7 @@ uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset(bits[GPS_SUBFRAME_BITS - parameter[i].first - j]) == 1) { value += 1ULL; // insert the bit } @@ -195,13 +195,13 @@ uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { int64_t value = 0LL; int32_t num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_SUBFRAME_BITS - parameter[0].first]) == 1) { value ^= 0xFFFFFFFFFFFFFFFFLL; // 64 bits variable } @@ -216,7 +216,7 @@ int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset(bits[GPS_SUBFRAME_BITS - parameter[i].first - j]) == 1) { value += 1LL; // insert the bit } @@ -226,7 +226,7 @@ int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) { //! \TODO read almanac - if (SV_data_ID) + if (SV_data_ID != 0) { } } @@ -428,7 +428,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char *subframe) if (SV_page_5 < 25) { //! \TODO read almanac - if (SV_data_ID_5) + if (SV_data_ID_5 != 0) { } } @@ -510,7 +510,7 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const * proper accommodation of the leap second event with a possible week number * transition is provided by the following expression for UTC: */ - int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = static_cast(fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400)) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); //implement something to handle a leap second event! } diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 595d74d30..7c70e25c9 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -54,9 +54,9 @@ class Gps_Navigation_Message { private: - uint64_t read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - int64_t read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); + bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); void print_gps_word_bytes(uint32_t GPS_word); public: @@ -198,7 +198,7 @@ public: /*! * \brief Decodes the GPS NAV message */ - int32_t subframe_decoder(char *subframe); + int32_t subframe_decoder(char* subframe); /*! * \brief Computes the Coordinated Universal Time (UTC) and diff --git a/src/core/system_parameters/gps_utc_model.cc b/src/core/system_parameters/gps_utc_model.cc index 0f9a5744e..c29a61e5d 100644 --- a/src/core/system_parameters/gps_utc_model.cc +++ b/src/core/system_parameters/gps_utc_model.cc @@ -84,7 +84,7 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week) * proper accommodation of the leap second event with a possible week number * transition is provided by the following expression for UTC: */ - int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = static_cast(fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400)) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); // implement something to handle a leap second event! } From f7df714a7f2c8fccfa0d5051606186506bbce632 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 15:42:38 +0100 Subject: [PATCH 41/52] Fix string comparisons, improve const correctness --- src/algorithms/PVT/libs/geojson_printer.cc | 8 +- src/algorithms/PVT/libs/geojson_printer.h | 2 +- src/algorithms/PVT/libs/gpx_printer.cc | 8 +- src/algorithms/PVT/libs/gpx_printer.h | 2 +- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 4 +- src/algorithms/PVT/libs/kml_printer.cc | 10 +- src/algorithms/PVT/libs/kml_printer.h | 2 +- src/algorithms/PVT/libs/ls_pvt.cc | 7 +- src/algorithms/PVT/libs/nmea_printer.cc | 12 +- src/algorithms/PVT/libs/nmea_printer.h | 6 +- src/algorithms/PVT/libs/pvt_solution.cc | 2 +- src/algorithms/PVT/libs/rinex_printer.cc | 516 ++++++++++----------- src/algorithms/PVT/libs/rtcm_printer.cc | 2 +- src/algorithms/PVT/libs/rtklib_solver.cc | 18 +- 14 files changed, 300 insertions(+), 299 deletions(-) diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index b79a4edae..5a6561880 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -68,7 +68,7 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) { geojson_base_path = p.string(); } - if (geojson_base_path.compare(".") != 0) + if (geojson_base_path != ".") { std::cout << "GeoJSON files will be stored at " << geojson_base_path << std::endl; } @@ -83,7 +83,7 @@ GeoJSON_Printer::~GeoJSON_Printer() } -bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) +bool GeoJSON_Printer::set_headers(const std::string& filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -140,7 +140,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) DLOG(INFO) << "GeoJSON printer writing on " << filename.c_str(); // Set iostream numeric format and precision - geojson_file.setf(geojson_file.fixed, geojson_file.floatfield); + geojson_file.setf(geojson_file.std::ofstream::fixed, geojson_file.std::ofstream::floatfield); geojson_file << std::setprecision(14); // Writing the header @@ -171,7 +171,7 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr& positi double longitude; double height; - std::shared_ptr position_ = position; + const std::shared_ptr& position_ = position; if (print_average_values == false) { diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h index 63630552c..b9bdcdb28 100644 --- a/src/algorithms/PVT/libs/geojson_printer.h +++ b/src/algorithms/PVT/libs/geojson_printer.h @@ -55,7 +55,7 @@ private: public: GeoJSON_Printer(const std::string& base_path = "."); ~GeoJSON_Printer(); - bool set_headers(std::string filename, bool time_tag_name = true); + bool set_headers(const std::string& filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 1861139be..95495c6c2 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -70,7 +70,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) { gpx_base_path = p.string(); } - if (gpx_base_path.compare(".") != 0) + if (gpx_base_path != ".") { std::cout << "GPX files will be stored at " << gpx_base_path << std::endl; } @@ -79,7 +79,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) } -bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) +bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -134,7 +134,7 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) { DLOG(INFO) << "GPX printer writing on " << filename.c_str(); // Set iostream numeric format and precision - gpx_file.setf(gpx_file.fixed, gpx_file.floatfield); + gpx_file.setf(gpx_file.std::ofstream::fixed, gpx_file.std::ofstream::floatfield); gpx_file << std::setprecision(14); gpx_file << "" << std::endl << "& position, double height; positions_printed = true; - std::shared_ptr position_ = position; + const std::shared_ptr& position_ = position; double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double course_over_ground = position_->get_course_over_ground(); // expressed in deg diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index d4efcf81d..27e9fe4ff 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -57,7 +57,7 @@ private: public: Gpx_Printer(const std::string& base_path = "."); ~Gpx_Printer(); - bool set_headers(std::string filename, bool time_tag_name = true); + bool set_headers(const std::string& filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 2bded706f..5ca6ef597 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -173,7 +173,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do { // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_ephemeris_iter != gps_ephemeris_map.end()) @@ -228,7 +228,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; } } - if (sig_.compare("2S") == 0) + if (sig_ == "2S") { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index fb742b385..797f45ebb 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -70,7 +70,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) { kml_base_path = p.string(); } - if (kml_base_path.compare(".") != 0) + if (kml_base_path != ".") { std::cout << "KML files will be stored at " << kml_base_path << std::endl; } @@ -87,7 +87,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) } -bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) +bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -143,10 +143,10 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) { DLOG(INFO) << "KML printer writing on " << filename.c_str(); // Set iostream numeric format and precision - kml_file.setf(kml_file.fixed, kml_file.floatfield); + kml_file.setf(kml_file.std::ofstream::fixed, kml_file.std::ofstream::floatfield); kml_file << std::setprecision(14); - tmp_file.setf(tmp_file.fixed, tmp_file.floatfield); + tmp_file.setf(tmp_file.std::ofstream::fixed, tmp_file.std::ofstream::floatfield); tmp_file << std::setprecision(14); kml_file << "" << std::endl @@ -222,7 +222,7 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, positions_printed = true; - std::shared_ptr position_ = position; + const std::shared_ptr& position_ = position; double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double course_over_ground = position_->get_course_over_ground(); // expressed in deg diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 27225df7a..7909ad619 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -60,7 +60,7 @@ private: public: Kml_Printer(const std::string& base_path = std::string(".")); ~Kml_Printer(); - bool set_headers(std::string filename, bool time_tag_name = true); + bool set_headers(const std::string& filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index 77e2c69a9..9077dcd68 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -44,6 +44,7 @@ Ls_Pvt::Ls_Pvt() : Pvt_Solution() { } + arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) { // BANCROFT Calculation of preliminary coordinates for a GPS receiver based on pseudoranges @@ -233,9 +234,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo //--- Find DOA and range of satellites - double* azim = 0; - double* elev = 0; - double* dist = 0; + double* azim = nullptr; + double* elev = nullptr; + double* dist = nullptr; topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); if (traveltime < 0.1 && nmbOfSatellites > 3) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 7253b9f79..b1e7079f3 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -48,7 +48,7 @@ using google::LogMessage; -Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path) +Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path) { nmea_base_path = base_path; d_flag_nmea_output_file = flag_nmea_output_file; @@ -79,7 +79,7 @@ Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, boo nmea_base_path = p.string(); } - if ((nmea_base_path.compare(".") != 0) and (d_flag_nmea_output_file == true)) + if ((nmea_base_path != ".") and (d_flag_nmea_output_file == true)) { std::cout << "NMEA files will be stored at " << nmea_base_path << std::endl; } @@ -99,7 +99,7 @@ Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, boo } } - nmea_devname = nmea_dump_devname; + nmea_devname = std::move(nmea_dump_devname); if (flag_nmea_tty_port == true) { nmea_dev_descriptor = init_serial(nmea_devname.c_str()); @@ -126,20 +126,20 @@ Nmea_Printer::~Nmea_Printer() } -int Nmea_Printer::init_serial(std::string serial_device) +int Nmea_Printer::init_serial(const std::string& serial_device) { /*! * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) */ int fd = 0; - struct termios options; + struct termios options = {}; int64_t BAUD; int64_t DATABITS; int64_t STOPBITS; int64_t PARITYON; int64_t PARITY; - fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY); + fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC); if (fd == -1) return fd; // failed to open TTY port if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index b2f961756..c73ef91ff 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -53,12 +53,12 @@ public: /*! * \brief Default constructor. */ - Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_filename, const std::string& base_path = "."); + Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path = "."); /*! * \brief Print NMEA PVT and satellite info to the initialized device */ - bool Print_Nmea_Line(const std::shared_ptr& position, bool print_average_values); + bool Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values); /*! * \brief Default destructor. @@ -72,7 +72,7 @@ private: std::string nmea_devname; int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) std::shared_ptr d_PVT_data; - int init_serial(std::string serial_device); //serial port control + int init_serial(const std::string& serial_device); //serial port control void close_serial(); std::string get_GPGGA(); // fix data std::string get_GPGSV(); // satellite data diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 6071f38b0..b1366a751 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -188,7 +188,7 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb double b; double rtop; - while (1) + while (true) { rtop = pow((a_e + htop), 2) - pow((a_e + hsta_km), 2) * (1 - pow(sinel, 2)); diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 88c001e2b..73d8af555 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -78,7 +78,7 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) { base_rinex_path = p.string(); } - if (base_rinex_path.compare(".") != 0) + if (base_rinex_path != ".") { std::cout << "RINEX files will be stored at " << base_rinex_path << std::endl; } @@ -366,7 +366,7 @@ std::string Rinex_Printer::getLocalTime() if (version == 2) { int32_t day = pt_tm.tm_mday; - line += Rinex_Printer::rightJustify(boost::lexical_cast(day), 2); + line += Rinex_Printer::rightJustify(std::to_string(day), 2); line += std::string("-"); std::map months; @@ -385,7 +385,7 @@ std::string Rinex_Printer::getLocalTime() line += months[pt_tm.tm_mon]; line += std::string("-"); - line += boost::lexical_cast(pt_tm.tm_year - 100); + line += std::to_string(pt_tm.tm_year - 100); line += std::string(1, ' '); line += strmHour.str(); line += std::string(":"); @@ -468,8 +468,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -481,8 +481,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -589,8 +589,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -602,8 +602,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -614,8 +614,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -624,10 +624,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -713,8 +713,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -726,8 +726,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -738,8 +738,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -748,10 +748,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -839,8 +839,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -852,8 +852,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -862,10 +862,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLS_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_LSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.DN_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLS_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_LSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.DN_6), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -946,8 +946,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -958,8 +958,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string("GPGA"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_0G_10, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t_0G_10), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_0G_10), 5); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.t_0G_10), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -968,10 +968,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLS_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_LSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.DN_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLS_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_LSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.DN_6), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1064,8 +1064,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 /* if ( SBAS ) { line += string(1, ' '); @@ -1084,10 +1084,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1194,8 +1194,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1206,8 +1206,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1216,10 +1216,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1354,8 +1354,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string(3, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019 line += std::string(1, ' '); line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); } @@ -1365,8 +1365,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 /* if ( SBAS ) { line += string(1, ' '); @@ -1386,16 +1386,16 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); if (version == 2) { line += std::string(54, ' '); } if (version == 3) { - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); } line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); @@ -1490,8 +1490,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1502,8 +1502,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GPGA"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t_0G_10), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1514,8 +1514,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1524,10 +1524,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1678,8 +1678,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1689,8 +1689,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ line_aux += std::string("GLGP"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1763,8 +1763,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1774,18 +1774,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GPGA"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_0G_10, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLS_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_LSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.DN_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLS_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_LSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.DN_6), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -1869,15 +1869,15 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut line_aux += std::string(3, ' '); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019 line_aux += std::string(1, ' '); line_aux += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line_aux += std::string(54, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -1924,18 +1924,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2020,18 +2020,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2128,8 +2128,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2139,8 +2139,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GPGA"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2150,18 +2150,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2257,8 +2257,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2268,8 +2268,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2279,18 +2279,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GPGA"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2365,8 +2365,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2376,8 +2376,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2387,18 +2387,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GLGP"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2473,8 +2473,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2484,8 +2484,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2495,18 +2495,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp line_aux += std::string("GLGP"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2586,8 +2586,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2597,18 +2597,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLS_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_LSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.DN_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLS_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_LSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.DN_6), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2662,7 +2662,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(gps_ephemeris_iter->second.i_satellite_PRN), 2); + line += Rinex_Printer::rightJustify(std::to_string(gps_ephemeris_iter->second.i_satellite_PRN), 2); line += std::string(1, ' '); std::string year(timestring, 2, 2); line += year; @@ -2735,7 +2735,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(gps_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -2928,7 +2928,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIA")) + if (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIA") { // Block II/IIA (Table 20-XI IS-GPS-200E ) if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; @@ -2939,10 +2939,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_IODC == 757) curve_fit_interval = 98; } - if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR-M") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIF") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIIA") == 0)) + if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIR") || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIR-M") || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIF") || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIIA")) { // Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200E ) if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; @@ -2984,7 +2984,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(gps_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -3141,7 +3141,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(galileo_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(galileo_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -3259,11 +3259,11 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(galileo_ephemeris_iter->second.E1B_DVS_5); + std::string E1B_DVS = std::to_string(galileo_ephemeris_iter->second.E1B_DVS_5); if (E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee"; E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID - std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + std::string SVhealth_str = E5B_HS + std::to_string(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + std::to_string(galileo_ephemeris_iter->second.E1B_DVS_5); SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID int32_t SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); @@ -3310,7 +3310,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(glonass_gnav_ephemeris_iter->second.i_satellite_PRN), 2); + line += Rinex_Printer::rightJustify(std::to_string(glonass_gnav_ephemeris_iter->second.i_satellite_PRN), 2); line += std::string(1, ' '); std::string year(timestring, 2, 2); line += year; @@ -3383,7 +3383,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(glonass_gnav_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(glonass_gnav_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -3809,12 +3809,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(std::to_string(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Frequency Number line += std::string(1, ' '); line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); @@ -4162,12 +4162,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(std::to_string(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Frequency Number line += std::string(1, ' '); line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); @@ -4480,12 +4480,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(std::to_string(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Frequency Number line += std::string(1, ' '); line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); @@ -6874,7 +6874,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) // TIME OF FIRST OBS last header annotation might change in the future { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line_aux += std::string(54, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -6895,10 +6895,10 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -6954,10 +6954,10 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -7013,10 +7013,10 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLS_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_LSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.DN_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLS_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_LSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.DN_6), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -7120,14 +7120,14 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); observables_iter++) { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -7224,7 +7224,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -7241,7 +7241,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -7396,15 +7396,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_ == "R") && (sig_ == "1G")) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_ == "R") && (sig_ == "2G")) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7442,7 +7442,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int32_t numGloSatellitesObserved = available_glo_prns.size(); int32_t numGpsSatellitesObserved = observablesG1C.size(); int32_t numSatellitesObserved = numGloSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); if (version == 2) { // Add list of GPS satellites @@ -7452,7 +7452,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { line += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L1 satellites for (observables_iter = observablesR1C.cbegin(); @@ -7461,7 +7461,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L2 satellites for (observables_iter = observablesR2C.cbegin(); @@ -7470,7 +7470,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } } line += std::string(80 - line.size(), ' '); @@ -7490,10 +7490,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep if (version == 3) { // Specify system only if in version 3 - if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s == "G") lineObs += satelliteSystem["GPS"]; + if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); } // Pseudorange Measurements @@ -7555,7 +7555,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += satelliteSystem["GLONASS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); } ret = total_glo_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) @@ -7670,15 +7670,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_ == "R") && (sig_ == "1G")) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_ == "R") && (sig_ == "2G")) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7716,7 +7716,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g int32_t numGloSatellitesObserved = available_glo_prns.size(); int32_t numGpsSatellitesObserved = observablesG2S.size(); int32_t numSatellitesObserved = numGloSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -7733,10 +7733,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g s.assign(1, observables_iter->second.System); // Specify system only if in version 3 - if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s == "G") lineObs += satelliteSystem["GPS"]; + if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); // Pseudorange Measurements lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -7795,7 +7795,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_glo_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) @@ -7910,15 +7910,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_ == "R") && (sig_ == "1G")) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_ == "R") && (sig_ == "2G")) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7955,7 +7955,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga int32_t numGloSatellitesObserved = available_glo_prns.size(); int32_t numGalSatellitesObserved = observablesE1B.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGloSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -7973,10 +7973,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs.clear(); s.assign(1, observables_iter->second.System); - if (s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; - if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s == "E") lineObs += satelliteSystem["Galileo"]; + if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) @@ -8033,7 +8033,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_glo_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -8153,14 +8153,14 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); observables_iter++) { line += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -8258,7 +8258,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -8275,7 +8275,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -8379,7 +8379,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -8396,7 +8396,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); //GPS L2 PSEUDORANGE lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -8510,12 +8510,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); mmap_iter = total_mmap.find(observables_iter->second.PRN); @@ -8527,7 +8527,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + if ((system_ == "G") && (sig_ == "L5")) { observablesL5.insert(std::pair(observables_iter->first, observables_iter->second)); mmap_iter = total_mmap.find(observables_iter->second.PRN); @@ -8598,7 +8598,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c } int32_t numSatellitesObserved = available_prns.size(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); @@ -8614,7 +8614,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_mmap.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -8725,15 +8725,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -8838,7 +8838,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep } } int32_t numSatellitesObserved = available_prns.size(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); @@ -8854,7 +8854,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -8967,19 +8967,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -9030,7 +9030,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int32_t numGalSatellitesObserved = available_gal_prns.size(); int32_t numGpsSatellitesObserved = observablesG1C.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -9048,10 +9048,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); s.assign(1, observables_iter->second.System); - if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if (s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; // should not happen + if (s == "G") lineObs += satelliteSystem["GPS"]; + if (s == "E") lineObs += satelliteSystem["Galileo"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) @@ -9108,7 +9108,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9222,23 +9222,23 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + if ((system_ == "G") && (sig_ == "L5")) { observablesGL5.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -9317,7 +9317,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e int32_t numGalSatellitesObserved = available_gal_prns.size(); int32_t numGpsSatellitesObserved = available_gps_prns.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -9337,7 +9337,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gps_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9396,7 +9396,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9514,27 +9514,27 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + if ((system_ == "G") && (sig_ == "L5")) { observablesGL5.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -9626,7 +9626,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int32_t numGalSatellitesObserved = available_gal_prns.size(); int32_t numGpsSatellitesObserved = available_gps_prns.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -9646,7 +9646,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gps_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9705,7 +9705,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 400132e0c..40934e833 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -77,7 +77,7 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool { rtcm_base_path = p.string(); } - if (rtcm_base_path.compare(".") != 0) + if (rtcm_base_path != ".") { std::cout << "RTCM binary file will be stored at " << rtcm_base_path << std::endl; } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index fb62643c4..76b8d7ada 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -473,11 +473,11 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ case 'G': { std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { band1 = true; } - if (sig_.compare("2S") == 0) + if (sig_ == "2S") { band2 = true; } @@ -500,7 +500,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ { std::string sig_(gnss_observables_iter->second.Signal); // Galileo E1 - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -523,7 +523,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } // Galileo E5 - if (sig_.compare("5X") == 0) + if (sig_ == "5X") { // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -571,7 +571,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ // GPS L1 // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_ephemeris_iter != gps_ephemeris_map.cend()) @@ -592,7 +592,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } // GPS L2 (todo: solve NAV/CNAV clash) - if ((sig_.compare("2S") == 0) and (gps_dual_band == false)) + if ((sig_ == "2S") and (gps_dual_band == false)) { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) @@ -641,7 +641,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } // GPS L5 - if (sig_.compare("L5") == 0) + if (sig_ == "L5") { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) @@ -693,7 +693,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ { std::string sig_(gnss_observables_iter->second.Signal); // GLONASS GNAV L1 - if (sig_.compare("1G") == 0) + if (sig_ == "1G") { // 1 Glo - find the ephemeris for the current GLONASS SV observation. The SV Slot Number (PRN ID) is the map key glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -715,7 +715,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } // GLONASS GNAV L2 - if (sig_.compare("2G") == 0) + if (sig_ == "2G") { // 1 GLONASS - find the ephemeris for the current GLONASS SV observation. The SV PRN ID is the map key glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); From 2614509b29c9257b876e7d97a70b97f5c3f3c239 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 15:52:32 +0100 Subject: [PATCH 42/52] Fix string comparisons, improve const correctness --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 56 +++++++++--------- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 58 ++++++++++--------- src/core/libs/string_converter.cc | 10 ++-- 3 files changed, 66 insertions(+), 58 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index e6b2d09cb..5bc2b473f 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -80,27 +80,27 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, // RINEX version pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3); - if (FLAGS_RINEX_version.compare("3.01") == 0) + if (FLAGS_RINEX_version == "3.01") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version.compare("3.02") == 0) + else if (FLAGS_RINEX_version == "3.02") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version.compare("3") == 0) + else if (FLAGS_RINEX_version == "3") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version.compare("2.11") == 0) + else if (FLAGS_RINEX_version == "2.11") { pvt_output_parameters.rinex_version = 2; } - else if (FLAGS_RINEX_version.compare("2.10") == 0) + else if (FLAGS_RINEX_version == "2.10") { pvt_output_parameters.rinex_version = 2; } - else if (FLAGS_RINEX_version.compare("2") == 0) + else if (FLAGS_RINEX_version == "2") { pvt_output_parameters.rinex_version = 2; } @@ -220,11 +220,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int positioning_mode = -1; std::string default_pos_mode("Single"); std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h - if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; - if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; - if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; - if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; - if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; + if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE; + if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC; + if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA; + if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC; + if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA; if (positioning_mode == -1) { @@ -269,12 +269,12 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_iono_model("OFF"); std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ int iono_model = -1; - if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; - if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; - if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; - if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; - if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; - if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; + if (iono_model_str == "OFF") iono_model = IONOOPT_OFF; + if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC; + if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS; + if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC; + if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST; + if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC; if (iono_model == -1) { //warn user and set the default @@ -288,11 +288,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_trop_model("OFF"); int trop_model = -1; std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF; - if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; - if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; - if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; - if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; + if (trop_model_str == "OFF") trop_model = TROPOPT_OFF; + if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS; + if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS; + if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST; + if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG; if (trop_model == -1) { //warn user and set the default @@ -337,11 +337,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_gps_ar("Continuous"); std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ int integer_ambiguity_resolution_gps = -1; - if (integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF; - if (integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT; - if (integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST; - if (integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; - if (integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR; + if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF; + if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT; + if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST; + if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; + if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR; if (integer_ambiguity_resolution_gps == -1) { //warn user and set the default @@ -371,7 +371,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, double min_ratio_to_fix_ambiguity = configuration->property(role + ".min_ratio_to_fix_ambiguity", 3.0); /* Set the integer ambiguity validation threshold for ratio‐test, which uses the ratio of squared residuals of the best integer vector to the second‐best vector. */ - int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity. + int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity.FLAGS_RINEX_version. If the lock count is less than the value, the ambiguity is excluded from the fixed integer vector. */ double min_elevation_to_fix_ambiguity = configuration->property(role + ".min_elevation_to_fix_ambiguity", 0.0); /* Set the minimum elevation (deg) to fix integer ambiguity. diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 96ed65700..b3e3b2b51 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -492,7 +492,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, { xml_base_path = p.string(); } - if (xml_base_path.compare(".") != 0) + if (xml_base_path != ".") { std::cout << "XML files will be stored at " << xml_base_path << std::endl; } @@ -959,7 +959,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator tmp_eph_iter_gal = d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); std::map::const_iterator tmp_eph_iter_cnav = d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); std::map::const_iterator tmp_eph_iter_glo_gnav = d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); - if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1C") == 0)) or ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("2S") == 0)) or ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1B") == 0)) or ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("5X") == 0)) or ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1G") == 0)) or ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("2G") == 0)) or ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("L5") == 0))) + if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1C")) or + ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "2S")) or + ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1B")) or + ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "5X")) or + ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1G")) or + ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "2G")) or + ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "L5"))) { // store valid observables in a map. gnss_observables_map.insert(std::pair(i, in[i][epoch])); @@ -1893,7 +1899,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1905,7 +1911,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2013,7 +2019,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2025,7 +2031,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2073,7 +2079,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2085,7 +2091,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2132,7 +2138,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2144,7 +2150,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2191,7 +2197,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2203,7 +2209,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2250,7 +2256,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2262,7 +2268,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) @@ -2395,7 +2401,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2407,7 +2413,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2513,7 +2519,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2525,7 +2531,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2573,7 +2579,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2585,7 +2591,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2633,7 +2639,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2645,7 +2651,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2694,7 +2700,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2706,7 +2712,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2754,7 +2760,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2766,7 +2772,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) diff --git a/src/core/libs/string_converter.cc b/src/core/libs/string_converter.cc index 8675c586c..7420aad64 100644 --- a/src/core/libs/string_converter.cc +++ b/src/core/libs/string_converter.cc @@ -34,17 +34,19 @@ #include -StringConverter::StringConverter() {} +StringConverter::StringConverter() = default; + + +StringConverter::~StringConverter() = default; -StringConverter::~StringConverter() {} bool StringConverter::convert(const std::string& value, bool default_value) { - if (value.compare("true") == 0) + if (value == "true") { return true; } - else if (value.compare("false") == 0) + else if (value == "false") { return false; } From 0a51eabdab21b7428d30abef6367cb44eb724bc2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 22:53:05 +0100 Subject: [PATCH 43/52] Improve string comparisons --- src/core/receiver/gnss_flowgraph.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index f290975ff..bb27826bb 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -204,7 +204,7 @@ void GNSSFlowgraph::connect() { //TODO: Remove this array implementation and create generic multistream connector //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) - if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source") { //Multichannel Array std::cout << "ARRAY MODE" << std::endl; @@ -566,7 +566,7 @@ void GNSSFlowgraph::disconnect() { // TODO: Remove this array implementation and create generic multistream connector // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) - if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source") { //Multichannel Array for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) @@ -1334,8 +1334,8 @@ void GNSSFlowgraph::init() // Mark old implementations as deprecated std::string default_str("Default"); std::string obs_implementation = configuration_->property("Observables.implementation", default_str); - if ((obs_implementation.compare("GPS_L1_CA_Observables") == 0) || (obs_implementation.compare("GPS_L2C_Observables") == 0) || - (obs_implementation.compare("Galileo_E1B_Observables") == 0) || (obs_implementation.compare("Galileo_E5A_Observables") == 0)) + if ((obs_implementation == "GPS_L1_CA_Observables") || (obs_implementation == "GPS_L2C_Observables") || + (obs_implementation == "Galileo_E1B_Observables") || (obs_implementation == "Galileo_E5A_Observables")) { std::cout << "WARNING: Implementation '" << obs_implementation << "' of the Observables block has been replaced by 'Hybrid_Observables'." << std::endl; std::cout << "Please update your configuration file." << std::endl; @@ -1344,7 +1344,7 @@ void GNSSFlowgraph::init() pvt_ = block_factory_->GetPVT(configuration_); // Mark old implementations as deprecated std::string pvt_implementation = configuration_->property("PVT.implementation", default_str); - if ((pvt_implementation.compare("GPS_L1_CA_PVT") == 0) || (pvt_implementation.compare("Galileo_E1_PVT") == 0) || (pvt_implementation.compare("Hybrid_PVT") == 0)) + if ((pvt_implementation == "GPS_L1_CA_PVT") || (pvt_implementation == "Galileo_E1_PVT") || (pvt_implementation == "Hybrid_PVT")) { std::cout << "WARNING: Implementation '" << pvt_implementation << "' of the PVT block has been replaced by 'RTKLIB_PVT'." << std::endl; std::cout << "Please update your configuration file." << std::endl; @@ -1630,7 +1630,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("1C") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1C")) untracked_satellite = false; } if (untracked_satellite and configuration_->property("Channels_2S.count", 0) > 0) { @@ -1661,7 +1661,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("2S") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2S")) untracked_satellite = false; } if (untracked_satellite and configuration_->property("Channels_1C.count", 0) > 0) { @@ -1692,7 +1692,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("L5") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "L5")) untracked_satellite = false; } if (untracked_satellite and configuration_->property("Channels_1C.count", 0) > 0) { @@ -1723,7 +1723,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("1B") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1B")) untracked_satellite = false; } if (untracked_satellite) { @@ -1748,7 +1748,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("5X") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "5X")) untracked_satellite = false; } if (untracked_satellite) { @@ -1773,7 +1773,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("1G") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1G")) untracked_satellite = false; } if (untracked_satellite) { @@ -1798,7 +1798,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("2G") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2G")) untracked_satellite = false; } if (untracked_satellite) { From da069c5968f5a66613142b27bb74b4bd03fb0da1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 2 Dec 2018 23:54:27 +0100 Subject: [PATCH 44/52] Change string comparison style --- src/core/receiver/gnss_block_factory.cc | 326 ++++++++++++------------ 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 9f8b320c9..55218ee8d 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -228,7 +228,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( std::string data_type_adapter; std::string input_filter; std::string resampler; - if (signal_conditioner.compare("Pass_Through") == 0) + if (signal_conditioner == "Pass_Through") { data_type_adapter = "Pass_Through"; input_filter = "Pass_Through"; @@ -246,7 +246,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( << input_filter << ", and Resampler implementation: " << resampler; - if (signal_conditioner.compare("Array_Signal_Conditioner") == 0) + if (signal_conditioner == "Array_Signal_Conditioner") { //instantiate the array version std::unique_ptr conditioner_(new ArraySignalConditioner(configuration.get(), @@ -321,7 +321,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::string aux = configuration->property("Acquisition_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -331,7 +331,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( } aux = configuration->property("Tracking_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -341,7 +341,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( } aux = configuration->property("TelemetryDecoder_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -355,7 +355,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1C" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1C" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -386,7 +386,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -396,7 +396,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( } aux = configuration->property("Tracking_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -406,7 +406,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( } aux = configuration->property("TelemetryDecoder_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -420,7 +420,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2S" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2S" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -454,7 +454,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -464,7 +464,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( } aux = configuration->property("Tracking_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -474,7 +474,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( } aux = configuration->property("TelemetryDecoder_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -488,7 +488,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1B" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1B" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -522,7 +522,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -532,7 +532,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( } aux = configuration->property("Tracking_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -542,7 +542,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( } aux = configuration->property("TelemetryDecoder_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -556,7 +556,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_5X" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_5X" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -591,7 +591,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::string aux = configuration->property("Acquisition_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -601,7 +601,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } aux = configuration->property("Tracking_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -611,7 +611,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } aux = configuration->property("TelemetryDecoder_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -625,7 +625,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1G" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -660,7 +660,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::string aux = configuration->property("Acquisition_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -670,7 +670,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } aux = configuration->property("Tracking_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -680,7 +680,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } aux = configuration->property("TelemetryDecoder_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -694,7 +694,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2G" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -728,7 +728,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -738,7 +738,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( } aux = configuration->property("Tracking_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -748,7 +748,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( } aux = configuration->property("TelemetryDecoder_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -762,7 +762,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_L5" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_L5" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type) != 0) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -1045,14 +1045,14 @@ std::unique_ptr GNSSBlockFactory::GetBlock( std::unique_ptr block; //PASS THROUGH ---------------------------------------------------------------- - if (implementation.compare("Pass_Through") == 0) + if (implementation == "Pass_Through") { std::unique_ptr block_(new Pass_Through(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // SIGNAL SOURCES ------------------------------------------------------------- - else if (implementation.compare("File_Signal_Source") == 0) + else if (implementation == "File_Signal_Source") { try { @@ -1068,7 +1068,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #if RAW_UDP - else if (implementation.compare("Custom_UDP_Signal_Source") == 0) + else if (implementation == "Custom_UDP_Signal_Source") { try { @@ -1084,7 +1084,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #endif - else if (implementation.compare("Nsr_File_Signal_Source") == 0) + else if (implementation == "Nsr_File_Signal_Source") { try { @@ -1099,7 +1099,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #if MODERN_GNURADIO - else if (implementation.compare("Two_Bit_Cpx_File_Signal_Source") == 0) + else if (implementation == "Two_Bit_Cpx_File_Signal_Source") { try { @@ -1113,7 +1113,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("Two_Bit_Packed_File_Signal_Source") == 0) + else if (implementation == "Two_Bit_Packed_File_Signal_Source") { try { @@ -1128,7 +1128,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #endif - else if (implementation.compare("Spir_File_Signal_Source") == 0) + else if (implementation == "Spir_File_Signal_Source") { try { @@ -1142,7 +1142,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("Spir_GSS6450_File_Signal_Source") == 0) + else if (implementation == "Spir_GSS6450_File_Signal_Source") { try { @@ -1156,7 +1156,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("RtlTcp_Signal_Source") == 0) + else if (implementation == "RtlTcp_Signal_Source") { try { @@ -1170,7 +1170,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("Labsat_Signal_Source") == 0) + else if (implementation == "Labsat_Signal_Source") { try { @@ -1186,7 +1186,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #if UHD_DRIVER - else if (implementation.compare("UHD_Signal_Source") == 0) + else if (implementation == "UHD_Signal_Source") { std::unique_ptr block_(new UhdSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1194,7 +1194,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif #if GN3S_DRIVER - else if (implementation.compare("GN3S_Signal_Source") == 0) + else if (implementation == "GN3S_Signal_Source") { std::unique_ptr block_(new Gn3sSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1203,7 +1203,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if RAW_ARRAY_DRIVER - else if (implementation.compare("Raw_Array_Signal_Source") == 0) + else if (implementation == "Raw_Array_Signal_Source") { std::unique_ptr block_(new RawArraySignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1212,7 +1212,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if OSMOSDR_DRIVER - else if (implementation.compare("Osmosdr_Signal_Source") == 0) + else if (implementation == "Osmosdr_Signal_Source") { std::unique_ptr block_(new OsmosdrSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1221,7 +1221,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if PLUTOSDR_DRIVER - else if (implementation.compare("Plutosdr_Signal_Source") == 0) + else if (implementation == "Plutosdr_Signal_Source") { std::unique_ptr block_(new PlutosdrSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1230,7 +1230,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if FMCOMMS2_DRIVER - else if (implementation.compare("Fmcomms2_Signal_Source") == 0) + else if (implementation == "Fmcomms2_Signal_Source") { std::unique_ptr block_(new Fmcomms2SignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1239,7 +1239,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if AD9361_DRIVER - else if (implementation.compare("Ad9361_Fpga_Signal_Source") == 0) + else if (implementation == "Ad9361_Fpga_Signal_Source") { std::unique_ptr block_(new Ad9361FpgaSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1248,7 +1248,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if FLEXIBAND_DRIVER - else if (implementation.compare("Flexiband_Signal_Source") == 0) + else if (implementation == "Flexiband_Signal_Source") { std::unique_ptr block_(new FlexibandSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1257,37 +1257,37 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif // DATA TYPE ADAPTER ----------------------------------------------------------- - else if (implementation.compare("Byte_To_Short") == 0) + else if (implementation == "Byte_To_Short") { std::unique_ptr block_(new ByteToShort(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ibyte_To_Cbyte") == 0) + else if (implementation == "Ibyte_To_Cbyte") { std::unique_ptr block_(new IbyteToCbyte(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ibyte_To_Cshort") == 0) + else if (implementation == "Ibyte_To_Cshort") { std::unique_ptr block_(new IbyteToCshort(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ibyte_To_Complex") == 0) + else if (implementation == "Ibyte_To_Complex") { std::unique_ptr block_(new IbyteToComplex(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ishort_To_Cshort") == 0) + else if (implementation == "Ishort_To_Cshort") { std::unique_ptr block_(new IshortToCshort(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ishort_To_Complex") == 0) + else if (implementation == "Ishort_To_Complex") { std::unique_ptr block_(new IshortToComplex(configuration.get(), role, in_streams, out_streams)); @@ -1295,37 +1295,37 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // INPUT FILTER ---------------------------------------------------------------- - else if (implementation.compare("Fir_Filter") == 0) + else if (implementation == "Fir_Filter") { std::unique_ptr block_(new FirFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Freq_Xlating_Fir_Filter") == 0) + else if (implementation == "Freq_Xlating_Fir_Filter") { std::unique_ptr block_(new FreqXlatingFirFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Beamformer_Filter") == 0) + else if (implementation == "Beamformer_Filter") { std::unique_ptr block_(new BeamformerFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Pulse_Blanking_Filter") == 0) + else if (implementation == "Pulse_Blanking_Filter") { std::unique_ptr block_(new PulseBlankingFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Notch_Filter") == 0) + else if (implementation == "Notch_Filter") { std::unique_ptr block_(new NotchFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Notch_Filter_Lite") == 0) + else if (implementation == "Notch_Filter_Lite") { std::unique_ptr block_(new NotchFilterLite(configuration.get(), role, in_streams, out_streams)); @@ -1333,14 +1333,14 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // RESAMPLER ------------------------------------------------------------------- - else if (implementation.compare("Direct_Resampler") == 0) + else if (implementation == "Direct_Resampler") { std::unique_ptr block_(new DirectResamplerConditioner(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if ((implementation.compare("Fractional_Resampler") == 0) || (implementation.compare("Mmse_Resampler") == 0)) + else if ((implementation == "Fractional_Resampler") || (implementation == "Mmse_Resampler")) { std::unique_ptr block_(new MmseResamplerConditioner(configuration.get(), role, in_streams, out_streams)); @@ -1348,7 +1348,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // ACQUISITION BLOCKS --------------------------------------------------------- - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1356,20 +1356,20 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Assisted_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_Tong_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1377,7 +1377,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #if OPENCL_BLOCKS - else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1385,171 +1385,171 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_QuickSync_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsQuickSyncAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition") { std::unique_ptr block_(new GpsL2MPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL2MPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition") { std::unique_ptr block_(new GpsL5iPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L5i_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL5iPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") == 0) + else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") { std::unique_ptr block_(new GalileoE5aNoncoherentIQAcquisitionCaf(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition") { std::unique_ptr block_(new GalileoE5aPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE5aPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL2CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // TRACKING BLOCKS ------------------------------------------------------------- - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_KF_Tracking") == 0) + else if (implementation == "GPS_L1_CA_KF_Tracking") { std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "GPS_L1_CA_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL2MDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking") or (implementation == "GPS_L5_DLL_PLL_Tracking")) { std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking_Fpga") or (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")) { std::unique_ptr block_(new GpsL5DllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); @@ -1557,123 +1557,123 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif #if CUDA_GPU_ACCEL - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_GPU") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_GPU") { std::unique_ptr block_(new GpsL1CaDllPllTrackingGPU(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { std::unique_ptr block_(new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") { std::unique_ptr block_(new GalileoE1DllPllVemlTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "Galileo_E1_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { std::unique_ptr block_(new GalileoE5aDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GalileoE5aDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // TELEMETRY DECODERS ---------------------------------------------------------- - else if (implementation.compare("GPS_L1_CA_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2C_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L2C_Telemetry_Decoder") { std::unique_ptr block_(new GpsL2CTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L5_Telemetry_Decoder") { std::unique_ptr block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1B_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E1B_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("SBAS_L1_Telemetry_Decoder") == 0) + else if (implementation == "SBAS_L1_Telemetry_Decoder") { std::unique_ptr block_(new SbasL1TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E5a_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE5aTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L2_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL2CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // OBSERVABLES ----------------------------------------------------------------- - else if ((implementation.compare("Hybrid_Observables") == 0) || (implementation.compare("GPS_L1_CA_Observables") == 0) || (implementation.compare("GPS_L2C_Observables") == 0) || - (implementation.compare("Galileo_E5A_Observables") == 0)) + else if ((implementation == "Hybrid_Observables") || (implementation == "GPS_L1_CA_Observables") || (implementation == "GPS_L2C_Observables") || + (implementation == "Galileo_E5A_Observables")) { std::unique_ptr block_(new HybridObservables(configuration.get(), role, in_streams, out_streams)); @@ -1681,7 +1681,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // PVT ------------------------------------------------------------------------- - else if ((implementation.compare("RTKLIB_PVT") == 0) || (implementation.compare("GPS_L1_CA_PVT") == 0) || (implementation.compare("Galileo_E1_PVT") == 0) || (implementation.compare("Hybrid_PVT") == 0)) + else if ((implementation == "RTKLIB_PVT") || (implementation == "GPS_L1_CA_PVT") || (implementation == "Galileo_E1_PVT") || (implementation == "Hybrid_PVT")) { std::unique_ptr block_(new RtklibPvt(configuration.get(), role, in_streams, out_streams)); @@ -1712,27 +1712,27 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( { std::unique_ptr block; // ACQUISITION BLOCKS --------------------------------------------------------- - if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) + if (implementation == "GPS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Assisted_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_Tong_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1740,7 +1740,7 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( } #if OPENCL_BLOCKS - else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1748,112 +1748,112 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_QuickSync_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsQuickSyncAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition") { std::unique_ptr block_(new GpsL2MPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL2MPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition") { std::unique_ptr block_(new GpsL5iPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L5i_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL5iPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") == 0) + else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") { std::unique_ptr block_(new GalileoE5aNoncoherentIQAcquisitionCaf(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition") { std::unique_ptr block_(new GalileoE5aPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE5aPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL2CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1877,94 +1877,94 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( std::unique_ptr block; // TRACKING BLOCKS ------------------------------------------------------------- - if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_KF_Tracking") == 0) + else if (implementation == "GPS_L1_CA_KF_Tracking") { std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "GPS_L1_CA_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { std::unique_ptr block_(new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") { std::unique_ptr block_(new GalileoE1DllPllVemlTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "Galileo_E1_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { std::unique_ptr block_(new GalileoE5aDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GalileoE5aDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL2MDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking") or (implementation == "GPS_L5_DLL_PLL_Tracking")) { std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking_Fpga") or (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")) { std::unique_ptr block_(new GpsL5DllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); @@ -1972,32 +1972,32 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( } #endif #if CUDA_GPU_ACCEL - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_GPU") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_GPU") { std::unique_ptr block_(new GpsL1CaDllPllTrackingGPU(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); @@ -2021,49 +2021,49 @@ std::unique_ptr GNSSBlockFactory::GetTlmBlock( std::unique_ptr block; // TELEMETRY DECODERS ---------------------------------------------------------- - if (implementation.compare("GPS_L1_CA_Telemetry_Decoder") == 0) + if (implementation == "GPS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1B_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E1B_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("SBAS_L1_Telemetry_Decoder") == 0) + else if (implementation == "SBAS_L1_Telemetry_Decoder") { std::unique_ptr block_(new SbasL1TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E5a_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE5aTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2C_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L2C_Telemetry_Decoder") { std::unique_ptr block_(new GpsL2CTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L2_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL2CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L5_Telemetry_Decoder") { std::unique_ptr block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); From 482558aa2741de1e18adc5eeb60983156bac553b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 00:46:38 +0100 Subject: [PATCH 45/52] Use std::move() to avoid unnecessary copies --- src/algorithms/channel/libs/channel_fsm.cc | 8 ++++---- src/algorithms/channel/libs/channel_msg_receiver_cc.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 14a4e6b12..ad6ed9e3a 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -44,7 +44,7 @@ ChannelFsm::ChannelFsm() } -ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_(acquisition) +ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_(std::move(acquisition)) { trk_ = nullptr; channel_ = 0U; @@ -162,21 +162,21 @@ bool ChannelFsm::Event_failed_tracking_standby() void ChannelFsm::set_acquisition(std::shared_ptr acquisition) { std::lock_guard lk(mx); - acq_ = acquisition; + acq_ = std::move(acquisition); } void ChannelFsm::set_tracking(std::shared_ptr tracking) { std::lock_guard lk(mx); - trk_ = tracking; + trk_ = std::move(tracking); } void ChannelFsm::set_queue(gr::msg_queue::sptr queue) { std::lock_guard lk(mx); - queue_ = queue; + queue_ = std::move(queue); } diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index f77f8c883..d1f967445 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -40,7 +40,7 @@ using google::LogMessage; channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) { - return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat)); + return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(std::move(channel_fsm), repeat)); } @@ -49,7 +49,7 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg) bool result = false; try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); switch (message) { case 1: // positive acquisition @@ -89,9 +89,9 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr cha this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1)); - d_channel_fsm = channel_fsm; + d_channel_fsm = std::move(channel_fsm); d_repeat = repeat; } -channel_msg_receiver_cc::~channel_msg_receiver_cc() {} +channel_msg_receiver_cc::~channel_msg_receiver_cc() = default; From 24d431f74e296c326e1fa795fc71f92bfb5343b0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 01:43:20 +0100 Subject: [PATCH 46/52] Fix warning (missing initializer for struct members --- src/core/receiver/control_thread.cc | 4 ++-- src/core/receiver/tcp_cmd_interface.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index c80c78de5..3ba722e28 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -166,7 +166,7 @@ void ControlThread::init() else { // fill agnss_ref_time_ - struct tm tm = {}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) { agnss_ref_time_.d_tv_sec = timegm(&tm); @@ -876,7 +876,7 @@ std::vector> ControlThread::get_visible_sats(time std::vector visible_gps; std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); - struct tm tstruct = {}; + struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; char buf[80]; tstruct = *gmtime(&rx_utc_time); strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 220d4effb..012d7abb7 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -142,7 +142,7 @@ std::string TcpCmdInterface::status(const std::vector &commandLine &course_over_ground_deg, &UTC_time) == true) { - struct tm tstruct = {}; + struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; char buf1[80]; tstruct = *gmtime(&UTC_time); strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct); @@ -173,7 +173,7 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin if (commandLine.size() > 5) { // Read commandline time parameter - struct tm tm = {}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { response = "ERROR: time parameter malformed\n"; @@ -219,7 +219,7 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi { std::string tmp_str; // Read commandline time parameter - struct tm tm = {}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; tmp_str = commandLine.at(1) + commandLine.at(2); if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { From d4e12648b092ebccf962e1d57d59e82708e99381 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 02:10:14 +0100 Subject: [PATCH 47/52] Fix warning (missing initializer for struct members) --- src/algorithms/PVT/libs/nmea_printer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index b1e7079f3..604991af1 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -1,5 +1,5 @@ /*! - * \file kml_printer.cc + * \file nmea_printer.cc * \brief Implementation of a NMEA 2.1 printer for GNSS-SDR * This class provides a implementation of a subset of the NMEA-0183 standard for interfacing * marine electronic devices as defined by the National Marine Electronics Association (NMEA). @@ -132,7 +132,9 @@ int Nmea_Printer::init_serial(const std::string& serial_device) * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) */ int fd = 0; - struct termios options = {}; + struct termios options + { + }; int64_t BAUD; int64_t DATABITS; int64_t STOPBITS; From 0a46cb1fe1eff76d860f68ea78f46e3ba7ff6035 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 10:05:47 +0100 Subject: [PATCH 48/52] Use nullptr --- src/algorithms/PVT/libs/rinex_printer.h | 6 +- src/algorithms/PVT/libs/rtklib_solver.cc | 4 +- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 26 +++---- .../galileo_pcps_8ms_acquisition_cc.cc | 4 +- .../gnuradio_blocks/pcps_acquisition.cc | 8 +-- .../pcps_acquisition_fine_doppler_cc.cc | 10 +-- .../pcps_assisted_acquisition_cc.cc | 6 +- .../pcps_cccwsr_acquisition_cc.cc | 4 +- .../pcps_quicksync_acquisition_cc.cc | 10 +-- .../pcps_tong_acquisition_cc.cc | 6 +- .../libs/rtklib/rtklib_conversions.cc | 6 +- .../libs/rtklib/rtklib_ephemeris.cc | 16 ++--- src/algorithms/libs/rtklib/rtklib_ionex.cc | 18 ++--- src/algorithms/libs/rtklib/rtklib_pntpos.cc | 4 +- src/algorithms/libs/rtklib/rtklib_ppp.cc | 14 ++-- src/algorithms/libs/rtklib/rtklib_preceph.cc | 12 ++-- src/algorithms/libs/rtklib/rtklib_rtcm.cc | 14 ++-- src/algorithms/libs/rtklib/rtklib_rtcm3.cc | 6 +- src/algorithms/libs/rtklib/rtklib_rtkcmn.cc | 72 +++++++++---------- src/algorithms/libs/rtklib/rtklib_rtkpos.cc | 30 ++++---- src/algorithms/libs/rtklib/rtklib_rtksvr.cc | 30 ++++---- src/algorithms/libs/rtklib/rtklib_sbas.cc | 6 +- src/algorithms/libs/rtklib/rtklib_solution.cc | 28 ++++---- src/algorithms/libs/rtklib/rtklib_stream.cc | 72 +++++++++---------- .../gnuradio_blocks/hybrid_observables_cc.cc | 4 +- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 4 +- .../galileo_e1_tcp_connector_tracking_cc.cc | 2 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 6 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 6 +- .../glonass_l1_ca_dll_pll_tracking_cc.cc | 6 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 6 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 6 +- .../glonass_l2_ca_dll_pll_tracking_cc.cc | 6 +- .../gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 6 +- .../gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 6 +- .../gps_l1_ca_kf_tracking_cc.cc | 6 +- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 2 +- src/core/receiver/control_thread.cc | 4 +- src/core/receiver/tcp_cmd_interface.cc | 6 +- src/core/system_parameters/rtcm.cc | 16 ++--- src/tests/common-files/gnuplot_i.h | 10 +-- src/tests/unit-tests/arithmetic/matio_test.cc | 22 +++--- .../libs/acquisition_dump_reader.cc | 6 +- 43 files changed, 271 insertions(+), 271 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index dde6724a6..1f33176ff 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -547,7 +547,7 @@ private: */ inline double asDouble(const std::string& s) { - return strtod(s.c_str(), 0); + return strtod(s.c_str(), nullptr); } @@ -560,7 +560,7 @@ private: */ inline int64_t asInt(const std::string& s) { - return strtol(s.c_str(), 0, 10); + return strtol(s.c_str(), nullptr, 10); } @@ -796,7 +796,7 @@ inline std::string Rinex_Printer::asFixWidthString(const int x, const int width, inline int64_t asInt(const std::string& s) { - return strtol(s.c_str(), 0, 10); + return strtol(s.c_str(), nullptr, 10); } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 76b8d7ada..d7eb452ac 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -245,8 +245,8 @@ bool rtklib_solver::save_matfile() std::string filename = dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("TOW_at_current_symbol_ms", MAT_C_UINT32, MAT_T_UINT32, 2, dims, TOW_at_current_symbol_ms, 0); diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index fe7b70878..e87390899 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -117,8 +117,8 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit } else { - d_fft_code_Q_A = 0; - d_magnitudeQA = 0; + d_fft_code_Q_A = nullptr; + d_magnitudeQA = nullptr; } // IF COHERENT INTEGRATION TIME > 1 if (d_sampled_ms > 1) @@ -132,16 +132,16 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit } else { - d_fft_code_Q_B = 0; - d_magnitudeQB = 0; + d_fft_code_Q_B = nullptr; + d_magnitudeQB = nullptr; } } else { - d_fft_code_I_B = 0; - d_magnitudeIB = 0; - d_fft_code_Q_B = 0; - d_magnitudeQB = 0; + d_fft_code_I_B = nullptr; + d_magnitudeIB = nullptr; + d_fft_code_Q_B = nullptr; + d_magnitudeQB = nullptr; } // Direct FFT @@ -157,14 +157,14 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit d_doppler_resolution = 0; d_threshold = 0; d_doppler_step = 250; - d_grid_doppler_wipeoffs = 0; - d_gnss_synchro = 0; + d_grid_doppler_wipeoffs = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; - d_CAF_vector = 0; - d_CAF_vector_I = 0; - d_CAF_vector_Q = 0; + d_CAF_vector = nullptr; + d_CAF_vector_I = nullptr; + d_CAF_vector_Q = nullptr; d_channel = 0; d_gr_stream_buffer = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 318f6ad46..d502c4cb2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -92,8 +92,8 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( d_doppler_resolution = 0; d_threshold = 0; d_doppler_step = 0; - d_grid_doppler_wipeoffs = 0; - d_gnss_synchro = 0; + d_grid_doppler_wipeoffs = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 1bb4b39a7..a7df810a7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -34,8 +34,8 @@ */ #include "pcps_acquisition.h" +#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI #include "GPS_L1_CA.h" // for GPS_TWO_PI -#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" #include "gnss_sdr_create_directory.h" #include #include @@ -120,7 +120,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu // Inverse FFT d_ifft = new gr::fft::fft_complex(d_fft_size, false); - d_gnss_synchro = 0; + d_gnss_synchro = nullptr; d_grid_doppler_wipeoffs = nullptr; d_grid_doppler_wipeoffs_step_two = nullptr; d_magnitude_grid = nullptr; @@ -445,8 +445,8 @@ void pcps_acquisition::dump_results(int32_t effective_fft_size) filename.append(std::to_string(d_gnss_synchro->PRN)); filename.append(".mat"); - mat_t* matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (matfp == NULL) + mat_t* matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (matfp == nullptr) { std::cout << "Unable to create or open Acquisition dump file" << std::endl; //acq_parameters.dump = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 894b6ef20..8b80cb3e3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -123,9 +123,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con d_threshold = 0; d_num_doppler_points = 0; d_doppler_step = 0; - d_grid_data = 0; - d_grid_doppler_wipeoffs = 0; - d_gnss_synchro = 0; + d_grid_data = nullptr; + d_grid_doppler_wipeoffs = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; @@ -672,8 +672,8 @@ void pcps_acquisition_fine_doppler_cc::dump_results(int effective_fft_size) filename.append(std::to_string(d_gnss_synchro->PRN)); filename.append(".mat"); - mat_t *matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (matfp == NULL) + mat_t *matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (matfp == nullptr) { std::cout << "Unable to create or open Acquisition dump file" << std::endl; d_dump = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index 31c28c319..7bf74c2b0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -97,9 +97,9 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( d_doppler_min = 0; d_num_doppler_points = 0; d_doppler_step = 0; - d_grid_data = 0; - d_grid_doppler_wipeoffs = 0; - d_gnss_synchro = 0; + d_grid_data = nullptr; + d_grid_doppler_wipeoffs = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 34228b89b..11aaf81c1 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -103,8 +103,8 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( d_doppler_resolution = 0; d_threshold = 0; d_doppler_step = 0; - d_grid_doppler_wipeoffs = 0; - d_gnss_synchro = 0; + d_grid_doppler_wipeoffs = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 06a91dccb..cc893cb77 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -112,16 +112,16 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( d_dump = dump; d_dump_filename = dump_filename; - d_corr_acumulator = 0; - d_signal_folded = 0; + d_corr_acumulator = nullptr; + d_signal_folded = nullptr; d_code_folded = new gr_complex[d_fft_size](); d_noise_floor_power = 0; d_doppler_resolution = 0; d_threshold = 0; d_doppler_step = 0; - d_grid_doppler_wipeoffs = 0; - d_fft_if2 = 0; - d_gnss_synchro = 0; + d_grid_doppler_wipeoffs = nullptr; + d_fft_if2 = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index 77a714de4..2d789b9a7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -116,9 +116,9 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( d_doppler_resolution = 0; d_threshold = 0; d_doppler_step = 0; - d_grid_data = 0; - d_grid_doppler_wipeoffs = 0; - d_gnss_synchro = 0; + d_grid_data = nullptr; + d_grid_doppler_wipeoffs = nullptr; + d_gnss_synchro = nullptr; d_code_phase = 0; d_doppler_freq = 0; d_test_statistics = 0; diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 4eb8d218f..8fe890fd3 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -152,7 +152,7 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph) /* adjustment for week handover */ double tow, toc; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); - toc = time2gpst(rtklib_sat.toc, NULL); + toc = time2gpst(rtklib_sat.toc, nullptr); if (rtklib_sat.toes < tow - 302400.0) { rtklib_sat.week++; @@ -209,7 +209,7 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph) /* adjustment for week handover */ double tow, toc; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); - toc = time2gpst(rtklib_sat.toc, NULL); + toc = time2gpst(rtklib_sat.toc, nullptr); if (rtklib_sat.toes < tow - 302400.0) { rtklib_sat.week++; @@ -274,7 +274,7 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) /* adjustment for week handover */ double tow, toc; tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); - toc = time2gpst(rtklib_sat.toc, NULL); + toc = time2gpst(rtklib_sat.toc, nullptr); if (rtklib_sat.toes < tow - 302400.0) { rtklib_sat.week++; diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc index eff182fbd..369448817 100644 --- a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc +++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc @@ -129,7 +129,7 @@ void alm2pos(gtime_t time, const alm_t *alm, double *rs, double *dts) rs[0] = rs[1] = rs[2] = *dts = 0.0; return; } - mu = satsys(alm->sat, NULL) == SYS_GAL ? MU_GAL : MU_GPS; + mu = satsys(alm->sat, nullptr) == SYS_GAL ? MU_GAL : MU_GPS; M = alm->M0 + sqrt(mu / (alm->A * alm->A * alm->A)) * tk; for (n = 0, E = M, Ek = 0.0; fabs(E - Ek) > RTOL_KEPLER && n < MAX_ITER_KEPLER; n++) @@ -457,7 +457,7 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav) trace(4, "seleph : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode); - switch (satsys(sat, NULL)) + switch (satsys(sat, nullptr)) { case SYS_QZS: tmax = MAXDTOE_QZS + 1.0; @@ -490,7 +490,7 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav) { trace(3, "no broadcast ephemeris: %s sat=%2d iode=%3d\n", time_str(time, 0), sat, iode); - return NULL; + return nullptr; } return nav->eph + j; } @@ -520,7 +520,7 @@ geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav) { trace(3, "no glonass ephemeris : %s sat=%2d iode=%2d\n", time_str(time, 0), sat, iode); - return NULL; + return nullptr; } return nav->geph + j; } @@ -547,7 +547,7 @@ seph_t *selseph(gtime_t time, int sat, const nav_t *nav) if (j < 0) { trace(3, "no sbas ephemeris : %s sat=%2d\n", time_str(time, 0), sat); - return NULL; + return nullptr; } return nav->seph + j; } @@ -564,7 +564,7 @@ int ephclk(gtime_t time, gtime_t teph, int sat, const nav_t *nav, trace(4, "ephclk : time=%s sat=%2d\n", time_str(time, 3), sat); - sys = satsys(sat, NULL); + sys = satsys(sat, nullptr); if (sys == SYS_GPS || sys == SYS_GAL || sys == SYS_QZS || sys == SYS_BDS) { @@ -600,7 +600,7 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, trace(4, "ephpos : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode); - sys = satsys(sat, NULL); + sys = satsys(sat, nullptr); *svh = -1; @@ -738,7 +738,7 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (!ephpos(time, teph, sat, nav, ssr->iode, rs, dts, var, svh)) return 0; /* satellite clock for gps, galileo and qzss */ - sys = satsys(sat, NULL); + sys = satsys(sat, nullptr); if (sys == SYS_GPS || sys == SYS_GAL || sys == SYS_QZS || sys == SYS_BDS) { if (!(eph = seleph(teph, sat, ssr->iode, nav))) return 0; diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index 7790943fa..ab7747135 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -98,7 +98,7 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, ndata[0] = nitem(lats); ndata[1] = nitem(lons); ndata[2] = nitem(hgts); - if (ndata[0] <= 1 || ndata[1] <= 1 || ndata[2] <= 0) return NULL; + if (ndata[0] <= 1 || ndata[1] <= 1 || ndata[2] <= 0) return nullptr; if (nav->nt >= nav->ntmax) { @@ -107,9 +107,9 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, { trace(1, "readionex malloc error ntmax=%d\n", nav->ntmax); free(nav->tec); - nav->tec = NULL; + nav->tec = nullptr; nav->nt = nav->ntmax = 0; - return NULL; + return nullptr; } nav->tec = nav_tec; } @@ -128,7 +128,7 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, if (!(p->data = (double *)malloc(sizeof(double) * n)) || !(p->rms = (float *)malloc(sizeof(float) * n))) { - return NULL; + return nullptr; } for (i = 0; i < n; i++) { @@ -236,7 +236,7 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts, int readionexb(FILE *fp, const double *lats, const double *lons, const double *hgts, double rb, double nexp, nav_t *nav) { - tec_t *p = NULL; + tec_t *p = nullptr; gtime_t time = {0, 0}; double lat, lon[3], hgt, x; int i, j, k, n, m, index, type = 0; @@ -255,17 +255,17 @@ int readionexb(FILE *fp, const double *lats, const double *lons, else if (strstr(label, "END OF TEC MAP") == label) { type = 0; - p = NULL; + p = nullptr; } else if (strstr(label, "START OF RMS MAP") == label) { type = 2; - p = NULL; + p = nullptr; } else if (strstr(label, "END OF RMS MAP") == label) { type = 0; - p = NULL; + p = nullptr; } else if (strstr(label, "EPOCH OF CURRENT MAP") == label) { @@ -379,7 +379,7 @@ void readtec(const char *file, nav_t *nav, int opt) if (!opt) { free(nav->tec); - nav->tec = NULL; + nav->tec = nullptr; nav->nt = nav->ntmax = 0; } for (i = 0; i < MAXEXFILE; i++) diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index 6473b98a0..d2b4b43da 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -138,7 +138,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, double gamma_ = 0.0; int i = 0; int j = 1; - int sys = satsys(obs->sat, NULL); + int sys = satsys(obs->sat, nullptr); *var = 0.0; if (sys == SYS_NONE) @@ -416,7 +416,7 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, vsat[i] = 0; azel[i * 2] = azel[1 + i * 2] = resp[i] = 0.0; - if (!(sys = satsys(obs[i].sat, NULL))) continue; + if (!(sys = satsys(obs[i].sat, nullptr))) continue; /* reject duplicated observation data */ if (i < n - 1 && i < MAXOBS - 1 && obs[i].sat == obs[i + 1].sat) diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc index 7ac193643..81265a9bc 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.cc +++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc @@ -187,7 +187,7 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu if (azel[1 + 2 * i] < rtk->opt.elmin) continue; - if (satsys(sat, NULL) != SYS_GPS) continue; + if (satsys(sat, nullptr) != SYS_GPS) continue; /* triple-freq carrier and code LC (m) */ LC1 = L_LC(1, -1, 0, obs[i].L) - P_LC(1, 1, 0, obs[i].P); @@ -683,7 +683,7 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs) trace(3, "testeclipse:\n"); /* unit vector of sun direction (ecef) */ - sunmoonpos(gpst2utc(obs[0].time), erpv, rsun, NULL, NULL); + sunmoonpos(gpst2utc(obs[0].time), erpv, rsun, nullptr, nullptr); if (normv3(rsun, esun) == 0) trace(1, "Error computing the norm"); for (i = 0; i < n; i++) @@ -779,7 +779,7 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, trace(4, "ifmeas :\n"); /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */ - if (NFREQ >= 3 && (satsys(obs->sat, NULL) & (SYS_GAL | SYS_SBS))) j = 2; + if (NFREQ >= 3 && (satsys(obs->sat, nullptr) & (SYS_GAL | SYS_SBS))) j = 2; if (NFREQ < 2 || lam[i] == 0.0 || lam[j] == 0.0) return 0; @@ -817,7 +817,7 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, if (opt->sateph == EPHOPT_SBAS) meas[1] -= P1_C1; /* sbas clock based C1 */ /* gps-glonass h/w bias correction for code */ - if (opt->exterr.ena[3] && satsys(obs->sat, NULL) == SYS_GLO) + if (opt->exterr.ena[3] && satsys(obs->sat, nullptr) == SYS_GLO) { meas[1] += c1 * opt->exterr.gpsglob[0] + c2 * opt->exterr.gpsglob[1]; } @@ -913,7 +913,7 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, gamma = std::pow(lam[1] / lam[0], 2.0); /* f1^2/f2^2 */ P1_P2 = nav->cbias[obs->sat - 1][0]; P1_C1 = nav->cbias[obs->sat - 1][1]; - if (P1_P2 == 0.0 && (satsys(obs->sat, NULL) & (SYS_GPS | SYS_GAL | SYS_QZS))) + if (P1_P2 == 0.0 && (satsys(obs->sat, nullptr) & (SYS_GPS | SYS_GAL | SYS_QZS))) { P1_P2 = (1.0 - gamma) * gettgd_ppp(obs->sat, nav); } @@ -1124,7 +1124,7 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) { sat = obs[i].sat; j = IB_PPP(sat, &rtk->opt); - if (!corrmeas(obs + i, nav, pos, rtk->ssat[sat - 1].azel, &rtk->opt, NULL, NULL, + if (!corrmeas(obs + i, nav, pos, rtk->ssat[sat - 1].azel, &rtk->opt, nullptr, nullptr, 0.0, meas, var, &brk)) continue; if (brk) @@ -1273,7 +1273,7 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do for (i = 0; i < n && i < MAXOBS; i++) { sat = obs[i].sat; - if (!(sys = satsys(sat, NULL)) || !rtk->ssat[sat - 1].vs) continue; + if (!(sys = satsys(sat, nullptr)) || !rtk->ssat[sat - 1].vs) continue; /* geometric distance/azimuth/elevation angle */ if ((r = geodist(rs + i * 6, rr, e)) <= 0.0 || diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 293d86543..eff872781 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -134,7 +134,7 @@ int addpeph(nav_t *nav, peph_t *peph) { trace(1, "readsp3b malloc error n=%d\n", nav->nemax); free(nav->peph); - nav->peph = NULL; + nav->peph = nullptr; nav->ne = nav->nemax = 0; return 0; } @@ -361,7 +361,7 @@ void readsp3(const char *file, nav_t *nav, int opt) *-----------------------------------------------------------------------------*/ int readsap(const char *file, gtime_t time, nav_t *nav) { - pcvs_t pcvs = {0, 0, (pcv_t *){0}}; + pcvs_t pcvs = {0, 0, (pcv_t *){nullptr}}; pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}, *pcv; int i; @@ -809,7 +809,7 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, trace(4, "satantoff: time=%s sat=%2d\n", time_str(time, 3), sat); /* sun position in ecef */ - sunmoonpos(gpst2utc(time), erpv, rsun, NULL, &gmst); + sunmoonpos(gpst2utc(time), erpv, rsun, nullptr, &gmst); /* unit vectors of satellite fixed coordinates */ for (i = 0; i < 3; i++) r[i] = -rs[i]; @@ -820,7 +820,7 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, if (!normv3(r, ey)) return; cross3(ey, ez, ex); - if (NFREQ >= 3 && (satsys(sat, NULL) & (SYS_GAL | SYS_SBS))) k = 2; + if (NFREQ >= 3 && (satsys(sat, nullptr) & (SYS_GAL | SYS_SBS))) k = 2; if (NFREQ < 2 || lam[j] == 0.0 || lam[k] == 0.0) return; @@ -871,8 +871,8 @@ int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt, !pephclk(time, sat, nav, dtss, &varc)) return 0; time = timeadd(time, tt); - if (!pephpos(time, sat, nav, rst, dtst, NULL, NULL) || - !pephclk(time, sat, nav, dtst, NULL)) return 0; + if (!pephpos(time, sat, nav, rst, dtst, nullptr, nullptr) || + !pephclk(time, sat, nav, dtst, nullptr)) return 0; /* satellite antenna offset correction */ if (opt) diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm.cc b/src/algorithms/libs/rtklib/rtklib_rtcm.cc index e122ebead..46163873e 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm.cc @@ -88,7 +88,7 @@ int init_rtcm(rtcm_t *rtcm) rtcm->sta.pos[i] = rtcm->sta.del[i] = 0.0; } rtcm->sta.hgt = 0.0; - rtcm->dgps = NULL; + rtcm->dgps = nullptr; for (i = 0; i < MAXSAT; i++) { rtcm->ssr[i] = ssr0; @@ -108,9 +108,9 @@ int init_rtcm(rtcm_t *rtcm) for (i = 0; i < 100; i++) rtcm->nmsg2[i] = 0; for (i = 0; i < 300; i++) rtcm->nmsg3[i] = 0; - rtcm->obs.data = NULL; - rtcm->nav.eph = NULL; - rtcm->nav.geph = NULL; + rtcm->obs.data = nullptr; + rtcm->nav.eph = nullptr; + rtcm->nav.geph = nullptr; /* reallocate memory for observation and ephemris buffer */ if (!(rtcm->obs.data = (obsd_t *)malloc(sizeof(obsd_t) * MAXOBS)) || @@ -141,13 +141,13 @@ void free_rtcm(rtcm_t *rtcm) /* free memory for observation and ephemeris buffer */ free(rtcm->obs.data); - rtcm->obs.data = NULL; + rtcm->obs.data = nullptr; rtcm->obs.n = 0; free(rtcm->nav.eph); - rtcm->nav.eph = NULL; + rtcm->nav.eph = nullptr; rtcm->nav.n = 0; free(rtcm->nav.geph); - rtcm->nav.geph = NULL; + rtcm->nav.geph = nullptr; rtcm->nav.ng = 0; } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc index babc88f5f..7bbec4a14 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc @@ -2643,7 +2643,7 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, const char *sig[32]; double tt, wl; unsigned char code[32]; - char *msm_type = (char *)"", *q = NULL; + char *msm_type = (char *)"", *q = nullptr; int i, j, k, type, prn, sat, fn, index = 0, freq[32], ind[32]; type = getbitu(rtcm->buff, 24, 12); @@ -2966,7 +2966,7 @@ int decode_msm4(rtcm_t *rtcm, int sys) i += 6; } /* save obs data in msm message */ - save_msm_obs(rtcm, sys, &h, r, pr, cp, NULL, NULL, cnr, lock, NULL, half); + save_msm_obs(rtcm, sys, &h, r, pr, cp, nullptr, nullptr, cnr, lock, nullptr, half); rtcm->obsflag = !sync; return sync ? 0 : 1; @@ -3128,7 +3128,7 @@ int decode_msm6(rtcm_t *rtcm, int sys) i += 10; } /* save obs data in msm message */ - save_msm_obs(rtcm, sys, &h, r, pr, cp, NULL, NULL, cnr, lock, NULL, half); + save_msm_obs(rtcm, sys, &h, r, pr, cp, nullptr, nullptr, cnr, lock, nullptr, half); rtcm->obsflag = !sync; return sync ? 0 : 1; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index f7e4e76c5..a55d41b4b 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -111,7 +111,7 @@ const char *formatstrs[32] = {/* stream format strings */ "RINEX CLK", /* 18 */ "SBAS", /* 19 */ "NMEA 0183", /* 20 */ - NULL}; + nullptr}; char obscodes[][3] = { @@ -150,7 +150,7 @@ char codepris[7][MAXFREQ][16] = { }; -fatalfunc_t *fatalfunc = NULL; /* fatal callback function */ +fatalfunc_t *fatalfunc = nullptr; /* fatal callback function */ /* crc tables generated by util/gencrc ---------------------------------------*/ const unsigned short tbl_CRC16[] = { @@ -469,7 +469,7 @@ void satno2id(int sat, char *id) *-----------------------------------------------------------------------------*/ int satexclude(int sat, int svh, const prcopt_t *opt) { - int sys = satsys(sat, NULL); + int sys = satsys(sat, nullptr); if (svh < 0) { @@ -829,7 +829,7 @@ double *mat(int n, int m) { double *p; - if (n <= 0 || m <= 0) return NULL; + if (n <= 0 || m <= 0) return nullptr; if (!(p = (double *)malloc(sizeof(double) * n * m))) { fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m); @@ -847,7 +847,7 @@ int *imat(int n, int m) { int *p; - if (n <= 0 || m <= 0) return NULL; + if (n <= 0 || m <= 0) return nullptr; if (!(p = (int *)malloc(sizeof(int) * n * m))) { fatalerr("integer matrix memory allocation error: n=%d,m=%d\n", n, m); @@ -869,7 +869,7 @@ double *zeros(int n, int m) if ((p = mat(n, m))) for (n = n * m - 1; n >= 0; n--) p[n] = 0.0; #else - if (n <= 0 || m <= 0) return NULL; + if (n <= 0 || m <= 0) return nullptr; if (!(p = (double *)calloc(sizeof(double), n * m))) { fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m); @@ -1474,7 +1474,7 @@ gtime_t timeget(void) struct timeval tv; struct tm *tt; - if (!gettimeofday(&tv, NULL) && (tt = gmtime(&tv.tv_sec))) + if (!gettimeofday(&tv, nullptr) && (tt = gmtime(&tv.tv_sec))) { ep[0] = tt->tm_year + 1900; ep[1] = tt->tm_mon + 1; @@ -1777,7 +1777,7 @@ unsigned int tickget(void) } else { - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); return tv.tv_sec * 1000u + tv.tv_usec / 1000u; } #else @@ -1798,7 +1798,7 @@ void sleepms(int ms) if (ms <= 0) return; ts.tv_sec = (time_t)(ms / 1000); ts.tv_nsec = (long)(ms % 1000 * 1000000); - nanosleep(&ts, NULL); + nanosleep(&ts, nullptr); } @@ -2228,7 +2228,7 @@ int decodef(char *p, int n, double *v) int i; for (i = 0; i < n; i++) v[i] = 0.0; - for (i = 0, p = strtok(p, " "); p && i < n; p = strtok(NULL, " ")) + for (i = 0, p = strtok(p, " "); p && i < n; p = strtok(nullptr, " ")) { v[i++] = atof(p) * 1e-3; } @@ -2248,7 +2248,7 @@ void addpcv(const pcv_t *pcv, pcvs_t *pcvs) { trace(1, "addpcv: memory allocation error\n"); free(pcvs->pcv); - pcvs->pcv = NULL; + pcvs->pcv = nullptr; pcvs->n = pcvs->nmax = 0; return; } @@ -2479,8 +2479,8 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time, { trace(1, "type array is too long"); } - for (p = strtok(buff, " "); p && n < 2; p = strtok(NULL, " ")) types[n++] = p; - if (n <= 0) return NULL; + for (p = strtok(buff, " "); p && n < 2; p = strtok(nullptr, " ")) types[n++] = p; + if (n <= 0) return nullptr; /* search receiver antenna with radome at first */ for (i = 0; i < pcvs->n; i++) @@ -2500,7 +2500,7 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time, return pcv; } } - return NULL; + return nullptr; } @@ -2648,7 +2648,7 @@ int readerp(const char *file, erp_t *erp) if (!erp_data) { free(erp->data); - erp->data = NULL; + erp->data = nullptr; erp->n = erp->nmax = 0; fclose(fp); return 0; @@ -2762,7 +2762,7 @@ void uniqeph(nav_t *nav) { trace(1, "uniqeph malloc error n=%d\n", nav->n); free(nav->eph); - nav->eph = NULL; + nav->eph = nullptr; nav->n = nav->nmax = 0; return; } @@ -2808,7 +2808,7 @@ void uniqgeph(nav_t *nav) { trace(1, "uniqgeph malloc error ng=%d\n", nav->ng); free(nav->geph); - nav->geph = NULL; + nav->geph = nullptr; nav->ng = nav->ngmax = 0; return; } @@ -2853,7 +2853,7 @@ void uniqseph(nav_t *nav) { trace(1, "uniqseph malloc error ns=%d\n", nav->ns); free(nav->seph); - nav->seph = NULL; + nav->seph = nullptr; nav->ns = nav->nsmax = 0; return; } @@ -2948,7 +2948,7 @@ int sortobs(obs_t *obs) *-----------------------------------------------------------------------------*/ int screent(gtime_t time, gtime_t ts, gtime_t te, double tint) { - return (tint <= 0.0 || fmod(time2gpst(time, NULL) + DTTOL, tint) <= DTTOL * 2.0) && + return (tint <= 0.0 || fmod(time2gpst(time, nullptr) + DTTOL, tint) <= DTTOL * 2.0) && (ts.time == 0 || timediff(time, ts) >= -DTTOL) && (te.time == 0 || timediff(time, te) < DTTOL); } @@ -3104,7 +3104,7 @@ int savenav(const char *file, const nav_t *nav) void freeobs(obs_t *obs) { free(obs->data); - obs->data = NULL; + obs->data = nullptr; obs->n = obs->nmax = 0; } @@ -3124,49 +3124,49 @@ void freenav(nav_t *nav, int opt) if (opt & 0x01) { free(nav->eph); - nav->eph = NULL; + nav->eph = nullptr; nav->n = nav->nmax = 0; } if (opt & 0x02) { free(nav->geph); - nav->geph = NULL; + nav->geph = nullptr; nav->ng = nav->ngmax = 0; } if (opt & 0x04) { free(nav->seph); - nav->seph = NULL; + nav->seph = nullptr; nav->ns = nav->nsmax = 0; } if (opt & 0x08) { free(nav->peph); - nav->peph = NULL; + nav->peph = nullptr; nav->ne = nav->nemax = 0; } if (opt & 0x10) { free(nav->pclk); - nav->pclk = NULL; + nav->pclk = nullptr; nav->nc = nav->ncmax = 0; } if (opt & 0x20) { free(nav->alm); - nav->alm = NULL; + nav->alm = nullptr; nav->na = nav->namax = 0; } if (opt & 0x40) { free(nav->tec); - nav->tec = NULL; + nav->tec = nullptr; nav->nt = nav->ntmax = 0; } if (opt & 0x80) { free(nav->fcb); - nav->fcb = NULL; + nav->fcb = nullptr; nav->nf = nav->nfmax = 0; } } @@ -3175,7 +3175,7 @@ void freenav(nav_t *nav, int opt) /* debug trace functions -----------------------------------------------------*/ //#ifdef TRACE // -FILE *fp_trace = NULL; /* file pointer of trace */ +FILE *fp_trace = nullptr; /* file pointer of trace */ char file_trace[1024]; /* trace file */ static int level_trace = 0; /* level of trace */ unsigned int tick_trace = 0; /* tick time at traceopen (ms) */ @@ -3189,8 +3189,8 @@ void traceswap(void) rtk_lock(&lock_trace); - if ((int)(time2gpst(time, NULL) / INT_SWAP_TRAC) == - (int)(time2gpst(time_trace, NULL) / INT_SWAP_TRAC)) + if ((int)(time2gpst(time, nullptr) / INT_SWAP_TRAC) == + (int)(time2gpst(time_trace, nullptr) / INT_SWAP_TRAC)) { rtk_unlock(&lock_trace); return; @@ -3232,7 +3232,7 @@ void traceopen(const char *file) void traceclose(void) { if (fp_trace && fp_trace != stderr) fclose(fp_trace); - fp_trace = NULL; + fp_trace = nullptr; file_trace[0] = '\0'; } @@ -3614,7 +3614,7 @@ double satwavelen(int sat, int frq, const nav_t *nav) { const double freq_glo[] = {FREQ1_GLO, FREQ2_GLO}; const double dfrq_glo[] = {DFRQ1_GLO, DFRQ2_GLO}; - int i, sys = satsys(sat, NULL); + int i, sys = satsys(sat, nullptr); if (sys == SYS_GLO) { @@ -4132,7 +4132,7 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun, tut = timeadd(tutc, erpv[2]); /* utc -> ut1 */ /* sun and moon position in eci */ - sunmoonpos_eci(tut, rsun ? rs : NULL, rmoon ? rm : NULL); + sunmoonpos_eci(tut, rsun ? rs : nullptr, rmoon ? rm : nullptr); /* eci to ecef transformation matrix */ eci2ecef(tutc, erpv, U, &gmst_); @@ -4312,7 +4312,7 @@ int expath(const char *path, char *paths[], int nmax) for (p = s1; *p; p++) *p = (char)tolower((int)*p); for (p = s2; *p; p++) *p = (char)tolower((int)*p); - for (p = s1, q = strtok_r(s2, "*", &r); q; q = strtok_r(NULL, "*", &r)) + for (p = s1, q = strtok_r(s2, "*", &r); q; q = strtok_r(nullptr, "*", &r)) { if ((p = strstr(p, q))) p += strlen(q); @@ -4355,7 +4355,7 @@ void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw) trace(4, "windupcorr: time=%s\n", time_str(time, 0)); /* sun position in ecef */ - sunmoonpos(gpst2utc(time), erpv, rsun, NULL, NULL); + sunmoonpos(gpst2utc(time), erpv, rsun, nullptr, nullptr); /* unit vector satellite to receiver */ for (i = 0; i < 3; i++) r[i] = rr[i] - rs[i]; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index 80c1e0f0c..ef971be0e 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -67,7 +67,7 @@ static int resamb_TCAR(rtk_t *rtk __attribute((unused)), const obsd_t *obs __att /* global variables ----------------------------------------------------------*/ static int statlevel = 0; /* rtk status output level (0:off) */ -static FILE *fp_stat = NULL; /* rtk status file pointer */ +static FILE *fp_stat = nullptr; /* rtk status file pointer */ static char file_stat[1024] = ""; /* rtk status file original path */ static gtime_t time_stat = {0, 0}; /* rtk status file time */ @@ -176,7 +176,7 @@ void rtkclosestat(void) trace(3, "rtkclosestat:\n"); if (fp_stat) fclose(fp_stat); - fp_stat = NULL; + fp_stat = nullptr; file_stat[0] = '\0'; statlevel = 0; } @@ -301,8 +301,8 @@ void swapsolstat(void) gtime_t time = utc2gpst(timeget()); char path[1024]; - if ((int)(time2gpst(time, NULL) / INT_SWAP_STAT) == - (int)(time2gpst(time_stat, NULL) / INT_SWAP_STAT)) + if ((int)(time2gpst(time, nullptr) / INT_SWAP_STAT) == + (int)(time2gpst(time_stat, nullptr) / INT_SWAP_STAT)) { return; } @@ -1130,7 +1130,7 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs, /* troposphere delay model (hydrostatic) */ zhd = tropmodel(obs[0].time, pos, zazel, 0.0); - r += tropmapf(obs[i].time, pos, azel + i * 2, NULL) * zhd; + r += tropmapf(obs[i].time, pos, azel + i * 2, nullptr) * zhd; /* receiver antenna phase center correction */ antmodel(opt->pcvr + index, opt->antdel[index], azel + i * 2, opt->posopt[1], @@ -1308,7 +1308,7 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, { prcopt_t *opt = &rtk->opt; double bl, dr[3], posu[3], posr[3], didxi = 0.0, didxj = 0.0, *im; - double *tropr, *tropu, *dtdxr, *dtdxu, *Ri, *Rj, lami, lamj, fi, fj, df, *Hi = NULL; + double *tropr, *tropu, *dtdxr, *dtdxu, *Ri, *Rj, lami, lamj, fi, fj, df, *Hi = nullptr; int i, j, k, m, f, ff, nv = 0, nb[NFREQ * 4 * 2 + 2] = {0}, b = 0, sysi, sysj, nf = NF_RTK(opt); trace(3, "ddres : dt=%.1f nx=%d ns=%d\n", dt, rtk->nx, ns); @@ -1921,7 +1921,7 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, for (i = 0; i < MAXSAT; i++) { - rtk->ssat[i].sys = satsys(i + 1, NULL); + rtk->ssat[i].sys = satsys(i + 1, nullptr); for (j = 0; j < NFREQ; j++) rtk->ssat[i].vsat[j] = rtk->ssat[i].snr[j] = 0; } /* satellite positions/clocks */ @@ -2009,7 +2009,7 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, if (stat != SOLQ_NONE && zdres(0, obs, nu, rs, dts, svh, nav, xp, opt, 0, y, e, azel)) { /* post-fit residuals for float solution */ - nv = ddres(rtk, nav, dt, xp, Pp, sat, y, e, azel, iu, ir, ns, v, NULL, R, vflg); + nv = ddres(rtk, nav, dt, xp, Pp, sat, y, e, azel, iu, ir, ns, v, nullptr, R, vflg); /* validation of float solution */ if (valpos(rtk, v, R, vflg, nv, 4.0)) @@ -2056,7 +2056,7 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, if (zdres(0, obs, nu, rs, dts, svh, nav, xa, opt, 0, y, e, azel)) { /* post-fit reisiduals for fixed solution */ - nv = ddres(rtk, nav, dt, xa, NULL, sat, y, e, azel, iu, ir, ns, v, NULL, R, vflg); + nv = ddres(rtk, nav, dt, xa, nullptr, sat, y, e, azel, iu, ir, ns, v, nullptr, R, vflg); /* validation of fixed solution */ if (valpos(rtk, v, R, vflg, nv, 4.0)) @@ -2181,13 +2181,13 @@ void rtkfree(rtk_t *rtk) rtk->nx = rtk->na = 0; free(rtk->x); - rtk->x = NULL; + rtk->x = nullptr; free(rtk->P); - rtk->P = NULL; + rtk->P = nullptr; free(rtk->xa); - rtk->xa = NULL; + rtk->xa = nullptr; free(rtk->Pa); - rtk->Pa = NULL; + rtk->Pa = nullptr; } @@ -2277,7 +2277,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) time = rtk->sol.time; /* previous epoch */ /* rover position by single point positioning */ - if (!pntpos(obs, nu, nav, &rtk->opt, &rtk->sol, NULL, rtk->ssat, msg)) + if (!pntpos(obs, nu, nav, &rtk->opt, &rtk->sol, nullptr, rtk->ssat, msg)) { errmsg(rtk, "point pos error (%s)\n", msg); if (!rtk->opt.dynamics) @@ -2317,7 +2317,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) { /* moving baseline */ /* estimate position/velocity of base station */ - if (!pntpos(obs + nu, nr, nav, &rtk->opt, &solb, NULL, NULL, msg)) + if (!pntpos(obs + nu, nr, nav, &rtk->opt, &solb, nullptr, nullptr, msg)) { errmsg(rtk, "base station position error (%s)\n", msg); return 0; diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 052de403b..15b92416b 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -129,7 +129,7 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, for (i = 0; i < obs->n; i++) { if (svr->rtk.opt.exsats[obs->data[i].sat - 1] == 1 || - !(satsys(obs->data[i].sat, NULL) & svr->rtk.opt.navsys)) continue; + !(satsys(obs->data[i].sat, nullptr) & svr->rtk.opt.navsys)) continue; svr->obs[index][iobs].data[n] = obs->data[i]; svr->obs[index][iobs].data[n++].rcv = index + 1; } @@ -291,7 +291,7 @@ int decoderaw(rtksvr_t *svr, int index) { obs_t *obs; nav_t *nav; - sbsmsg_t *sbsmsg = NULL; + sbsmsg_t *sbsmsg = nullptr; int i, ret = 0, sat, fobs = 0; tracet(4, "decoderaw: index=%d\n", index); @@ -373,8 +373,8 @@ void decodefile(rtksvr_t *svr, int index) trop_t trop0[MAXSTA] = {{{0, 0.0}, {0.0}, {0.0}}}; pppcorr_t pppcorr0 = {0, {{0}, {0}}, {{0.0}, {0.0}}, {0}, {0}, {0}, {0}, {stec0}, {trop0}}; - nav_t nav = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - {0, 0, (erpd_t *){0}}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, + nav_t nav = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + {0, 0, (erpd_t *){nullptr}}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, 0, {{0.0}, {0.0}}, {{0.0}, {0.0}}, {{{0.0}}, {{0.0}}, {{0.0}}}, {0.0}, {0.0}, {*glo_fcn}, {*pcvt0}, sbssat0, {*sbsion0}, {*dgps0}, {*ssr0}, {*lexeph0}, {{0, 0.0}, 0.0, {0.0}, {{0.0}, {0.0}}}, pppcorr0}; @@ -564,9 +564,9 @@ void *rtksvrthread(void *arg) { svr->nb[i] = svr->npb[i] = 0; free(svr->buff[i]); - svr->buff[i] = NULL; + svr->buff[i] = nullptr; free(svr->pbuf[i]); - svr->pbuf[i] = NULL; + svr->pbuf[i] = nullptr; //free_raw (svr->raw +i); free_rtcm(svr->rtcm + i); } @@ -574,9 +574,9 @@ void *rtksvrthread(void *arg) { svr->nsb[i] = 0; free(svr->sbuf[i]); - svr->sbuf[i] = NULL; + svr->sbuf[i] = nullptr; } - return 0; + return nullptr; } @@ -610,17 +610,17 @@ int rtksvrinit(rtksvr_t *svr) for (i = 0; i < 3; i++) svr->nb[i] = 0; for (i = 0; i < 2; i++) svr->nsb[i] = 0; for (i = 0; i < 3; i++) svr->npb[i] = 0; - for (i = 0; i < 3; i++) svr->buff[i] = NULL; - for (i = 0; i < 2; i++) svr->sbuf[i] = NULL; - for (i = 0; i < 3; i++) svr->pbuf[i] = NULL; + for (i = 0; i < 3; i++) svr->buff[i] = nullptr; + for (i = 0; i < 2; i++) svr->sbuf[i] = nullptr; + for (i = 0; i < 3; i++) svr->pbuf[i] = nullptr; for (i = 0; i < MAXSOLBUF; i++) svr->solbuf[i] = sol0; for (i = 0; i < 3; i++) for (j = 0; j < 10; j++) svr->nmsg[i][j] = 0; for (i = 0; i < 3; i++) svr->ftime[i] = time0; for (i = 0; i < 3; i++) svr->files[i][0] = '\0'; - svr->moni = NULL; + svr->moni = nullptr; svr->tick = 0; - svr->thread = 0; + svr->thread = nullptr; svr->cputime = svr->prcout = 0; if (!(svr->nav.eph = (eph_t *)malloc(sizeof(eph_t) * MAXSAT * 2)) || @@ -840,7 +840,7 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, writesolhead(svr->stream + i, svr->solopt + i - 3); } /* create rtk server thread */ - if (pthread_create(&svr->thread, NULL, rtksvrthread, svr)) + if (pthread_create(&svr->thread, nullptr, rtksvrthread, svr)) { for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream + i); return 0; @@ -876,7 +876,7 @@ void rtksvrstop(rtksvr_t *svr, char **cmds) svr->state = 0; /* free rtk server thread */ - pthread_join(svr->thread, NULL); + pthread_join(svr->thread, nullptr); } diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc index 3bd809d10..77b6a0f47 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.cc +++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc @@ -66,7 +66,7 @@ char *getfield(char *p, int pos) { for (pos--; pos > 0; pos--, p++) - if (!(p = strchr(p, ','))) return NULL; + if (!(p = strchr(p, ','))) return nullptr; return p; } @@ -579,7 +579,7 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, { trace(1, "readsbsmsg malloc error: nmax=%d\n", sbs->nmax); free(sbs->msgs); - sbs->msgs = NULL; + sbs->msgs = nullptr; sbs->n = sbs->nmax = 0; fclose(fp); return; @@ -942,7 +942,7 @@ int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, return 1; } /* if sbas satellite without correction, no correction applied */ - if (satsys(sat, NULL) == SYS_SBS) return 1; + if (satsys(sat, nullptr) == SYS_SBS) return 1; trace(2, "no sbas long-term correction: %s sat=%2d\n", time_str(time, 0), sat); return 0; diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index 71a25f105..be2fd368f 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -322,7 +322,7 @@ int decode_nmeagga(char **val, int n, sol_t *sol) /* decode nmea ---------------------------------------------------------------*/ int decode_nmea(char *buff, sol_t *sol) { - char *p, *q, *val[MAXFIELD] = {0}; + char *p, *q, *val[MAXFIELD] = {nullptr}; int n = 0; trace(4, "decode_nmea: buff=%s\n", buff); @@ -382,7 +382,7 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) { *time = utc2gpst(timeadd(*time, -9 * 3600.0)); } - if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return NULL; + if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return nullptr; for (p++; isdigit((int)*p) || *p == '.';) p++; return p + len; } @@ -390,10 +390,10 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) { if (sscanf(buff, "%lf %lf %lf %lf:%lf:%lf", v, v + 1, v + 2, v + 3, v + 4, v + 5) < 6) { - return NULL; + return nullptr; } *time = timeadd(epoch2time(v), -12.0 * 3600.0); - if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return NULL; + if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return nullptr; for (p++; isdigit((int)*p) || *p == '.';) p++; return p + len; } @@ -409,7 +409,7 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) *time = gpst2time((int)v[0], v[1]); return p; } - return NULL; + return nullptr; } @@ -834,7 +834,7 @@ int sort_solbuf(solbuf_t *solbuf) { trace(1, "sort_solbuf: memory allocation error\n"); free(solbuf->data); - solbuf->data = NULL; + solbuf->data = nullptr; solbuf->n = solbuf->nmax = 0; return 0; } @@ -935,7 +935,7 @@ int addsol(solbuf_t *solbuf, const sol_t *sol) { trace(1, "addsol: memory allocation error\n"); free(solbuf->data); - solbuf->data = NULL; + solbuf->data = nullptr; solbuf->n = solbuf->nmax = 0; return 0; } @@ -956,7 +956,7 @@ sol_t *getsol(solbuf_t *solbuf, int index) { trace(4, "getsol: index=%d\n", index); - if (index < 0 || solbuf->n <= index) return NULL; + if (index < 0 || solbuf->n <= index) return nullptr; if ((index = solbuf->start + index) >= solbuf->nmax) { index -= solbuf->nmax; @@ -981,7 +981,7 @@ void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax) solbuf->n = solbuf->nmax = solbuf->start = solbuf->end = 0; solbuf->cyclic = cyclic; solbuf->time = time0; - solbuf->data = NULL; + solbuf->data = nullptr; if (cyclic) { if (nmax <= 2) nmax = 2; @@ -1006,7 +1006,7 @@ void freesolbuf(solbuf_t *solbuf) free(solbuf->data); solbuf->n = solbuf->nmax = solbuf->start = solbuf->end = 0; - solbuf->data = NULL; + solbuf->data = nullptr; } @@ -1016,7 +1016,7 @@ void freesolstatbuf(solstatbuf_t *solstatbuf) solstatbuf->n = solstatbuf->nmax = 0; free(solstatbuf->data); - solstatbuf->data = NULL; + solstatbuf->data = nullptr; } @@ -1042,7 +1042,7 @@ int sort_solstat(solstatbuf_t *statbuf) { trace(1, "sort_solstat: memory allocation error\n"); free(statbuf->data); - statbuf->data = NULL; + statbuf->data = nullptr; statbuf->n = statbuf->nmax = 0; return 0; } @@ -1115,7 +1115,7 @@ void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat) { trace(1, "addsolstat: memory allocation error\n"); free(statbuf->data); - statbuf->data = NULL; + statbuf->data = nullptr; statbuf->n = statbuf->nmax = 0; return; } @@ -1169,7 +1169,7 @@ int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te, trace(3, "readsolstatt: nfile=%d\n", nfile); statbuf->n = statbuf->nmax = 0; - statbuf->data = NULL; + statbuf->data = nullptr; for (i = 0; i < nfile; i++) { diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 04ae96e01..c0bf2e5bd 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -94,7 +94,7 @@ serial_t *openserial(const char *path, int mode, char *msg) int rw = 0; tracet(3, "openserial: path=%s mode=%d\n", path, mode); - if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL; + if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return nullptr; if ((p = strchr((char *)path, ':'))) { @@ -112,7 +112,7 @@ serial_t *openserial(const char *path, int mode, char *msg) sprintf(msg, "bitrate error (%d)", brate); tracet(1, "openserial: %s path=%s\n", msg, path); free(serial); - return NULL; + return nullptr; } parity = (char)toupper((int)parity); @@ -135,7 +135,7 @@ serial_t *openserial(const char *path, int mode, char *msg) sprintf(msg, "device open error (%d)", errno); tracet(1, "openserial: %s dev=%s\n", msg, dev); free(serial); - return NULL; + return nullptr; } tcgetattr(serial->dev, &ios); ios.c_iflag = 0; @@ -295,7 +295,7 @@ void closefile_(file_t *file) if (file->fp_tag) fclose(file->fp_tag); if (file->fp_tmp) fclose(file->fp_tmp); if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); - file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = NULL; + file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = nullptr; } @@ -310,7 +310,7 @@ file_t *openfile(const char *path, int mode, char *msg) tracet(3, "openfile: path=%s mode=%d\n", path, mode); - if (!(mode & (STR_MODE_R | STR_MODE_W))) return NULL; + if (!(mode & (STR_MODE_R | STR_MODE_W))) return nullptr; /* file options */ for (p = (char *)path; (p = strstr(p, "::")); p += 2) @@ -327,9 +327,9 @@ file_t *openfile(const char *path, int mode, char *msg) if (start <= 0.0) start = 0.0; if (swapintv <= 0.0) swapintv = 0.0; - if (!(file = (file_t *)malloc(sizeof(file_t)))) return NULL; + if (!(file = (file_t *)malloc(sizeof(file_t)))) return nullptr; - file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = NULL; + file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = nullptr; if (strlen(path) < MAXSTRPATH) strcpy(file->path, path); if ((p = strstr(file->path, "::"))) *p = '\0'; file->openpath[0] = '\0'; @@ -350,7 +350,7 @@ file_t *openfile(const char *path, int mode, char *msg) if (!openfile_(file, time, msg)) { free(file); - return NULL; + return nullptr; } return file; } @@ -399,7 +399,7 @@ void swapclose(file_t *file) tracet(3, "swapclose: fp_tmp=%d\n", file->fp_tmp); if (file->fp_tmp) fclose(file->fp_tmp); if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); - file->fp_tmp = file->fp_tag_tmp = NULL; + file->fp_tmp = file->fp_tag_tmp = nullptr; } @@ -427,7 +427,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) /* input from stdin */ FD_ZERO(&rs); FD_SET(0, &rs); - if (!select(1, &rs, NULL, NULL, &tv)) return 0; + if (!select(1, &rs, nullptr, nullptr, &tv)) return 0; if ((nr = read(0, buff, nmax)) < 0) return 0; return nr; } @@ -652,7 +652,7 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) fd_set rs; FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock + 1, &rs, NULL, NULL, &tv)) return 0; + if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) return 0; return accept(sock, addr, len); } @@ -673,7 +673,7 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len) FD_ZERO(&rs); FD_SET(sock, &rs); ws = rs; - if (select(sock + 1, &rs, &ws, NULL, &tv) == 0) return 0; + if (select(sock + 1, &rs, &ws, nullptr, &tv) == 0) return 0; } return 1; } @@ -686,7 +686,7 @@ int recv_nb(socket_t sock, unsigned char *buff, int n) fd_set rs; FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock + 1, &rs, NULL, NULL, &tv)) return 0; + if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) return 0; return recv(sock, (char *)buff, n, 0); } @@ -698,7 +698,7 @@ int send_nb(socket_t sock, unsigned char *buff, int n) fd_set ws; FD_ZERO(&ws); FD_SET(sock, &ws); - if (!select(sock + 1, NULL, &ws, NULL, &tv)) return 0; + if (!select(sock + 1, nullptr, &ws, nullptr, &tv)) return 0; return send(sock, (char *)buff, n, 0); } @@ -788,20 +788,20 @@ tcpsvr_t *opentcpsvr(const char *path, char *msg) tcpsvr0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}}}; tracet(3, "opentcpsvr: path=%s\n", path); - if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return NULL; + if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return nullptr; *tcpsvr = tcpsvr0; - decodetcppath(path, tcpsvr->svr.saddr, port, NULL, NULL, NULL, NULL); + decodetcppath(path, tcpsvr->svr.saddr, port, nullptr, nullptr, nullptr, nullptr); if (sscanf(port, "%d", &tcpsvr->svr.port) < 1) { sprintf(msg, "port error: %s", port); tracet(1, "opentcpsvr: port error port=%s\n", port); free(tcpsvr); - return NULL; + return nullptr; } if (!gentcp(&tcpsvr->svr, 0, msg)) { free(tcpsvr); - return NULL; + return nullptr; } tcpsvr->svr.tcon = 0; return tcpsvr; @@ -1018,15 +1018,15 @@ tcpcli_t *opentcpcli(const char *path, char *msg) tracet(3, "opentcpcli: path=%s\n", path); - if (!(tcpcli = (tcpcli_t *)malloc(sizeof(tcpcli_t)))) return NULL; + if (!(tcpcli = (tcpcli_t *)malloc(sizeof(tcpcli_t)))) return nullptr; *tcpcli = tcpcli0; - decodetcppath(path, tcpcli->svr.saddr, port, NULL, NULL, NULL, NULL); + decodetcppath(path, tcpcli->svr.saddr, port, nullptr, nullptr, nullptr, nullptr); if (sscanf(port, "%d", &tcpcli->svr.port) < 1) { sprintf(msg, "port error: %s", port); tracet(1, "opentcp: port error port=%s\n", port); free(tcpcli); - return NULL; + return nullptr; } tcpcli->svr.tcon = 0; tcpcli->toinact = toinact; @@ -1367,7 +1367,7 @@ ntrip_t *openntrip(const char *path, int type, char *msg) tracet(3, "openntrip: path=%s type=%d\n", path, type); - if (!(ntrip = (ntrip_t *)malloc(sizeof(ntrip_t)))) return NULL; + if (!(ntrip = (ntrip_t *)malloc(sizeof(ntrip_t)))) return nullptr; ntrip->state = 0; ntrip->type = type; /* 0:server, 1:client */ @@ -1402,7 +1402,7 @@ ntrip_t *openntrip(const char *path, int type, char *msg) { tracet(1, "openntrip: opentcp error\n"); free(ntrip); - return NULL; + return nullptr; } return ntrip; } @@ -1548,7 +1548,7 @@ void *ftpthread(void *arg) tracet(1, "no local directory\n"); ftp->error = 11; ftp->state = 3; - return 0; + return nullptr; } /* replace keyword in file path and local path */ time = timeadd(utc2gpst(timeget()), ftp->topts[0]); @@ -1584,7 +1584,7 @@ void *ftpthread(void *arg) strcpy(ftp->local, tmpfile); tracet(3, "ftpthread: file exists %s\n", ftp->local); ftp->state = 2; - return 0; + return nullptr; } /* proxy settings for wget (ref [2]) */ if (*proxyaddr) @@ -1633,7 +1633,7 @@ void *ftpthread(void *arg) tracet(1, "execcmd error: cmd=%s ret=%d\n", cmd, ret); ftp->error = ret; ftp->state = 3; - return 0; + return nullptr; } if (remove(errfile) != 0) trace(1, "Error removing file"); @@ -1652,14 +1652,14 @@ void *ftpthread(void *arg) tracet(1, "file uncompact error: %s\n", local); ftp->error = 12; ftp->state = 3; - return 0; + return nullptr; } } if (strlen(local) < 1024) strcpy(ftp->local, local); ftp->state = 2; /* ftp completed */ tracet(3, "ftpthread: complete cmd=%s\n", cmd); - return 0; + return nullptr; } @@ -1672,12 +1672,12 @@ ftp_t *openftp(const char *path, int type, char *msg) msg[0] = '\0'; - if (!(ftp = (ftp_t *)malloc(sizeof(ftp_t)))) return NULL; + if (!(ftp = (ftp_t *)malloc(sizeof(ftp_t)))) return nullptr; ftp->state = 0; ftp->proto = type; ftp->error = 0; - ftp->thread = 0; + ftp->thread = nullptr; ftp->local[0] = '\0'; /* decode ftp path */ @@ -1718,7 +1718,7 @@ int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) ftp->state = 1; sprintf(msg, "%s://%s", ftp->proto ? "http" : "ftp", ftp->addr); - if (pthread_create(&ftp->thread, NULL, ftpthread, ftp)) + if (pthread_create(&ftp->thread, nullptr, ftpthread, ftp)) { tracet(1, "readftp: ftp thread create error\n"); ftp->state = 3; @@ -1786,7 +1786,7 @@ void strinit(stream_t *stream) stream->inb = stream->inr = stream->outb = stream->outr = 0; stream->tick = stream->tact = stream->inbt = stream->outbt = 0; initlock(&stream->lock); - stream->port = NULL; + stream->port = nullptr; stream->path[0] = '\0'; stream->msg[0] = '\0'; } @@ -1838,7 +1838,7 @@ int stropen(stream_t *stream, int type, int mode, const char *path) stream->tick = tickget(); stream->inbt = stream->outbt = 0; stream->msg[0] = '\0'; - stream->port = NULL; + stream->port = nullptr; switch (type) { case STR_SERIAL: @@ -1870,7 +1870,7 @@ int stropen(stream_t *stream, int type, int mode, const char *path) return 1; } stream->state = !stream->port ? -1 : 1; - return stream->port != NULL; + return stream->port != nullptr; } @@ -1923,7 +1923,7 @@ void strclose(stream_t *stream) stream->inr = stream->outr = 0; stream->path[0] = '\0'; stream->msg[0] = '\0'; - stream->port = NULL; + stream->port = nullptr; } @@ -2286,7 +2286,7 @@ int gen_hex(const char *msg, unsigned char *buff) trace(4, "gen_hex: msg=%s\n", msg); strncpy(mbuff, msg, 1023); - for (p = strtok(mbuff, " "); p && narg < 256; p = strtok(NULL, " ")) + for (p = strtok(mbuff, " "); p && narg < 256; p = strtok(nullptr, " ")) { args[narg++] = p; } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index ffd395462..99e495ffe 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -270,8 +270,8 @@ int32_t hybrid_observables_cc::save_matfile() filename.erase(filename.end() - 4, filename.end()); } filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {static_cast(d_nchannels_out), static_cast(num_epoch)}; matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time_aux, MAT_F_DONT_COPY_DATA); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 0801d6862..5bfe54caf 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1171,8 +1171,8 @@ int32_t dll_pll_veml_tracking::save_matfile() std::string filename = dump_filename_; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index ee049869d..1ae3d7fb7 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -172,7 +172,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( d_carrier_lock_threshold = FLAGS_carrier_lock_th; systemName["E"] = std::string("Galileo"); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_next_rem_code_phase_samples = 0; d_acq_code_phase_samples = 0.0; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 2689e382f..362596385 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -185,7 +185,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc set_relative_rate(1.0 / static_cast(d_vector_length)); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -456,8 +456,8 @@ int32_t glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 1c0b45b9c..5884e3704 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -183,7 +183,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc set_relative_rate(1.0 / static_cast(d_vector_length)); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -410,8 +410,8 @@ int32_t glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index 2050d0f1f..de72d6e77 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -154,7 +154,7 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc( systemName["R"] = std::string("Glonass"); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -408,8 +408,8 @@ int32_t Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 19c5cca3e..bd53ba4cd 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -182,7 +182,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc set_relative_rate(1.0 / static_cast(d_vector_length)); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -453,8 +453,8 @@ int32_t glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index a02b9f358..6fcad3386 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -182,7 +182,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc set_relative_rate(1.0 / static_cast(d_vector_length)); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -409,8 +409,8 @@ int32_t glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index e90341eac..21b0ec537 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -154,7 +154,7 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc( systemName["R"] = std::string("Glonass"); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -408,8 +408,8 @@ int32_t Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index 33879066e..40269d5cb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -175,7 +175,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc( set_relative_rate(1.0 / static_cast(d_vector_length)); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -435,8 +435,8 @@ int32_t gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index b1defca22..cc510adcc 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -175,7 +175,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc( set_relative_rate(1.0 / static_cast(d_vector_length)); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -437,8 +437,8 @@ int32_t gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index f277bf216..91f0eaf11 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -172,7 +172,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( systemName["G"] = std::string("GPS"); systemName["S"] = std::string("SBAS"); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; d_acq_carrier_doppler_hz = 0.0; @@ -516,8 +516,8 @@ int32_t Gps_L1_Ca_Kf_Tracking_cc::save_matfile() std::string filename = d_dump_filename; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0); diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 232fc7aa8..7a936d622 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -163,7 +163,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( systemName["E"] = std::string("Galileo"); systemName["C"] = std::string("Compass"); - d_acquisition_gnss_synchro = 0; + d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_next_rem_code_phase_samples = 0; d_acq_code_phase_samples = 0.0; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 3ba722e28..a99a499dc 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -166,7 +166,7 @@ void ControlThread::init() else { // fill agnss_ref_time_ - struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr}; if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) { agnss_ref_time_.d_tv_sec = timegm(&tm); @@ -876,7 +876,7 @@ std::vector> ControlThread::get_visible_sats(time std::vector visible_gps; std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); - struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr}; char buf[80]; tstruct = *gmtime(&rx_utc_time); strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 012d7abb7..15cba5a40 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -142,7 +142,7 @@ std::string TcpCmdInterface::status(const std::vector &commandLine &course_over_ground_deg, &UTC_time) == true) { - struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr}; char buf1[80]; tstruct = *gmtime(&UTC_time); strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct); @@ -173,7 +173,7 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin if (commandLine.size() > 5) { // Read commandline time parameter - struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr}; if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { response = "ERROR: time parameter malformed\n"; @@ -219,7 +219,7 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi { std::string tmp_str; // Read commandline time parameter - struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr}; tmp_str = commandLine.at(1) + commandLine.at(2); if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { diff --git a/src/core/system_parameters/rtcm.cc b/src/core/system_parameters/rtcm.cc index 24d3417ce..33db275f8 100644 --- a/src/core/system_parameters/rtcm.cc +++ b/src/core/system_parameters/rtcm.cc @@ -288,7 +288,7 @@ uint32_t Rtcm::bin_to_uint(const std::string& s) const LOG(WARNING) << "Cannot convert to a uint32_t"; return 0; } - uint32_t reading = strtoul(s.c_str(), NULL, 2); + uint32_t reading = strtoul(s.c_str(), nullptr, 2); return reading; } @@ -312,7 +312,7 @@ int32_t Rtcm::bin_to_int(const std::string& s) const } else { - reading = strtol(s.c_str(), NULL, 2); + reading = strtol(s.c_str(), nullptr, 2); } return reading; } @@ -333,13 +333,13 @@ int32_t Rtcm::bin_to_sint(const std::string& s) const { sign = 1; // Get the magnitude of the value - reading = strtol((s.substr(1)).c_str(), NULL, 2); + reading = strtol((s.substr(1)).c_str(), nullptr, 2); } else { sign = -1; // Get the magnitude of the value - reading = strtol((s.substr(1)).c_str(), NULL, 2); + reading = strtol((s.substr(1)).c_str(), nullptr, 2); } return sign * reading; } @@ -372,11 +372,11 @@ double Rtcm::bin_to_double(const std::string& s) const original_bitset.flip(); std::string aux; to_string(original_bitset, aux); - reading_int = -(strtoll(aux.c_str(), NULL, 2) + 1); + reading_int = -(strtoll(aux.c_str(), nullptr, 2) + 1); } else { - reading_int = strtoll(s.c_str(), NULL, 2); + reading_int = strtoll(s.c_str(), nullptr, 2); } reading = static_cast(reading_int); @@ -391,7 +391,7 @@ uint64_t Rtcm::hex_to_uint(const std::string& s) const LOG(WARNING) << "Cannot convert to a uint64_t"; return 0; } - uint64_t reading = strtoul(s.c_str(), NULL, 16); + uint64_t reading = strtoul(s.c_str(), nullptr, 16); return reading; } @@ -403,7 +403,7 @@ int64_t Rtcm::hex_to_int(const std::string& s) const LOG(WARNING) << "Cannot convert to a int64_t"; return 0; } - int64_t reading = strtol(s.c_str(), NULL, 16); + int64_t reading = strtol(s.c_str(), nullptr, 16); return reading; } diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 7d8b58106..28b8980c1 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -703,7 +703,7 @@ std::string Gnuplot::terminal_std = "aqua"; // constructor: set a style during construction // inline Gnuplot::Gnuplot(const std::string &style) - : gnucmd(NULL), valid(false), two_dim(false), nplots(0) + : gnucmd(nullptr), valid(false), two_dim(false), nplots(0) { init(); @@ -720,7 +720,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, const std::string &style, const std::string &labelx, const std::string &labely) - : gnucmd(NULL), valid(false), two_dim(false), nplots(0) + : gnucmd(nullptr), valid(false), two_dim(false), nplots(0) { init(); @@ -742,7 +742,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, const std::string &style, const std::string &labelx, const std::string &labely) - : gnucmd(NULL), valid(false), two_dim(false), nplots(0) + : gnucmd(nullptr), valid(false), two_dim(false), nplots(0) { init(); @@ -766,7 +766,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, const std::string &labelx, const std::string &labely, const std::string &labelz) - : gnucmd(NULL), valid(false), two_dim(false), nplots(0) + : gnucmd(nullptr), valid(false), two_dim(false), nplots(0) { init(); @@ -1027,7 +1027,7 @@ bool Gnuplot::set_GNUPlotPath(const std::string &path) void Gnuplot::set_terminal_std(const std::string &type) { #if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if (type.find("x11") != std::string::npos && std::getenv("DISPLAY") == NULL) + if (type.find("x11") != std::string::npos && std::getenv("DISPLAY") == nullptr) { throw GnuplotException("Can't find DISPLAY variable"); } diff --git a/src/tests/unit-tests/arithmetic/matio_test.cc b/src/tests/unit-tests/arithmetic/matio_test.cc index 0429dff75..da83cb7e3 100644 --- a/src/tests/unit-tests/arithmetic/matio_test.cc +++ b/src/tests/unit-tests/arithmetic/matio_test.cc @@ -41,13 +41,13 @@ TEST(MatioTest, WriteAndReadDoubles) mat_t *matfp; matvar_t *matvar; std::string filename = "./test.mat"; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + ASSERT_FALSE(reinterpret_cast(matfp) == nullptr) << "Error creating .mat file"; double x[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; size_t dims[2] = {10, 1}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, x, 0); - ASSERT_FALSE(reinterpret_cast(matvar) == NULL) << "Error creating variable for ’x’"; + ASSERT_FALSE(reinterpret_cast(matvar) == nullptr) << "Error creating variable for ’x’"; Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); @@ -59,10 +59,10 @@ TEST(MatioTest, WriteAndReadDoubles) matvar_t *matvar_read; matfp_read = Mat_Open(filename.c_str(), MAT_ACC_RDONLY); - ASSERT_FALSE(reinterpret_cast(matfp_read) == NULL) << "Error reading .mat file"; + ASSERT_FALSE(reinterpret_cast(matfp_read) == nullptr) << "Error reading .mat file"; matvar_read = Mat_VarReadInfo(matfp_read, "x"); - ASSERT_FALSE(reinterpret_cast(matvar_read) == NULL) << "Error reading variable in .mat file"; + ASSERT_FALSE(reinterpret_cast(matvar_read) == nullptr) << "Error reading variable in .mat file"; matvar_read = Mat_VarRead(matfp_read, "x"); double *x_read = reinterpret_cast(matvar_read->data); @@ -83,8 +83,8 @@ TEST(MatioTest, WriteAndReadGrComplex) mat_t *matfp; matvar_t *matvar1; std::string filename = "./test3.mat"; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + ASSERT_FALSE(reinterpret_cast(matfp) == nullptr) << "Error creating .mat file"; std::vector x_v = {{1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; const unsigned int size = x_v.size(); @@ -101,7 +101,7 @@ TEST(MatioTest, WriteAndReadGrComplex) struct mat_complex_split_t x = {x_real, x_imag}; size_t dims[2] = {static_cast(size), 1}; matvar1 = Mat_VarCreate("x", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, &x, MAT_F_COMPLEX); - ASSERT_FALSE(reinterpret_cast(matvar1) == NULL) << "Error creating variable for ’x’"; + ASSERT_FALSE(reinterpret_cast(matvar1) == nullptr) << "Error creating variable for ’x’"; std::vector x2 = {{1.1, -10}, {2, -9}, {3, -8}, {4, -7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; const unsigned int size_y = x2.size(); @@ -119,7 +119,7 @@ TEST(MatioTest, WriteAndReadGrComplex) size_t dims_y[2] = {static_cast(size_y), 1}; matvar_t *matvar2; matvar2 = Mat_VarCreate("y", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims_y, &y, MAT_F_COMPLEX); - ASSERT_FALSE(reinterpret_cast(matvar2) == NULL) << "Error creating variable for ’y’"; + ASSERT_FALSE(reinterpret_cast(matvar2) == nullptr) << "Error creating variable for ’y’"; Mat_VarWrite(matfp, matvar1, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarWrite(matfp, matvar2, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE @@ -133,10 +133,10 @@ TEST(MatioTest, WriteAndReadGrComplex) matvar_t *matvar_read; matfp_read = Mat_Open(filename.c_str(), MAT_ACC_RDONLY); - ASSERT_FALSE(reinterpret_cast(matfp_read) == NULL) << "Error reading .mat file"; + ASSERT_FALSE(reinterpret_cast(matfp_read) == nullptr) << "Error reading .mat file"; matvar_read = Mat_VarReadInfo(matfp_read, "x"); - ASSERT_FALSE(reinterpret_cast(matvar_read) == NULL) << "Error reading variable in .mat file"; + ASSERT_FALSE(reinterpret_cast(matvar_read) == nullptr) << "Error reading variable in .mat file"; matvar_read = Mat_VarRead(matfp_read, "x"); mat_complex_split_t *x_read_st = reinterpret_cast(matvar_read->data); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index 4cb401ab2..43cfc8c5d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -38,13 +38,13 @@ bool acquisition_dump_reader::read_binary_acq() { mat_t* matfile = Mat_Open(d_dump_filename.c_str(), MAT_ACC_RDONLY); - if (matfile == NULL) + if (matfile == nullptr) { std::cout << "¡¡¡Unreachable Acquisition dump file!!!" << std::endl; return false; } matvar_t* var_ = Mat_VarRead(matfile, "acq_grid"); - if (var_ == NULL) + if (var_ == nullptr) { std::cout << "¡¡¡Unreachable grid variable into Acquisition dump file!!!" << std::endl; Mat_Close(matfile); @@ -147,7 +147,7 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, unsigned int samples_per_code_ = 0; mat_t* matfile = Mat_Open(d_dump_filename.c_str(), MAT_ACC_RDONLY); - if (matfile != NULL) + if (matfile != nullptr) { matvar_t* var_ = Mat_VarRead(matfile, "doppler_max"); doppler_max_ = *static_cast(var_->data); From 8e797862185fe4dd46be9a95a03b3f9c4eae5b74 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 10:12:03 +0100 Subject: [PATCH 49/52] Fix building --- src/algorithms/libs/rtklib/rtklib_rtksvr.cc | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 15b92416b..052de403b 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -129,7 +129,7 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, for (i = 0; i < obs->n; i++) { if (svr->rtk.opt.exsats[obs->data[i].sat - 1] == 1 || - !(satsys(obs->data[i].sat, nullptr) & svr->rtk.opt.navsys)) continue; + !(satsys(obs->data[i].sat, NULL) & svr->rtk.opt.navsys)) continue; svr->obs[index][iobs].data[n] = obs->data[i]; svr->obs[index][iobs].data[n++].rcv = index + 1; } @@ -291,7 +291,7 @@ int decoderaw(rtksvr_t *svr, int index) { obs_t *obs; nav_t *nav; - sbsmsg_t *sbsmsg = nullptr; + sbsmsg_t *sbsmsg = NULL; int i, ret = 0, sat, fobs = 0; tracet(4, "decoderaw: index=%d\n", index); @@ -373,8 +373,8 @@ void decodefile(rtksvr_t *svr, int index) trop_t trop0[MAXSTA] = {{{0, 0.0}, {0.0}, {0.0}}}; pppcorr_t pppcorr0 = {0, {{0}, {0}}, {{0.0}, {0.0}}, {0}, {0}, {0}, {0}, {stec0}, {trop0}}; - nav_t nav = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - {0, 0, (erpd_t *){nullptr}}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, + nav_t nav = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + {0, 0, (erpd_t *){0}}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, {0.0}, 0, {{0.0}, {0.0}}, {{0.0}, {0.0}}, {{{0.0}}, {{0.0}}, {{0.0}}}, {0.0}, {0.0}, {*glo_fcn}, {*pcvt0}, sbssat0, {*sbsion0}, {*dgps0}, {*ssr0}, {*lexeph0}, {{0, 0.0}, 0.0, {0.0}, {{0.0}, {0.0}}}, pppcorr0}; @@ -564,9 +564,9 @@ void *rtksvrthread(void *arg) { svr->nb[i] = svr->npb[i] = 0; free(svr->buff[i]); - svr->buff[i] = nullptr; + svr->buff[i] = NULL; free(svr->pbuf[i]); - svr->pbuf[i] = nullptr; + svr->pbuf[i] = NULL; //free_raw (svr->raw +i); free_rtcm(svr->rtcm + i); } @@ -574,9 +574,9 @@ void *rtksvrthread(void *arg) { svr->nsb[i] = 0; free(svr->sbuf[i]); - svr->sbuf[i] = nullptr; + svr->sbuf[i] = NULL; } - return nullptr; + return 0; } @@ -610,17 +610,17 @@ int rtksvrinit(rtksvr_t *svr) for (i = 0; i < 3; i++) svr->nb[i] = 0; for (i = 0; i < 2; i++) svr->nsb[i] = 0; for (i = 0; i < 3; i++) svr->npb[i] = 0; - for (i = 0; i < 3; i++) svr->buff[i] = nullptr; - for (i = 0; i < 2; i++) svr->sbuf[i] = nullptr; - for (i = 0; i < 3; i++) svr->pbuf[i] = nullptr; + for (i = 0; i < 3; i++) svr->buff[i] = NULL; + for (i = 0; i < 2; i++) svr->sbuf[i] = NULL; + for (i = 0; i < 3; i++) svr->pbuf[i] = NULL; for (i = 0; i < MAXSOLBUF; i++) svr->solbuf[i] = sol0; for (i = 0; i < 3; i++) for (j = 0; j < 10; j++) svr->nmsg[i][j] = 0; for (i = 0; i < 3; i++) svr->ftime[i] = time0; for (i = 0; i < 3; i++) svr->files[i][0] = '\0'; - svr->moni = nullptr; + svr->moni = NULL; svr->tick = 0; - svr->thread = nullptr; + svr->thread = 0; svr->cputime = svr->prcout = 0; if (!(svr->nav.eph = (eph_t *)malloc(sizeof(eph_t) * MAXSAT * 2)) || @@ -840,7 +840,7 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, writesolhead(svr->stream + i, svr->solopt + i - 3); } /* create rtk server thread */ - if (pthread_create(&svr->thread, nullptr, rtksvrthread, svr)) + if (pthread_create(&svr->thread, NULL, rtksvrthread, svr)) { for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream + i); return 0; @@ -876,7 +876,7 @@ void rtksvrstop(rtksvr_t *svr, char **cmds) svr->state = 0; /* free rtk server thread */ - pthread_join(svr->thread, nullptr); + pthread_join(svr->thread, NULL); } From 9d94910e1b509ebd4634b3209df444934ad8a8fa Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 10:12:38 +0100 Subject: [PATCH 50/52] Fix building --- src/algorithms/libs/rtklib/rtklib_stream.cc | 72 ++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index c0bf2e5bd..04ae96e01 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -94,7 +94,7 @@ serial_t *openserial(const char *path, int mode, char *msg) int rw = 0; tracet(3, "openserial: path=%s mode=%d\n", path, mode); - if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return nullptr; + if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL; if ((p = strchr((char *)path, ':'))) { @@ -112,7 +112,7 @@ serial_t *openserial(const char *path, int mode, char *msg) sprintf(msg, "bitrate error (%d)", brate); tracet(1, "openserial: %s path=%s\n", msg, path); free(serial); - return nullptr; + return NULL; } parity = (char)toupper((int)parity); @@ -135,7 +135,7 @@ serial_t *openserial(const char *path, int mode, char *msg) sprintf(msg, "device open error (%d)", errno); tracet(1, "openserial: %s dev=%s\n", msg, dev); free(serial); - return nullptr; + return NULL; } tcgetattr(serial->dev, &ios); ios.c_iflag = 0; @@ -295,7 +295,7 @@ void closefile_(file_t *file) if (file->fp_tag) fclose(file->fp_tag); if (file->fp_tmp) fclose(file->fp_tmp); if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); - file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = nullptr; + file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = NULL; } @@ -310,7 +310,7 @@ file_t *openfile(const char *path, int mode, char *msg) tracet(3, "openfile: path=%s mode=%d\n", path, mode); - if (!(mode & (STR_MODE_R | STR_MODE_W))) return nullptr; + if (!(mode & (STR_MODE_R | STR_MODE_W))) return NULL; /* file options */ for (p = (char *)path; (p = strstr(p, "::")); p += 2) @@ -327,9 +327,9 @@ file_t *openfile(const char *path, int mode, char *msg) if (start <= 0.0) start = 0.0; if (swapintv <= 0.0) swapintv = 0.0; - if (!(file = (file_t *)malloc(sizeof(file_t)))) return nullptr; + if (!(file = (file_t *)malloc(sizeof(file_t)))) return NULL; - file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = nullptr; + file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = NULL; if (strlen(path) < MAXSTRPATH) strcpy(file->path, path); if ((p = strstr(file->path, "::"))) *p = '\0'; file->openpath[0] = '\0'; @@ -350,7 +350,7 @@ file_t *openfile(const char *path, int mode, char *msg) if (!openfile_(file, time, msg)) { free(file); - return nullptr; + return NULL; } return file; } @@ -399,7 +399,7 @@ void swapclose(file_t *file) tracet(3, "swapclose: fp_tmp=%d\n", file->fp_tmp); if (file->fp_tmp) fclose(file->fp_tmp); if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); - file->fp_tmp = file->fp_tag_tmp = nullptr; + file->fp_tmp = file->fp_tag_tmp = NULL; } @@ -427,7 +427,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) /* input from stdin */ FD_ZERO(&rs); FD_SET(0, &rs); - if (!select(1, &rs, nullptr, nullptr, &tv)) return 0; + if (!select(1, &rs, NULL, NULL, &tv)) return 0; if ((nr = read(0, buff, nmax)) < 0) return 0; return nr; } @@ -652,7 +652,7 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) fd_set rs; FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) return 0; + if (!select(sock + 1, &rs, NULL, NULL, &tv)) return 0; return accept(sock, addr, len); } @@ -673,7 +673,7 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len) FD_ZERO(&rs); FD_SET(sock, &rs); ws = rs; - if (select(sock + 1, &rs, &ws, nullptr, &tv) == 0) return 0; + if (select(sock + 1, &rs, &ws, NULL, &tv) == 0) return 0; } return 1; } @@ -686,7 +686,7 @@ int recv_nb(socket_t sock, unsigned char *buff, int n) fd_set rs; FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) return 0; + if (!select(sock + 1, &rs, NULL, NULL, &tv)) return 0; return recv(sock, (char *)buff, n, 0); } @@ -698,7 +698,7 @@ int send_nb(socket_t sock, unsigned char *buff, int n) fd_set ws; FD_ZERO(&ws); FD_SET(sock, &ws); - if (!select(sock + 1, nullptr, &ws, nullptr, &tv)) return 0; + if (!select(sock + 1, NULL, &ws, NULL, &tv)) return 0; return send(sock, (char *)buff, n, 0); } @@ -788,20 +788,20 @@ tcpsvr_t *opentcpsvr(const char *path, char *msg) tcpsvr0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}}}; tracet(3, "opentcpsvr: path=%s\n", path); - if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return nullptr; + if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return NULL; *tcpsvr = tcpsvr0; - decodetcppath(path, tcpsvr->svr.saddr, port, nullptr, nullptr, nullptr, nullptr); + decodetcppath(path, tcpsvr->svr.saddr, port, NULL, NULL, NULL, NULL); if (sscanf(port, "%d", &tcpsvr->svr.port) < 1) { sprintf(msg, "port error: %s", port); tracet(1, "opentcpsvr: port error port=%s\n", port); free(tcpsvr); - return nullptr; + return NULL; } if (!gentcp(&tcpsvr->svr, 0, msg)) { free(tcpsvr); - return nullptr; + return NULL; } tcpsvr->svr.tcon = 0; return tcpsvr; @@ -1018,15 +1018,15 @@ tcpcli_t *opentcpcli(const char *path, char *msg) tracet(3, "opentcpcli: path=%s\n", path); - if (!(tcpcli = (tcpcli_t *)malloc(sizeof(tcpcli_t)))) return nullptr; + if (!(tcpcli = (tcpcli_t *)malloc(sizeof(tcpcli_t)))) return NULL; *tcpcli = tcpcli0; - decodetcppath(path, tcpcli->svr.saddr, port, nullptr, nullptr, nullptr, nullptr); + decodetcppath(path, tcpcli->svr.saddr, port, NULL, NULL, NULL, NULL); if (sscanf(port, "%d", &tcpcli->svr.port) < 1) { sprintf(msg, "port error: %s", port); tracet(1, "opentcp: port error port=%s\n", port); free(tcpcli); - return nullptr; + return NULL; } tcpcli->svr.tcon = 0; tcpcli->toinact = toinact; @@ -1367,7 +1367,7 @@ ntrip_t *openntrip(const char *path, int type, char *msg) tracet(3, "openntrip: path=%s type=%d\n", path, type); - if (!(ntrip = (ntrip_t *)malloc(sizeof(ntrip_t)))) return nullptr; + if (!(ntrip = (ntrip_t *)malloc(sizeof(ntrip_t)))) return NULL; ntrip->state = 0; ntrip->type = type; /* 0:server, 1:client */ @@ -1402,7 +1402,7 @@ ntrip_t *openntrip(const char *path, int type, char *msg) { tracet(1, "openntrip: opentcp error\n"); free(ntrip); - return nullptr; + return NULL; } return ntrip; } @@ -1548,7 +1548,7 @@ void *ftpthread(void *arg) tracet(1, "no local directory\n"); ftp->error = 11; ftp->state = 3; - return nullptr; + return 0; } /* replace keyword in file path and local path */ time = timeadd(utc2gpst(timeget()), ftp->topts[0]); @@ -1584,7 +1584,7 @@ void *ftpthread(void *arg) strcpy(ftp->local, tmpfile); tracet(3, "ftpthread: file exists %s\n", ftp->local); ftp->state = 2; - return nullptr; + return 0; } /* proxy settings for wget (ref [2]) */ if (*proxyaddr) @@ -1633,7 +1633,7 @@ void *ftpthread(void *arg) tracet(1, "execcmd error: cmd=%s ret=%d\n", cmd, ret); ftp->error = ret; ftp->state = 3; - return nullptr; + return 0; } if (remove(errfile) != 0) trace(1, "Error removing file"); @@ -1652,14 +1652,14 @@ void *ftpthread(void *arg) tracet(1, "file uncompact error: %s\n", local); ftp->error = 12; ftp->state = 3; - return nullptr; + return 0; } } if (strlen(local) < 1024) strcpy(ftp->local, local); ftp->state = 2; /* ftp completed */ tracet(3, "ftpthread: complete cmd=%s\n", cmd); - return nullptr; + return 0; } @@ -1672,12 +1672,12 @@ ftp_t *openftp(const char *path, int type, char *msg) msg[0] = '\0'; - if (!(ftp = (ftp_t *)malloc(sizeof(ftp_t)))) return nullptr; + if (!(ftp = (ftp_t *)malloc(sizeof(ftp_t)))) return NULL; ftp->state = 0; ftp->proto = type; ftp->error = 0; - ftp->thread = nullptr; + ftp->thread = 0; ftp->local[0] = '\0'; /* decode ftp path */ @@ -1718,7 +1718,7 @@ int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) ftp->state = 1; sprintf(msg, "%s://%s", ftp->proto ? "http" : "ftp", ftp->addr); - if (pthread_create(&ftp->thread, nullptr, ftpthread, ftp)) + if (pthread_create(&ftp->thread, NULL, ftpthread, ftp)) { tracet(1, "readftp: ftp thread create error\n"); ftp->state = 3; @@ -1786,7 +1786,7 @@ void strinit(stream_t *stream) stream->inb = stream->inr = stream->outb = stream->outr = 0; stream->tick = stream->tact = stream->inbt = stream->outbt = 0; initlock(&stream->lock); - stream->port = nullptr; + stream->port = NULL; stream->path[0] = '\0'; stream->msg[0] = '\0'; } @@ -1838,7 +1838,7 @@ int stropen(stream_t *stream, int type, int mode, const char *path) stream->tick = tickget(); stream->inbt = stream->outbt = 0; stream->msg[0] = '\0'; - stream->port = nullptr; + stream->port = NULL; switch (type) { case STR_SERIAL: @@ -1870,7 +1870,7 @@ int stropen(stream_t *stream, int type, int mode, const char *path) return 1; } stream->state = !stream->port ? -1 : 1; - return stream->port != nullptr; + return stream->port != NULL; } @@ -1923,7 +1923,7 @@ void strclose(stream_t *stream) stream->inr = stream->outr = 0; stream->path[0] = '\0'; stream->msg[0] = '\0'; - stream->port = nullptr; + stream->port = NULL; } @@ -2286,7 +2286,7 @@ int gen_hex(const char *msg, unsigned char *buff) trace(4, "gen_hex: msg=%s\n", msg); strncpy(mbuff, msg, 1023); - for (p = strtok(mbuff, " "); p && narg < 256; p = strtok(nullptr, " ")) + for (p = strtok(mbuff, " "); p && narg < 256; p = strtok(NULL, " ")) { args[narg++] = p; } From 96f34cabb1a2b2b9071bc3c6f372cb03e0bf14d5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 11:12:10 +0100 Subject: [PATCH 51/52] clang-tidy: apply modernize-use-equals-default fix. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html --- .../conditioner/adapters/array_signal_conditioner.cc | 2 +- .../conditioner/adapters/signal_conditioner.cc | 2 +- .../data_type_adapter/adapters/byte_to_short.cc | 4 +--- .../data_type_adapter/adapters/ibyte_to_cbyte.cc | 4 +--- .../data_type_adapter/adapters/ibyte_to_complex.cc | 4 +--- .../data_type_adapter/adapters/ibyte_to_cshort.cc | 4 +--- .../data_type_adapter/adapters/ishort_to_complex.cc | 4 +--- .../data_type_adapter/adapters/ishort_to_cshort.cc | 4 +--- .../input_filter/adapters/beamformer_filter.cc | 2 +- src/algorithms/input_filter/adapters/fir_filter.cc | 4 +--- .../input_filter/adapters/freq_xlating_fir_filter.cc | 4 +--- src/algorithms/input_filter/adapters/notch_filter.cc | 4 +--- .../input_filter/adapters/notch_filter_lite.cc | 4 +--- .../input_filter/adapters/pulse_blanking_filter.cc | 4 +--- src/algorithms/libs/pass_through.cc | 4 +--- .../observables/adapters/hybrid_observables.cc | 4 +--- .../resampler/adapters/direct_resampler_conditioner.cc | 2 +- .../resampler/adapters/mmse_resampler_conditioner.cc | 4 +++- .../gnuradio_blocks/direct_resampler_conditioner_cb.cc | 4 +--- .../gnuradio_blocks/direct_resampler_conditioner_cc.cc | 4 +--- .../gnuradio_blocks/direct_resampler_conditioner_cs.cc | 4 +--- .../signal_generator/adapters/signal_generator.cc | 4 +--- .../signal_source/adapters/file_signal_source.cc | 4 +--- .../signal_source/adapters/labsat_signal_source.cc | 4 +--- .../signal_source/adapters/nsr_file_signal_source.cc | 4 +--- .../signal_source/adapters/rtl_tcp_signal_source.cc | 4 +--- .../signal_source/adapters/spir_file_signal_source.cc | 4 +--- .../adapters/spir_gss6450_file_signal_source.cc | 4 +--- .../adapters/two_bit_packed_file_signal_source.cc | 4 +--- .../signal_source/adapters/uhd_signal_source.cc | 4 +--- .../gnuradio_blocks/unpack_2bit_samples.cc | 4 +--- .../gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc | 4 +--- .../gnuradio_blocks/unpack_byte_2bit_samples.cc | 4 +--- .../gnuradio_blocks/unpack_byte_4bit_samples.cc | 4 +--- .../gnuradio_blocks/unpack_intspir_1bit_samples.cc | 4 +--- .../gnuradio_blocks/unpack_spir_gss6450_samples.cc | 5 ++--- .../adapters/galileo_e1b_telemetry_decoder.cc | 4 +--- .../adapters/galileo_e5a_telemetry_decoder.cc | 4 +--- .../adapters/glonass_l1_ca_telemetry_decoder.cc | 4 +--- .../adapters/glonass_l2_ca_telemetry_decoder.cc | 4 +--- .../adapters/gps_l1_ca_telemetry_decoder.cc | 4 +--- .../adapters/gps_l2c_telemetry_decoder.cc | 4 +--- .../adapters/gps_l5_telemetry_decoder.cc | 4 +--- .../adapters/sbas_l1_telemetry_decoder.cc | 4 +--- .../gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc | 4 +--- .../adapters/galileo_e1_dll_pll_veml_tracking.cc | 8 ++++---- .../adapters/galileo_e1_tcp_connector_tracking.cc | 8 ++++---- .../tracking/adapters/galileo_e5a_dll_pll_tracking.cc | 8 ++++---- .../adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc | 8 ++++---- .../adapters/glonass_l1_ca_dll_pll_tracking.cc | 8 ++++---- .../adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc | 8 ++++---- .../adapters/glonass_l2_ca_dll_pll_tracking.cc | 8 ++++---- .../adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc | 8 ++++---- .../tracking/adapters/gps_l1_ca_dll_pll_tracking.cc | 10 +++++----- .../tracking/adapters/gps_l1_ca_kf_tracking.cc | 8 ++++---- .../adapters/gps_l1_ca_tcp_connector_tracking.cc | 8 ++++---- .../tracking/adapters/gps_l2_m_dll_pll_tracking.cc | 9 ++++----- .../tracking/adapters/gps_l5_dll_pll_tracking.cc | 8 ++++---- src/algorithms/tracking/libs/bayesian_estimation.cc | 4 +--- src/algorithms/tracking/libs/tcp_communication.cc | 8 ++------ src/algorithms/tracking/libs/tcp_packet_data.cc | 2 +- .../tracking/libs/tracking_2nd_DLL_filter.cc | 8 +++++--- .../tracking/libs/tracking_2nd_PLL_filter.cc | 6 +++--- .../tracking/libs/tracking_FLL_PLL_filter.cc | 4 +--- src/core/interfaces/configuration_interface.h | 2 +- src/core/interfaces/gnss_block_interface.h | 2 +- src/core/libs/gnss_sdr_supl_client.cc | 2 +- src/core/receiver/tcp_cmd_interface.cc | 4 +--- src/core/system_parameters/rtcm.h | 2 +- .../acquisition/gps_l1_ca_pcps_acquisition_test.cc | 8 ++------ .../signal-processing-blocks/adapter/adapter_test.cc | 4 +--- .../signal-processing-blocks/filter/fir_filter_test.cc | 4 +--- .../filter/notch_filter_lite_test.cc | 4 +--- .../filter/notch_filter_test.cc | 4 +--- .../filter/pulse_blanking_filter_test.cc | 4 +--- .../libs/acquisition_dump_reader.cc | 4 +--- .../libs/acquisition_msg_rx.cc | 2 +- .../tracking/galileo_e1_dll_pll_veml_tracking_test.cc | 4 +--- src/utils/front-end-cal/front_end_cal.cc | 4 ++-- src/utils/front-end-cal/main.cc | 4 +++- 80 files changed, 134 insertions(+), 236 deletions(-) diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index 098a9e365..552d6d058 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -55,7 +55,7 @@ ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configura // Destructor -ArraySignalConditioner::~ArraySignalConditioner() {} +ArraySignalConditioner::~ArraySignalConditioner() = default; void ArraySignalConditioner::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index 72034c375..c8045fec2 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -55,7 +55,7 @@ SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, // Destructor -SignalConditioner::~SignalConditioner() {} +SignalConditioner::~SignalConditioner() = default; void SignalConditioner::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc index 7323d617a..daf6a3e9a 100644 --- a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc +++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc @@ -71,9 +71,7 @@ ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role } -ByteToShort::~ByteToShort() -{ -} +ByteToShort::~ByteToShort() = default; void ByteToShort::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc index a34befbd0..e8543e460 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc @@ -77,9 +77,7 @@ IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string ro } -IbyteToCbyte::~IbyteToCbyte() -{ -} +IbyteToCbyte::~IbyteToCbyte() = default; void IbyteToCbyte::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc index 0592e8802..c6b5d66d0 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc @@ -75,9 +75,7 @@ IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::strin } -IbyteToComplex::~IbyteToComplex() -{ -} +IbyteToComplex::~IbyteToComplex() = default; void IbyteToComplex::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc index c965abb92..cc901d4a1 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc @@ -78,9 +78,7 @@ IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string } -IbyteToCshort::~IbyteToCshort() -{ -} +IbyteToCshort::~IbyteToCshort() = default; void IbyteToCshort::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc index 31fa7eb48..27cb17afa 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc @@ -75,9 +75,7 @@ IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::str } -IshortToComplex::~IshortToComplex() -{ -} +IshortToComplex::~IshortToComplex() = default; void IshortToComplex::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc index 571b0170f..1f41f20c4 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc @@ -77,9 +77,7 @@ IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::strin } -IshortToCshort::~IshortToCshort() -{ -} +IshortToCshort::~IshortToCshort() = default; void IshortToCshort::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.cc b/src/algorithms/input_filter/adapters/beamformer_filter.cc index fb50853ec..58b76bf75 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.cc +++ b/src/algorithms/input_filter/adapters/beamformer_filter.cc @@ -79,7 +79,7 @@ BeamformerFilter::BeamformerFilter( } -BeamformerFilter::~BeamformerFilter() {} +BeamformerFilter::~BeamformerFilter() = default; void BeamformerFilter::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index 8c77856d8..dc3445fed 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -142,9 +142,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, } -FirFilter::~FirFilter() -{ -} +FirFilter::~FirFilter() = default; void FirFilter::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index 1bdb2d841..684813f02 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -196,9 +196,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration } -FreqXlatingFirFilter::~FreqXlatingFirFilter() -{ -} +FreqXlatingFirFilter::~FreqXlatingFirFilter() = default; void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/input_filter/adapters/notch_filter.cc b/src/algorithms/input_filter/adapters/notch_filter.cc index d483d523b..dd4f16978 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.cc +++ b/src/algorithms/input_filter/adapters/notch_filter.cc @@ -92,9 +92,7 @@ NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role } -NotchFilter::~NotchFilter() -{ -} +NotchFilter::~NotchFilter() = default; void NotchFilter::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.cc b/src/algorithms/input_filter/adapters/notch_filter_lite.cc index 65a816cb6..5aa615f1a 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.cc +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.cc @@ -99,9 +99,7 @@ NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, std::str } -NotchFilterLite::~NotchFilterLite() -{ -} +NotchFilterLite::~NotchFilterLite() = default; void NotchFilterLite::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index 7714dd404..bedb22a90 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -105,9 +105,7 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, } -PulseBlankingFilter::~PulseBlankingFilter() -{ -} +PulseBlankingFilter::~PulseBlankingFilter() = default; void PulseBlankingFilter::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/libs/pass_through.cc b/src/algorithms/libs/pass_through.cc index a64663cd3..ba0458358 100644 --- a/src/algorithms/libs/pass_through.cc +++ b/src/algorithms/libs/pass_through.cc @@ -120,9 +120,7 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string ro } -Pass_Through::~Pass_Through() -{ -} +Pass_Through::~Pass_Through() = default; void Pass_Through::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/observables/adapters/hybrid_observables.cc b/src/algorithms/observables/adapters/hybrid_observables.cc index cf03f2d2c..9c8971dbd 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.cc +++ b/src/algorithms/observables/adapters/hybrid_observables.cc @@ -51,9 +51,7 @@ HybridObservables::HybridObservables(ConfigurationInterface* configuration, } -HybridObservables::~HybridObservables() -{ -} +HybridObservables::~HybridObservables() = default; void HybridObservables::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc index cbbde6a46..919d635c8 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc @@ -113,7 +113,7 @@ DirectResamplerConditioner::DirectResamplerConditioner( } -DirectResamplerConditioner::~DirectResamplerConditioner() {} +DirectResamplerConditioner::~DirectResamplerConditioner() = default; void DirectResamplerConditioner::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index c59179534..4c5119a4a 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -106,7 +106,9 @@ MmseResamplerConditioner::MmseResamplerConditioner( } -MmseResamplerConditioner::~MmseResamplerConditioner() {} +MmseResamplerConditioner::~MmseResamplerConditioner() = default; + + void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) { if (dump_) diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index 1ec54e2fb..23510b8f3 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -73,9 +73,7 @@ direct_resampler_conditioner_cb::direct_resampler_conditioner_cb( } -direct_resampler_conditioner_cb::~direct_resampler_conditioner_cb() -{ -} +direct_resampler_conditioner_cb::~direct_resampler_conditioner_cb() = default; void direct_resampler_conditioner_cb::forecast(int noutput_items, diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index 1cfa47a50..befc3956b 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -71,9 +71,7 @@ direct_resampler_conditioner_cc::direct_resampler_conditioner_cc( } -direct_resampler_conditioner_cc::~direct_resampler_conditioner_cc() -{ -} +direct_resampler_conditioner_cc::~direct_resampler_conditioner_cc() = default; void direct_resampler_conditioner_cc::forecast(int noutput_items, diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index c8b01f006..3435117d6 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -71,9 +71,7 @@ direct_resampler_conditioner_cs::direct_resampler_conditioner_cs( } -direct_resampler_conditioner_cs::~direct_resampler_conditioner_cs() -{ -} +direct_resampler_conditioner_cs::~direct_resampler_conditioner_cs() = default; void direct_resampler_conditioner_cs::forecast(int noutput_items, diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index b5b7552f4..2620bbbd1 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -149,9 +149,7 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, } -SignalGenerator::~SignalGenerator() -{ -} +SignalGenerator::~SignalGenerator() = default; void SignalGenerator::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index 8efaf2b09..b5f696d83 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -251,9 +251,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, } -FileSignalSource::~FileSignalSource() -{ -} +FileSignalSource::~FileSignalSource() = default; void FileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.cc b/src/algorithms/signal_source/adapters/labsat_signal_source.cc index 3fa0644a0..74bab4803 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.cc +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.cc @@ -83,9 +83,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, } -LabsatSignalSource::~LabsatSignalSource() -{ -} +LabsatSignalSource::~LabsatSignalSource() = default; void LabsatSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index f8f73103b..71669bc1d 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -177,9 +177,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, } -NsrFileSignalSource::~NsrFileSignalSource() -{ -} +NsrFileSignalSource::~NsrFileSignalSource() = default; void NsrFileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 5718067d7..d91783d30 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -139,9 +139,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, } -RtlTcpSignalSource::~RtlTcpSignalSource() -{ -} +RtlTcpSignalSource::~RtlTcpSignalSource() = default; void RtlTcpSignalSource::MakeBlock() diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index 6ddeca2c3..411d3623c 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -176,9 +176,7 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration } -SpirFileSignalSource::~SpirFileSignalSource() -{ -} +SpirFileSignalSource::~SpirFileSignalSource() = default; void SpirFileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index 874cbe2f8..bd7cc1a62 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -181,9 +181,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* } -SpirGSS6450FileSignalSource::~SpirGSS6450FileSignalSource() -{ -} +SpirGSS6450FileSignalSource::~SpirGSS6450FileSignalSource() = default; void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index dc46291c5..8197c3365 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -246,9 +246,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac } -TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource() -{ -} +TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource() = default; void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index eaa5f078b..2efacec39 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -239,9 +239,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, } -UhdSignalSource::~UhdSignalSource() -{ -} +UhdSignalSource::~UhdSignalSource() = default; void UhdSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index 994ae5a22..27f9ae8ef 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -131,9 +131,7 @@ unpack_2bit_samples::unpack_2bit_samples(bool big_endian_bytes, } -unpack_2bit_samples::~unpack_2bit_samples() -{ -} +unpack_2bit_samples::~unpack_2bit_samples() = default; int unpack_2bit_samples::work(int noutput_items, diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc index ae2e2b228..fcdfdb5ab 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc @@ -56,9 +56,7 @@ unpack_byte_2bit_cpx_samples::unpack_byte_2bit_cpx_samples() : sync_interpolator } -unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples() -{ -} +unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples() = default; int unpack_byte_2bit_cpx_samples::work(int noutput_items, diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc index 9f21299f4..796829500 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc @@ -52,9 +52,7 @@ unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack } -unpack_byte_2bit_samples::~unpack_byte_2bit_samples() -{ -} +unpack_byte_2bit_samples::~unpack_byte_2bit_samples() = default; int unpack_byte_2bit_samples::work(int noutput_items, diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc index b3a1d61f7..a176e2c32 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc @@ -47,9 +47,7 @@ unpack_byte_4bit_samples::unpack_byte_4bit_samples() : sync_interpolator("unpack } -unpack_byte_4bit_samples::~unpack_byte_4bit_samples() -{ -} +unpack_byte_4bit_samples::~unpack_byte_4bit_samples() = default; int unpack_byte_4bit_samples::work(int noutput_items, diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc index 5433047ea..3994d2fa4 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc @@ -47,9 +47,7 @@ unpack_intspir_1bit_samples::unpack_intspir_1bit_samples() : sync_interpolator(" } -unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples() -{ -} +unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples() = default; int unpack_intspir_1bit_samples::work(int noutput_items, diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index 8722288d3..180e7d041 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -49,9 +49,8 @@ unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) } -unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples() -{ -} +unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples() = default; + void unpack_spir_gss6450_samples::decode_4bits_word(uint32_t input_uint32, gr_complex* out, int adc_bits) { diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc index f7a663358..cb79cd8b5 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc @@ -69,9 +69,7 @@ GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* c } -GalileoE1BTelemetryDecoder::~GalileoE1BTelemetryDecoder() -{ -} +GalileoE1BTelemetryDecoder::~GalileoE1BTelemetryDecoder() = default; void GalileoE1BTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc index 99ab590ea..ffca2a78a 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc @@ -72,9 +72,7 @@ GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* c } -GalileoE5aTelemetryDecoder::~GalileoE5aTelemetryDecoder() -{ -} +GalileoE5aTelemetryDecoder::~GalileoE5aTelemetryDecoder() = default; void GalileoE5aTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc index 9c991349f..6bec2ae43 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc @@ -68,9 +68,7 @@ GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(ConfigurationInterface* } -GlonassL1CaTelemetryDecoder::~GlonassL1CaTelemetryDecoder() -{ -} +GlonassL1CaTelemetryDecoder::~GlonassL1CaTelemetryDecoder() = default; void GlonassL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc index 8c409316b..cc3aa9b58 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc @@ -67,9 +67,7 @@ GlonassL2CaTelemetryDecoder::GlonassL2CaTelemetryDecoder(ConfigurationInterface* } -GlonassL2CaTelemetryDecoder::~GlonassL2CaTelemetryDecoder() -{ -} +GlonassL2CaTelemetryDecoder::~GlonassL2CaTelemetryDecoder() = default; void GlonassL2CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc index 5a41d6c3d..279ae544f 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc @@ -68,9 +68,7 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu } -GpsL1CaTelemetryDecoder::~GpsL1CaTelemetryDecoder() -{ -} +GpsL1CaTelemetryDecoder::~GpsL1CaTelemetryDecoder() = default; void GpsL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc index fabb55fe9..7bf577643 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc @@ -68,9 +68,7 @@ GpsL2CTelemetryDecoder::GpsL2CTelemetryDecoder(ConfigurationInterface* configura } -GpsL2CTelemetryDecoder::~GpsL2CTelemetryDecoder() -{ -} +GpsL2CTelemetryDecoder::~GpsL2CTelemetryDecoder() = default; void GpsL2CTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc index 172139563..dd053a14a 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc @@ -64,9 +64,7 @@ GpsL5TelemetryDecoder::GpsL5TelemetryDecoder(ConfigurationInterface* configurati } -GpsL5TelemetryDecoder::~GpsL5TelemetryDecoder() -{ -} +GpsL5TelemetryDecoder::~GpsL5TelemetryDecoder() = default; void GpsL5TelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc index 4309b28d8..651671b04 100644 --- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc @@ -66,9 +66,7 @@ SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configura } -SbasL1TelemetryDecoder::~SbasL1TelemetryDecoder() -{ -} +SbasL1TelemetryDecoder::~SbasL1TelemetryDecoder() = default; void SbasL1TelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index 2515788bb..8bdabd64e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -110,9 +110,7 @@ sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() } -sbas_l1_telemetry_decoder_cc::sample_aligner::~sample_aligner() -{ -} +sbas_l1_telemetry_decoder_cc::sample_aligner::~sample_aligner() = default; void sbas_l1_telemetry_decoder_cc::sample_aligner::reset() diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index bb1ff89cd..6f9d5b528 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -45,9 +45,6 @@ using google::LogMessage; -void GalileoE1DllPllVemlTracking::stop_tracking() -{ -} GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( ConfigurationInterface* configuration, std::string role, @@ -157,7 +154,10 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( } -GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking() +GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking() = default; + + +void GalileoE1DllPllVemlTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 5b21f41ee..5b42f8534 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -44,9 +44,6 @@ using google::LogMessage; -void GalileoE1TcpConnectorTracking::stop_tracking() -{ -} GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, std::string role, @@ -113,7 +110,10 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( } -GalileoE1TcpConnectorTracking::~GalileoE1TcpConnectorTracking() +GalileoE1TcpConnectorTracking::~GalileoE1TcpConnectorTracking() = default; + + +void GalileoE1TcpConnectorTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index c3a8244e2..e1654c3fe 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -45,9 +45,6 @@ using google::LogMessage; -void GalileoE5aDllPllTracking::stop_tracking() -{ -} GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( ConfigurationInterface* configuration, std::string role, @@ -154,7 +151,10 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( } -GalileoE5aDllPllTracking::~GalileoE5aDllPllTracking() +GalileoE5aDllPllTracking::~GalileoE5aDllPllTracking() = default; + + +void GalileoE5aDllPllTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc index 2287f53ba..1cc05bf07 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc @@ -46,9 +46,6 @@ using google::LogMessage; -void GlonassL1CaDllPllCAidTracking::stop_tracking() -{ -} GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( ConfigurationInterface* configuration, std::string role, @@ -135,7 +132,10 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( } -GlonassL1CaDllPllCAidTracking::~GlonassL1CaDllPllCAidTracking() +GlonassL1CaDllPllCAidTracking::~GlonassL1CaDllPllCAidTracking() = default; + + +void GlonassL1CaDllPllCAidTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc index eb5f35176..1b1ce8559 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc @@ -45,9 +45,6 @@ using google::LogMessage; -void GlonassL1CaDllPllTracking::stop_tracking() -{ -} GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( ConfigurationInterface* configuration, std::string role, @@ -108,7 +105,10 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( } -GlonassL1CaDllPllTracking::~GlonassL1CaDllPllTracking() +GlonassL1CaDllPllTracking::~GlonassL1CaDllPllTracking() = default; + + +void GlonassL1CaDllPllTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc index d4d0d0e98..dac410e41 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc @@ -44,9 +44,6 @@ using google::LogMessage; -void GlonassL2CaDllPllCAidTracking::stop_tracking() -{ -} GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( ConfigurationInterface* configuration, std::string role, @@ -133,7 +130,10 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( } -GlonassL2CaDllPllCAidTracking::~GlonassL2CaDllPllCAidTracking() +GlonassL2CaDllPllCAidTracking::~GlonassL2CaDllPllCAidTracking() = default; + + +void GlonassL2CaDllPllCAidTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc index a6a49aa1c..e6c40bdc3 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc @@ -43,9 +43,6 @@ using google::LogMessage; -void GlonassL2CaDllPllTracking::stop_tracking() -{ -} GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( ConfigurationInterface* configuration, std::string role, @@ -106,7 +103,10 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( } -GlonassL2CaDllPllTracking::~GlonassL2CaDllPllTracking() +GlonassL2CaDllPllTracking::~GlonassL2CaDllPllTracking() = default; + + +void GlonassL2CaDllPllTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc index c821d311d..143d31e5f 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc @@ -45,9 +45,6 @@ using google::LogMessage; -void GpsL1CaDllPllCAidTracking::stop_tracking() -{ -} GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( ConfigurationInterface* configuration, std::string role, @@ -134,7 +131,10 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( } -GpsL1CaDllPllCAidTracking::~GpsL1CaDllPllCAidTracking() +GpsL1CaDllPllCAidTracking::~GpsL1CaDllPllCAidTracking() = default; + + +void GpsL1CaDllPllCAidTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index b0fff7263..fdb489ac2 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -45,10 +45,6 @@ using google::LogMessage; -void GpsL1CaDllPllTracking::stop_tracking() -{ - tracking_->stop_tracking(); -} GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( ConfigurationInterface* configuration, std::string role, @@ -159,8 +155,12 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( } -GpsL1CaDllPllTracking::~GpsL1CaDllPllTracking() +GpsL1CaDllPllTracking::~GpsL1CaDllPllTracking() = default; + + +void GpsL1CaDllPllTracking::stop_tracking() { + tracking_->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc index 2c33723e6..df5144768 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -47,9 +47,6 @@ using google::LogMessage; -void GpsL1CaKfTracking::stop_tracking() -{ -} GpsL1CaKfTracking::GpsL1CaKfTracking( ConfigurationInterface* configuration, std::string role, @@ -121,7 +118,10 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( } -GpsL1CaKfTracking::~GpsL1CaKfTracking() +GpsL1CaKfTracking::~GpsL1CaKfTracking() = default; + + +void GpsL1CaKfTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index 9e3cf4bfa..dfc97b026 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -43,9 +43,6 @@ using google::LogMessage; -void GpsL1CaTcpConnectorTracking::stop_tracking() -{ -} GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, std::string role, @@ -103,7 +100,10 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( } -GpsL1CaTcpConnectorTracking::~GpsL1CaTcpConnectorTracking() +GpsL1CaTcpConnectorTracking::~GpsL1CaTcpConnectorTracking() = default; + + +void GpsL1CaTcpConnectorTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index f4bb44321..8ce730a75 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -45,9 +45,6 @@ using google::LogMessage; -void GpsL2MDllPllTracking::stop_tracking() -{ -} GpsL2MDllPllTracking::GpsL2MDllPllTracking( ConfigurationInterface* configuration, std::string role, @@ -135,11 +132,13 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( } -GpsL2MDllPllTracking::~GpsL2MDllPllTracking() +GpsL2MDllPllTracking::~GpsL2MDllPllTracking() = default; + + +void GpsL2MDllPllTracking::stop_tracking() { } - void GpsL2MDllPllTracking::start_tracking() { tracking_->start_tracking(); diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 9954777ec..aa80cc582 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -45,9 +45,6 @@ using google::LogMessage; -void GpsL5DllPllTracking::stop_tracking() -{ -} GpsL5DllPllTracking::GpsL5DllPllTracking( ConfigurationInterface* configuration, std::string role, @@ -154,7 +151,10 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( } -GpsL5DllPllTracking::~GpsL5DllPllTracking() +GpsL5DllPllTracking::~GpsL5DllPllTracking() = default; + + +void GpsL5DllPllTracking::stop_tracking() { } diff --git a/src/algorithms/tracking/libs/bayesian_estimation.cc b/src/algorithms/tracking/libs/bayesian_estimation.cc index 30e7d45ec..227cd6321 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.cc +++ b/src/algorithms/tracking/libs/bayesian_estimation.cc @@ -74,9 +74,7 @@ Bayesian_estimator::Bayesian_estimator(const arma::vec& mu_prior_0, int kappa_pr Psi_est = Psi_prior; } -Bayesian_estimator::~Bayesian_estimator() -{ -} +Bayesian_estimator::~Bayesian_estimator() = default; void Bayesian_estimator::init(const arma::mat& mu_prior_0, int kappa_prior_0, int nu_prior_0, const arma::mat& Psi_prior_0) { diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index edba15b7f..24a4d2e0b 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -35,14 +35,10 @@ #include -tcp_communication::tcp_communication() : tcp_socket_(io_service_) -{ -} +tcp_communication::tcp_communication() : tcp_socket_(io_service_) = default; -tcp_communication::~tcp_communication() -{ -} +tcp_communication::~tcp_communication() = default; int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) diff --git a/src/algorithms/tracking/libs/tcp_packet_data.cc b/src/algorithms/tracking/libs/tcp_packet_data.cc index 0bd4fcde6..eb53ff59b 100644 --- a/src/algorithms/tracking/libs/tcp_packet_data.cc +++ b/src/algorithms/tracking/libs/tcp_packet_data.cc @@ -37,4 +37,4 @@ tcp_packet_data::tcp_packet_data() proc_pack_carrier_doppler_hz = 0; } -tcp_packet_data::~tcp_packet_data() {} +tcp_packet_data::~tcp_packet_data() = default; diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc index db7583303..01b8641ea 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc @@ -72,21 +72,23 @@ float Tracking_2nd_DLL_filter::get_code_nco(float DLL_discriminator) return code_nco; } + Tracking_2nd_DLL_filter::Tracking_2nd_DLL_filter(float pdi_code) { d_pdi_code = pdi_code; // Summation interval for code d_dlldampingratio = 0.7; } + Tracking_2nd_DLL_filter::Tracking_2nd_DLL_filter() { d_pdi_code = 0.001; // Summation interval for code d_dlldampingratio = 0.7; } -Tracking_2nd_DLL_filter::~Tracking_2nd_DLL_filter() -{ -} + +Tracking_2nd_DLL_filter::~Tracking_2nd_DLL_filter() = default; + void Tracking_2nd_DLL_filter::set_pdi(float pdi_code) { diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc index ccbc47fff..bf0b0841b 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc @@ -77,6 +77,7 @@ float Tracking_2nd_PLL_filter::get_carrier_nco(float PLL_discriminator) return carr_nco; } + Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter(float pdi_carr) { //--- PLL variables -------------------------------------------------------- @@ -94,9 +95,8 @@ Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter() } -Tracking_2nd_PLL_filter::~Tracking_2nd_PLL_filter() -{ -} +Tracking_2nd_PLL_filter::~Tracking_2nd_PLL_filter() = default; + void Tracking_2nd_PLL_filter::set_pdi(float pdi_carr) { diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc index ffe5152e5..04624d3f4 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc @@ -131,6 +131,4 @@ Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter() } -Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter() -{ -} +Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter() = default; diff --git a/src/core/interfaces/configuration_interface.h b/src/core/interfaces/configuration_interface.h index 9e1947b79..0108f3283 100644 --- a/src/core/interfaces/configuration_interface.h +++ b/src/core/interfaces/configuration_interface.h @@ -52,7 +52,7 @@ class ConfigurationInterface { public: - virtual ~ConfigurationInterface() {} + virtual ~ConfigurationInterface() = default; virtual std::string property(std::string property_name, std::string default_value) = 0; virtual bool property(std::string property_name, bool default_value) = 0; virtual int64_t property(std::string property_name, int64_t default_value) = 0; diff --git a/src/core/interfaces/gnss_block_interface.h b/src/core/interfaces/gnss_block_interface.h index a861d87f8..8a59d14cb 100644 --- a/src/core/interfaces/gnss_block_interface.h +++ b/src/core/interfaces/gnss_block_interface.h @@ -53,7 +53,7 @@ class GNSSBlockInterface { public: - virtual ~GNSSBlockInterface() {} + virtual ~GNSSBlockInterface() = default; virtual std::string role() = 0; virtual std::string implementation() = 0; virtual size_t item_size() = 0; diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index f3774379d..33bf51a47 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -49,7 +49,7 @@ gnss_sdr_supl_client::gnss_sdr_supl_client() } -gnss_sdr_supl_client::~gnss_sdr_supl_client() {} +gnss_sdr_supl_client::~gnss_sdr_supl_client() = default; void gnss_sdr_supl_client::print_assistance() diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 15cba5a40..cccb12857 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -47,9 +47,7 @@ TcpCmdInterface::TcpCmdInterface() } -TcpCmdInterface::~TcpCmdInterface() -{ -} +TcpCmdInterface::~TcpCmdInterface() = default; void TcpCmdInterface::register_functions() diff --git a/src/core/system_parameters/rtcm.h b/src/core/system_parameters/rtcm.h index f450dae05..d8cb53180 100644 --- a/src/core/system_parameters/rtcm.h +++ b/src/core/system_parameters/rtcm.h @@ -597,7 +597,7 @@ private: class Rtcm_Listener { public: - virtual ~Rtcm_Listener() {} + virtual ~Rtcm_Listener() = default; virtual void deliver(const Rtcm_Message& msg) = 0; }; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 6f028cd4a..5d2c18514 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -107,9 +107,7 @@ GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : gr::blo } -GpsL1CaPcpsAcquisitionTest_msg_rx::~GpsL1CaPcpsAcquisitionTest_msg_rx() -{ -} +GpsL1CaPcpsAcquisitionTest_msg_rx::~GpsL1CaPcpsAcquisitionTest_msg_rx() = default; // ########################################################### @@ -127,9 +125,7 @@ protected: doppler_step = 100; } - ~GpsL1CaPcpsAcquisitionTest() - { - } + ~GpsL1CaPcpsAcquisitionTest() = default; void init(); void plot_grid(); diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc index 2aae6e9c6..e5168f4ed 100644 --- a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc @@ -80,9 +80,7 @@ DataTypeAdapter::DataTypeAdapter() } -DataTypeAdapter::~DataTypeAdapter() -{ -} +DataTypeAdapter::~DataTypeAdapter() = default; int DataTypeAdapter::run_ishort_to_cshort_block() diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index 142802256..35f7b1211 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -63,9 +63,7 @@ protected: item_size = sizeof(gr_complex); config = std::make_shared(); } - ~FirFilterTest() - { - } + ~FirFilterTest() = default; void init(); void configure_cbyte_cbyte(); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index 9028403bf..459a096da 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -62,9 +62,7 @@ protected: config = std::make_shared(); nsamples = FLAGS_notch_filter_lite_test_nsamples; } - ~NotchFilterLiteTest() - { - } + ~NotchFilterLiteTest() = default; void init(); void configure_gr_complex_gr_complex(); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc index 2010b646c..aa61101f4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc @@ -62,9 +62,7 @@ protected: config = std::make_shared(); nsamples = FLAGS_notch_filter_test_nsamples; } - ~NotchFilterTest() - { - } + ~NotchFilterTest() = default; void init(); void configure_gr_complex_gr_complex(); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc index 4cff0f421..17c2e49db 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc @@ -62,9 +62,7 @@ protected: config = std::make_shared(); nsamples = FLAGS_pb_filter_test_nsamples; } - ~PulseBlankingFilterTest() - { - } + ~PulseBlankingFilterTest() = default; void init(); void configure_gr_complex_gr_complex(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index 43cfc8c5d..a21271d79 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -234,6 +234,4 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, } -acquisition_dump_reader::~acquisition_dump_reader() -{ -} +acquisition_dump_reader::~acquisition_dump_reader() = default; diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc index 5f7d18b77..c15db4f01 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc @@ -67,4 +67,4 @@ Acquisition_msg_rx::Acquisition_msg_rx() : gr::block("Acquisition_msg_rx", gr::i } -Acquisition_msg_rx::~Acquisition_msg_rx() {} +Acquisition_msg_rx::~Acquisition_msg_rx() = default; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc index fb61cd4bd..372bdef1d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc @@ -65,9 +65,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GalileoE1DllPllVemlTrackingInternalTest() - { - } + ~GalileoE1DllPllVemlTrackingInternalTest() = default; void init(); diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 9fec07116..a9ec8be37 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -53,9 +53,9 @@ extern concurrent_map global_gps_utc_model_map; extern concurrent_map global_gps_almanac_map; extern concurrent_map global_gps_acq_assist_map; -FrontEndCal::FrontEndCal() {} +FrontEndCal::FrontEndCal() = default; -FrontEndCal::~FrontEndCal() {} +FrontEndCal::~FrontEndCal() = default; bool FrontEndCal::read_assistance_from_XML() { diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index c3f129803..920447aca 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -144,7 +144,9 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i } -FrontEndCal_msg_rx::~FrontEndCal_msg_rx() {} +FrontEndCal_msg_rx::~FrontEndCal_msg_rx() = default; + + void wait_message() { while (!stop) From 8319c2d33a0b301694621fd821693678c5a09491 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 11:19:24 +0100 Subject: [PATCH 52/52] Fix building --- src/algorithms/tracking/libs/tcp_communication.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index 24a4d2e0b..edba15b7f 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -35,10 +35,14 @@ #include -tcp_communication::tcp_communication() : tcp_socket_(io_service_) = default; +tcp_communication::tcp_communication() : tcp_socket_(io_service_) +{ +} -tcp_communication::~tcp_communication() = default; +tcp_communication::~tcp_communication() +{ +} int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_)