1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00
This commit is contained in:
Carles Fernandez 2019-02-21 13:37:24 +01:00
commit 7f0b11ce3d
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
22 changed files with 73 additions and 34 deletions

View File

@ -18,6 +18,7 @@ Checks: '-*,
misc-static-assert, misc-static-assert,
misc-throw-by-value-catch-by-reference, misc-throw-by-value-catch-by-reference,
misc-uniqueptr-reset-release, misc-uniqueptr-reset-release,
misc-unused-using-decls,
modernize-loop-convert, modernize-loop-convert,
modernize-pass-by-value, modernize-pass-by-value,
modernize-raw-string-literal, modernize-raw-string-literal,

View File

@ -51,6 +51,8 @@ target_link_libraries(input_filter_adapters
input_filter_gr_blocks input_filter_gr_blocks
algorithms_libs algorithms_libs
PRIVATE PRIVATE
Gflags::gflags
Glog::glog
Volk::volk Volk::volk
) )

View File

@ -46,8 +46,6 @@ target_link_libraries(input_filter_gr_blocks
Gnuradio::filter Gnuradio::filter
Volkgnsssdr::volkgnsssdr Volkgnsssdr::volkgnsssdr
PRIVATE PRIVATE
Gflags::gflags
Glog::glog
Log4cpp::log4cpp Log4cpp::log4cpp
) )

View File

@ -30,13 +30,11 @@
#include "notch_cc.h" #include "notch_cc.h"
#include <boost/math/distributions/chi_squared.hpp> #include <boost/math/distributions/chi_squared.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
using google::LogMessage;
notch_sptr make_notch_filter(float pfa, float p_c_factor, notch_sptr make_notch_filter(float pfa, float p_c_factor,
int32_t length_, int32_t n_segments_est, int32_t n_segments_reset) int32_t length_, int32_t n_segments_est, int32_t n_segments_reset)

View File

@ -30,13 +30,11 @@
#include "notch_lite_cc.h" #include "notch_lite_cc.h"
#include <boost/math/distributions/chi_squared.hpp> #include <boost/math/distributions/chi_squared.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
using google::LogMessage;
notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff) notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff)
{ {

View File

@ -30,12 +30,10 @@
#include "pulse_blanking_cc.h" #include "pulse_blanking_cc.h"
#include <boost/math/distributions/chi_squared.hpp> #include <boost/math/distributions/chi_squared.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <cmath> #include <cmath>
using google::LogMessage;
pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_,
int32_t n_segments_est, int32_t n_segments_reset) int32_t n_segments_est, int32_t n_segments_reset)

View File

@ -119,7 +119,7 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _pr
//--- Make index array to read L2C code values ------------------------- //--- Make index array to read L2C code values -------------------------
//TODO: Check this formula! Seems to start with an extra sample //TODO: Check this formula! Seems to start with an extra sample
_codeValueIndex = ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1; _codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
//aux = (_ts * (i + 1)) / _tc; //aux = (_ts * (i + 1)) / _tc;
//_codeValueIndex = static_cast<int32_t>(static_cast<long>(aux)) - 1; //_codeValueIndex = static_cast<int32_t>(static_cast<long>(aux)) - 1;

View File

@ -240,7 +240,7 @@ void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn,
//--- Make index array to read L5 code values ------------------------- //--- Make index array to read L5 code values -------------------------
//TODO: Check this formula! Seems to start with an extra sample //TODO: Check this formula! Seems to start with an extra sample
_codeValueIndex = ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1; _codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
//aux = (_ts * (i + 1)) / _tc; //aux = (_ts * (i + 1)) / _tc;
//_codeValueIndex = static_cast<int32_t> (static_cast<long>(aux)) - 1; //_codeValueIndex = static_cast<int32_t> (static_cast<long>(aux)) - 1;
@ -325,7 +325,7 @@ void gps_l5q_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn,
//--- Make index array to read L5 code values ------------------------- //--- Make index array to read L5 code values -------------------------
//TODO: Check this formula! Seems to start with an extra sample //TODO: Check this formula! Seems to start with an extra sample
_codeValueIndex = ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1; _codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
//aux = (_ts * (i + 1)) / _tc; //aux = (_ts * (i + 1)) / _tc;
//_codeValueIndex = static_cast<int32_t> (static_cast<long>(aux)) - 1; //_codeValueIndex = static_cast<int32_t> (static_cast<long>(aux)) - 1;

View File

@ -43,9 +43,6 @@ target_link_libraries(resampler_gr_blocks
PUBLIC PUBLIC
Gnuradio::runtime Gnuradio::runtime
Volk::volk Volk::volk
PRIVATE
Gflags::gflags
Glog::glog
) )
if(ENABLE_CLANG_TIDY) if(ENABLE_CLANG_TIDY)

View File

@ -33,12 +33,9 @@
#include "direct_resampler_conditioner_cb.h" #include "direct_resampler_conditioner_cb.h"
#include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
using google::LogMessage;
direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb( direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(
double sample_freq_in, double sample_freq_out) double sample_freq_in, double sample_freq_out)
{ {

View File

@ -37,8 +37,6 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
using google::LogMessage;
direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc( direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
double sample_freq_in, double sample_freq_out) double sample_freq_in, double sample_freq_out)
{ {

View File

@ -33,10 +33,8 @@
#include "direct_resampler_conditioner_cs.h" #include "direct_resampler_conditioner_cs.h"
#include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
using google::LogMessage;
direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(
double sample_freq_in, double sample_freq_out) double sample_freq_in, double sample_freq_out)
@ -49,7 +47,9 @@ direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(
direct_resampler_conditioner_cs::direct_resampler_conditioner_cs( direct_resampler_conditioner_cs::direct_resampler_conditioner_cs(
double sample_freq_in, double sample_freq_in,
double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs",
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)),
gr::io_signature::make(1, 1, sizeof(lv_16sc_t))),
d_sample_freq_in(sample_freq_in), d_sample_freq_in(sample_freq_in),
d_sample_freq_out(sample_freq_out), d_sample_freq_out(sample_freq_out),
d_phase(0), d_phase(0),

View File

@ -321,8 +321,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
float acq_trk_shif_correction_samples; float acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
current_synchro_data.fs = d_fs_in; current_synchro_data.fs = d_fs_in;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;

View File

@ -574,7 +574,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
double acq_trk_shif_correction_samples; double acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples

View File

@ -574,7 +574,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
double acq_trk_shif_correction_samples; double acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples

View File

@ -204,7 +204,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in); T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in);
d_next_prn_length_samples = round(T_prn_mod_samples); d_next_prn_length_samples = std::round(T_prn_mod_samples);
float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
float T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in); float T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in);
@ -213,7 +213,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
float N_prn_diff; float N_prn_diff;
N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
float corrected_acq_phase_samples, delay_correction_samples; float corrected_acq_phase_samples, delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples; corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples;
@ -357,8 +357,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
float acq_trk_shif_correction_samples; float acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_length_samples)); acq_trk_shif_correction_samples = d_next_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
current_synchro_data.fs = d_fs_in; current_synchro_data.fs = d_fs_in;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;

View File

@ -64,7 +64,7 @@ double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double
*/ */
double pll_four_quadrant_atan(gr_complex prompt_s1) double pll_four_quadrant_atan(gr_complex prompt_s1)
{ {
return atan2(prompt_s1.imag(), prompt_s1.real()); return static_cast<double>(std::atan2(prompt_s1.imag(), prompt_s1.real()));
} }
@ -79,7 +79,7 @@ double pll_cloop_two_quadrant_atan(gr_complex prompt_s1)
{ {
if (prompt_s1.real() != 0.0) if (prompt_s1.real() != 0.0)
{ {
return atan(prompt_s1.imag() / prompt_s1.real()); return static_cast<double>(std::atan(prompt_s1.imag() / prompt_s1.real()));
} }
return 0.0; return 0.0;
} }

View File

@ -241,7 +241,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
################################################################################ ################################################################################
find_package(GPSTK) find_package(GPSTK)
if(NOT GPSTK_FOUND OR ENABLE_OWN_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'.") 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(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
@ -404,6 +404,14 @@ if(ENABLE_UNIT_TESTING)
) )
endif() endif()
endif() endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(run_tests
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
if(ENABLE_CUDA) if(ENABLE_CUDA)
target_link_libraries(run_tests target_link_libraries(run_tests
PUBLIC PUBLIC
@ -476,6 +484,14 @@ function(add_system_test executable)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${executable}> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${executable}>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:${executable}>) ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:${executable}>)
endif() endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(${executable}
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
endfunction() endfunction()

View File

@ -2003,7 +2003,7 @@ void Gnuplot::init()
// whose name is specified as argument. If the requested variable is not // whose name is specified as argument. If the requested variable is not
// part of the environment list, the function returns a NULL pointer. // part of the environment list, the function returns a NULL pointer.
#if (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__APPLE__) #if (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__APPLE__)
if (std::getenv("DISPLAY") == NULL) if (std::getenv("DISPLAY") == nullptr)
{ {
valid = false; valid = false;
throw GnuplotException("Can't find DISPLAY variable"); throw GnuplotException("Can't find DISPLAY variable");

View File

@ -41,6 +41,15 @@ target_link_libraries(system_testing_lib
Matio::matio Matio::matio
) )
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(system_testing_lib
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET system_testing_lib set_property(TARGET system_testing_lib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -48,6 +48,15 @@ target_link_libraries(signal_processing_testing_lib
Glog::glog Glog::glog
) )
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(signal_processing_testing_lib
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET signal_processing_testing_lib set_property(TARGET signal_processing_testing_lib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -46,6 +46,15 @@ target_link_libraries(front_end_cal_lib
Boost::thread Boost::thread
) )
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(front_end_cal_lib
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
target_link_libraries(front-end-cal target_link_libraries(front-end-cal
@ -65,6 +74,15 @@ target_compile_definitions(front-end-cal
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
) )
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(front-end-cal
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
add_custom_command(TARGET front-end-cal POST_BUILD add_custom_command(TARGET front-end-cal POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:front-end-cal> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:front-end-cal>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:front-end-cal>) ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:front-end-cal>)