mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into release_0010
This commit is contained in:
		
							
								
								
									
										3
									
								
								.clang-tidy
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.clang-tidy
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | --- | ||||||
|  | Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,readability-named-parameter,readability-string-compare' | ||||||
|  | HeaderFilterRegex: '.*' | ||||||
| @@ -1131,7 +1131,13 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS | |||||||
|                 endif() |                 endif() | ||||||
|                 message(FATAL_ERROR "libtool is required to build matio from source") |                 message(FATAL_ERROR "libtool is required to build matio from source") | ||||||
|             endif() |             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") |             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.") |                 message(STATUS "Automake found.") | ||||||
|             else() |             else() | ||||||
|                 message(" aclocal has not been found.") |                 message(" aclocal has not been found.") | ||||||
| @@ -1612,6 +1618,26 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU | |||||||
| endif() | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ######################################################################## | ||||||
|  | # clang-tidy https://clang.llvm.org/extra/clang-tidy/index.html | ||||||
|  | ######################################################################## | ||||||
|  | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||||||
|  |     if(NOT (CMAKE_VERSION VERSION_LESS "3.6")) | ||||||
|  |         find_program( | ||||||
|  |             CLANG_TIDY_EXE | ||||||
|  |             NAMES "clang-tidy" | ||||||
|  |             DOC "Path to clang-tidy executable" | ||||||
|  |         ) | ||||||
|  |         if(NOT CLANG_TIDY_EXE) | ||||||
|  |             message(STATUS "clang-tidy not found.") | ||||||
|  |         else() | ||||||
|  |             message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") | ||||||
|  |             set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*") | ||||||
|  |             set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||||||
|  |         endif() | ||||||
|  |     endif() | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Create uninstall target | # Create uninstall target | ||||||
|   | |||||||
| @@ -18,20 +18,20 @@ | |||||||
| ########################################################## | ########################################################## | ||||||
| # Toolchain file for Open Embedded | # 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 MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT}) | ||||||
| string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) | string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) | ||||||
|  |  | ||||||
| set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE ) | 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_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_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_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 $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT}) | ||||||
| set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||||||
| set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||||||
| set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||||||
|  |  | ||||||
| set ( ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4 ) | 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_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib) | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ | |||||||
|  |  | ||||||
| if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||||||
|   message(FATAL_ERROR "Cannot find install manifest: @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) | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) | ||||||
| string(REGEX REPLACE "\n" ";" files "${files}") | string(REGEX REPLACE "\n" ";" files "${files}") | ||||||
| @@ -28,11 +28,11 @@ foreach(file ${files}) | |||||||
|       COMMAND @CMAKE_COMMAND@ -E remove \"$ENV{DESTDIR}${file}\" |       COMMAND @CMAKE_COMMAND@ -E remove \"$ENV{DESTDIR}${file}\" | ||||||
|       OUTPUT_VARIABLE rm_out |       OUTPUT_VARIABLE rm_out | ||||||
|       RESULT_VARIABLE rm_retval |       RESULT_VARIABLE rm_retval | ||||||
|       ) |     ) | ||||||
|     if(NOT "${rm_retval}" STREQUAL 0) |     if(NOT "${rm_retval}" STREQUAL 0) | ||||||
|       message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") |       message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") | ||||||
|     endif(NOT "${rm_retval}" STREQUAL 0) |     endif() | ||||||
|   else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") |   else() | ||||||
|     message(STATUS "File $ENV{DESTDIR}${file} does not exist.") |     message(STATUS "File $ENV{DESTDIR}${file} does not exist.") | ||||||
|   endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") |   endif() | ||||||
| endforeach(file) | endforeach() | ||||||
|   | |||||||
| @@ -71,6 +71,7 @@ This release has several improvements in different dimensions, addition of new f | |||||||
| - 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: 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: 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. | - Improvement in C++ usage: Enhanced const correctness. Misuses of those variables are detected by the compiler. | ||||||
|  | - Improved code with clang-tidy and generation of a compile_commands.json file containing the exact compiler calls for all translation units of the project in machine-readable form if clang-tidy is detected. | ||||||
| - Applied some style rules to CMake scripts. | - Applied some style rules to CMake scripts. | ||||||
| - Minimal versions of dependencies identified and detected. | - Minimal versions of dependencies identified and detected. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -49,30 +49,10 @@ namespace bc = boost::integer; | |||||||
| using google::LogMessage; | 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, | RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | ||||||
|     std::string role, |     const std::string& role, | ||||||
|     unsigned int in_streams, |     unsigned int in_streams, | ||||||
|     unsigned int out_streams) : role_(role), |     unsigned int out_streams) : role_(std::move(role)), | ||||||
|                                 in_streams_(in_streams), |                                 in_streams_(in_streams), | ||||||
|                                 out_streams_(out_streams) |                                 out_streams_(out_streams) | ||||||
| { | { | ||||||
| @@ -100,27 +80,27 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | |||||||
|  |  | ||||||
|     // RINEX version |     // RINEX version | ||||||
|     pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3); |     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; |             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; |             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; |             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; |             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; |             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; |             pvt_output_parameters.rinex_version = 2; | ||||||
|         } |         } | ||||||
| @@ -240,11 +220,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | |||||||
|     int positioning_mode = -1; |     int positioning_mode = -1; | ||||||
|     std::string default_pos_mode("Single"); |     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 |     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 == "Single") positioning_mode = PMODE_SINGLE; | ||||||
|     if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; |     if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC; | ||||||
|     if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; |     if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA; | ||||||
|     if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; |     if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC; | ||||||
|     if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; |     if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA; | ||||||
|  |  | ||||||
|     if (positioning_mode == -1) |     if (positioning_mode == -1) | ||||||
|         { |         { | ||||||
| @@ -289,12 +269,12 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | |||||||
|     std::string default_iono_model("OFF"); |     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 */ |     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; |     int iono_model = -1; | ||||||
|     if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; |     if (iono_model_str == "OFF") iono_model = IONOOPT_OFF; | ||||||
|     if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; |     if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC; | ||||||
|     if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; |     if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS; | ||||||
|     if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; |     if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC; | ||||||
|     if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; |     if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST; | ||||||
|     if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; |     if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC; | ||||||
|     if (iono_model == -1) |     if (iono_model == -1) | ||||||
|         { |         { | ||||||
|             //warn user and set the default |             //warn user and set the default | ||||||
| @@ -308,11 +288,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | |||||||
|     std::string default_trop_model("OFF"); |     std::string default_trop_model("OFF"); | ||||||
|     int trop_model = -1; |     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 */ |     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 == "OFF") trop_model = TROPOPT_OFF; | ||||||
|     if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; |     if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS; | ||||||
|     if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; |     if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS; | ||||||
|     if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; |     if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST; | ||||||
|     if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; |     if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG; | ||||||
|     if (trop_model == -1) |     if (trop_model == -1) | ||||||
|         { |         { | ||||||
|             //warn user and set the default |             //warn user and set the default | ||||||
| @@ -357,11 +337,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | |||||||
|     std::string default_gps_ar("Continuous"); |     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) */ |     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; |     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 == "OFF") 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 == "Continuous") 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 == "Instantaneous") 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 == "Fix-and-Hold") 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 == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR; | ||||||
|     if (integer_ambiguity_resolution_gps == -1) |     if (integer_ambiguity_resolution_gps == -1) | ||||||
|         { |         { | ||||||
|             //warn user and set the default |             //warn user and set the default | ||||||
| @@ -391,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, |     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. */ |                                                                                                                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. */ |                                                                                                          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. |     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. | ||||||
| @@ -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<int, Gps_Ephemeris> RtklibPvt::get_gps_ephemeris() const | std::map<int, Gps_Ephemeris> RtklibPvt::get_gps_ephemeris() const | ||||||
| { | { | ||||||
|     return pvt_->get_gps_ephemeris_map(); |     return pvt_->get_gps_ephemeris_map(); | ||||||
|   | |||||||
| @@ -46,7 +46,7 @@ class RtklibPvt : public PvtInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     RtklibPvt(ConfigurationInterface* configuration, |     RtklibPvt(ConfigurationInterface* configuration, | ||||||
|         std::string role, |         const std::string& role, | ||||||
|         unsigned int in_streams, |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
| @@ -94,7 +94,7 @@ public: | |||||||
|  |  | ||||||
| private: | private: | ||||||
|     rtklib_pvt_cc_sptr pvt_; |     rtklib_pvt_cc_sptr pvt_; | ||||||
|     rtk_t rtk; |     rtk_t rtk{}; | ||||||
|     std::string role_; |     std::string role_; | ||||||
|     unsigned int in_streams_; |     unsigned int in_streams_; | ||||||
|     unsigned int out_streams_; |     unsigned int out_streams_; | ||||||
|   | |||||||
| @@ -29,11 +29,11 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "rtklib_pvt_cc.h" | #include "rtklib_pvt_cc.h" | ||||||
|  | #include "display.h" | ||||||
| #include "galileo_almanac.h" | #include "galileo_almanac.h" | ||||||
| #include "galileo_almanac_helper.h" | #include "galileo_almanac_helper.h" | ||||||
| #include "pvt_conf.h" |  | ||||||
| #include "display.h" |  | ||||||
| #include "gnss_sdr_create_directory.h" | #include "gnss_sdr_create_directory.h" | ||||||
|  | #include "pvt_conf.h" | ||||||
| #include <boost/archive/xml_oarchive.hpp> | #include <boost/archive/xml_oarchive.hpp> | ||||||
| #include <boost/archive/xml_iarchive.hpp> | #include <boost/archive/xml_iarchive.hpp> | ||||||
| #include <boost/exception/all.hpp> | #include <boost/exception/all.hpp> | ||||||
| @@ -59,7 +59,7 @@ using google::LogMessage; | |||||||
|  |  | ||||||
| rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, | rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, | ||||||
|     const Pvt_Conf& conf_, |     const Pvt_Conf& conf_, | ||||||
|     rtk_t& rtk) |     const rtk_t& rtk) | ||||||
| { | { | ||||||
|     return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, |     return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, | ||||||
|         conf_, |         conf_, | ||||||
| @@ -268,9 +268,9 @@ void rtklib_pvt_cc::clear_ephemeris() | |||||||
|  |  | ||||||
| rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, | rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, | ||||||
|     const Pvt_Conf& conf_, |     const Pvt_Conf& conf_, | ||||||
|     rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", |     const rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", | ||||||
|                       gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), |                             gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), | ||||||
|                       gr::io_signature::make(0, 0, 0)) |                             gr::io_signature::make(0, 0, 0)) | ||||||
| { | { | ||||||
|     d_output_rate_ms = conf_.output_rate_ms; |     d_output_rate_ms = conf_.output_rate_ms; | ||||||
|     d_display_rate_ms = conf_.display_rate_ms; |     d_display_rate_ms = conf_.display_rate_ms; | ||||||
| @@ -492,7 +492,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, | |||||||
|                 { |                 { | ||||||
|                     xml_base_path = p.string(); |                     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; |                     std::cout << "XML files will be stored at " << xml_base_path << std::endl; | ||||||
|                 } |                 } | ||||||
| @@ -514,7 +514,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, | |||||||
|     if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) |     if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) | ||||||
|         { |         { | ||||||
|             std::cout << "GNSS-SDR can not create message queues!" << std::endl; |             std::cout << "GNSS-SDR can not create message queues!" << std::endl; | ||||||
|             throw new std::exception(); |             throw std::exception(); | ||||||
|         } |         } | ||||||
|     start = std::chrono::system_clock::now(); |     start = std::chrono::system_clock::now(); | ||||||
| } | } | ||||||
| @@ -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) |     if (gnss_observables_map.empty() == false) | ||||||
|         { |         { | ||||||
| @@ -877,15 +877,13 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string file_name) | |||||||
|                 } |                 } | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << "Failed to save gnss_synchro, map is empty"; | ||||||
|             LOG(WARNING) << "Failed to save gnss_synchro, map is empty"; |     return false; | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| 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) |     // load from xml (boost serialize) | ||||||
|     std::ifstream ifs; |     std::ifstream ifs; | ||||||
| @@ -925,10 +923,8 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, | |||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     return false; | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -959,7 +955,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                             std::map<int, Galileo_Ephemeris>::const_iterator tmp_eph_iter_gal = d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); |                             std::map<int, Galileo_Ephemeris>::const_iterator tmp_eph_iter_gal = d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); | ||||||
|                             std::map<int, Gps_CNAV_Ephemeris>::const_iterator tmp_eph_iter_cnav = d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); |                             std::map<int, Gps_CNAV_Ephemeris>::const_iterator tmp_eph_iter_cnav = d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); | ||||||
|                             std::map<int, Glonass_Gnav_Ephemeris>::const_iterator tmp_eph_iter_glo_gnav = d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); |                             std::map<int, Glonass_Gnav_Ephemeris>::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. |                                     // store valid observables in a map. | ||||||
|                                     gnss_observables_map.insert(std::pair<int, Gnss_Synchro>(i, in[i][epoch])); |                                     gnss_observables_map.insert(std::pair<int, Gnss_Synchro>(i, in[i][epoch])); | ||||||
| @@ -1015,7 +1017,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|             if (gnss_observables_map.empty() == false) |             if (gnss_observables_map.empty() == false) | ||||||
|                 { |                 { | ||||||
|                     double current_RX_time = gnss_observables_map.begin()->second.RX_time; |                     double current_RX_time = gnss_observables_map.begin()->second.RX_time; | ||||||
|                     uint32_t current_RX_time_ms = static_cast<uint32_t>(current_RX_time * 1000.0); |                     auto current_RX_time_ms = static_cast<uint32_t>(current_RX_time * 1000.0); | ||||||
|                     if (current_RX_time_ms % d_output_rate_ms == 0) |                     if (current_RX_time_ms % d_output_rate_ms == 0) | ||||||
|                         { |                         { | ||||||
|                             flag_compute_pvt_output = true; |                             flag_compute_pvt_output = true; | ||||||
| @@ -1893,7 +1895,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -1905,7 +1907,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (gal_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) | ||||||
| @@ -2013,7 +2015,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2025,7 +2027,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2073,7 +2075,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gal_channel == 0) |                                                                             if (gal_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("E") == 0) |                                                                                     if (system == "E") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2085,7 +2087,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2132,7 +2134,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2144,7 +2146,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2191,7 +2193,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gal_channel == 0) |                                                                             if (gal_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("E") == 0) |                                                                                     if (system == "E") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2203,7 +2205,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2250,7 +2252,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gal_channel == 0) |                                                                             if (gal_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("E") == 0) |                                                                                     if (system == "E") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2262,7 +2264,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (gps_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) | ||||||
| @@ -2395,7 +2397,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2407,7 +2409,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (gal_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) | ||||||
| @@ -2513,7 +2515,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2525,7 +2527,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2573,7 +2575,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gal_channel == 0) |                                                                             if (gal_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("E") == 0) |                                                                                     if (system == "E") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2585,7 +2587,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2633,7 +2635,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2645,7 +2647,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2694,7 +2696,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gal_channel == 0) |                                                                             if (gal_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("E") == 0) |                                                                                     if (system == "E") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2706,7 +2708,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (glo_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) | ||||||
| @@ -2754,7 +2756,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); |                                                                             std::string system(&gnss_observables_iter->second.System, 1); | ||||||
|                                                                             if (gps_channel == 0) |                                                                             if (gps_channel == 0) | ||||||
|                                                                                 { |                                                                                 { | ||||||
|                                                                                     if (system.compare("G") == 0) |                                                                                     if (system == "G") | ||||||
|                                                                                         { |                                                                                         { | ||||||
|                                                                                             // This is a channel with valid GPS signal |                                                                                             // This is a channel with valid GPS signal | ||||||
|                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                                                                             gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -2766,7 +2768,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item | |||||||
|                                                                                 } |                                                                                 } | ||||||
|                                                                             if (gal_channel == 0) |                                                                             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); |                                                                                             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()) |                                                                                             if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) | ||||||
|   | |||||||
| @@ -59,7 +59,7 @@ typedef boost::shared_ptr<rtklib_pvt_cc> rtklib_pvt_cc_sptr; | |||||||
|  |  | ||||||
| rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, | rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, | ||||||
|     const Pvt_Conf& conf_, |     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 |  * \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: | private: | ||||||
|     friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, |     friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, | ||||||
|         const Pvt_Conf& conf_, |         const Pvt_Conf& conf_, | ||||||
|         rtk_t& rtk); |         const rtk_t& rtk); | ||||||
|  |  | ||||||
|     void msg_handler_telemetry(pmt::pmt_t msg); |     void msg_handler_telemetry(pmt::pmt_t msg); | ||||||
|  |  | ||||||
| @@ -131,9 +131,9 @@ private: | |||||||
|     bool send_sys_v_ttff_msg(ttff_msgbuf ttff); |     bool send_sys_v_ttff_msg(ttff_msgbuf ttff); | ||||||
|     std::chrono::time_point<std::chrono::system_clock> start, end; |     std::chrono::time_point<std::chrono::system_clock> 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; |     bool d_xml_storage; | ||||||
|     std::string xml_base_path; |     std::string xml_base_path; | ||||||
| @@ -147,7 +147,7 @@ private: | |||||||
| public: | public: | ||||||
|     rtklib_pvt_cc(uint32_t nchannels, |     rtklib_pvt_cc(uint32_t nchannels, | ||||||
|         const Pvt_Conf& conf_, |         const Pvt_Conf& conf_, | ||||||
|         rtk_t& rtk); |         const rtk_t& rtk); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Get latest set of ephemeris from PVT block |      * \brief Get latest set of ephemeris from PVT block | ||||||
|   | |||||||
| @@ -80,8 +80,7 @@ else() | |||||||
|     ) |     ) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| target_link_libraries( | target_link_libraries(pvt_lib | ||||||
|     pvt_lib |  | ||||||
|     rtklib_lib |     rtklib_lib | ||||||
|     gnss_sdr_flags |     gnss_sdr_flags | ||||||
|     gnss_sp_libs |     gnss_sp_libs | ||||||
|   | |||||||
| @@ -68,7 +68,7 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) | |||||||
|         { |         { | ||||||
|             geojson_base_path = p.string(); |             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; |             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(); |     boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); | ||||||
|     tm timeinfo = boost::posix_time::to_tm(pt); |     tm timeinfo = boost::posix_time::to_tm(pt); | ||||||
| @@ -140,28 +140,24 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|             DLOG(INFO) << "GeoJSON printer writing on " << filename.c_str(); |             DLOG(INFO) << "GeoJSON printer writing on " << filename.c_str(); | ||||||
|  |  | ||||||
|             // Set iostream numeric format and precision |             // 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); |             geojson_file << std::setprecision(14); | ||||||
|  |  | ||||||
|             // Writing the header |             // Writing the header | ||||||
|             geojson_file << "{" << std::endl; |             geojson_file << "{" << std::endl; | ||||||
|             geojson_file << "  \"type\":  \"Feature\"," << std::endl; |             geojson_file << R"(  "type":  "Feature",)" << std::endl; | ||||||
|             geojson_file << "  \"properties\": {" << std::endl; |             geojson_file << "  \"properties\": {" << std::endl; | ||||||
|             geojson_file << "       \"name\": \"Locations generated by GNSS-SDR\" " << std::endl; |             geojson_file << R"(       "name": "Locations generated by GNSS-SDR" )" << std::endl; | ||||||
|             geojson_file << "   }," << std::endl; |             geojson_file << "   }," << std::endl; | ||||||
|  |  | ||||||
|  |  | ||||||
|             geojson_file << "  \"geometry\": {" << std::endl; |             geojson_file << "  \"geometry\": {" << std::endl; | ||||||
|             geojson_file << "      \"type\": \"MultiPoint\"," << std::endl; |             geojson_file << R"(      "type": "MultiPoint",)" << std::endl; | ||||||
|             geojson_file << "      \"coordinates\": [" << std::endl; |             geojson_file << "      \"coordinates\": [" << std::endl; | ||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl; | ||||||
|             std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl; |     return false; | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -171,7 +167,7 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi | |||||||
|     double longitude; |     double longitude; | ||||||
|     double height; |     double height; | ||||||
|  |  | ||||||
|     std::shared_ptr<Pvt_Solution> position_ = position; |     const std::shared_ptr<Pvt_Solution>& position_ = position; | ||||||
|  |  | ||||||
|     if (print_average_values == false) |     if (print_average_values == false) | ||||||
|         { |         { | ||||||
| @@ -200,10 +196,7 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi | |||||||
|                 } |                 } | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -222,11 +215,7 @@ bool GeoJSON_Printer::close_file() | |||||||
|                 { |                 { | ||||||
|                     if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; |                     if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -55,7 +55,7 @@ private: | |||||||
| public: | public: | ||||||
|     GeoJSON_Printer(const std::string& base_path = "."); |     GeoJSON_Printer(const std::string& base_path = "."); | ||||||
|     ~GeoJSON_Printer(); |     ~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<Pvt_Solution>& position, bool print_average_values); |     bool print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values); | ||||||
|     bool close_file(); |     bool close_file(); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -70,7 +70,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) | |||||||
|         { |         { | ||||||
|             gpx_base_path = p.string(); |             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; |             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(); |     boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); | ||||||
|     tm timeinfo = boost::posix_time::to_tm(pt); |     tm timeinfo = boost::posix_time::to_tm(pt); | ||||||
| @@ -134,10 +134,10 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|         { |         { | ||||||
|             DLOG(INFO) << "GPX printer writing on " << filename.c_str(); |             DLOG(INFO) << "GPX printer writing on " << filename.c_str(); | ||||||
|             // Set iostream numeric format and precision |             // 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::setprecision(14); | ||||||
|             gpx_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl |             gpx_file << R"(<?xml version="1.0" encoding="UTF-8"?>)" << std::endl | ||||||
|                      << "<gpx version=\"1.1\" creator=\"GNSS-SDR\"" << std::endl |                      << R"(<gpx version="1.1" creator="GNSS-SDR")" << std::endl | ||||||
|                      << indent << "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 http://www.garmin.com/xmlschemas/TrackPointExtensionv2.xsd\"" << std::endl |                      << indent << "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 http://www.garmin.com/xmlschemas/TrackPointExtensionv2.xsd\"" << std::endl | ||||||
|                      << indent << "xmlns=\"http://www.topografix.com/GPX/1/1\"" << std::endl |                      << indent << "xmlns=\"http://www.topografix.com/GPX/1/1\"" << std::endl | ||||||
|                      << indent << "xmlns:gpxx=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3\"" << std::endl |                      << indent << "xmlns:gpxx=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3\"" << std::endl | ||||||
| @@ -149,11 +149,8 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|                      << indent << indent << "<trkseg>" << std::endl; |                      << indent << indent << "<trkseg>" << std::endl; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl; | ||||||
|         { |     return false; | ||||||
|             std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -164,7 +161,7 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, | |||||||
|     double height; |     double height; | ||||||
|  |  | ||||||
|     positions_printed = true; |     positions_printed = true; | ||||||
|     std::shared_ptr<rtklib_solver> position_ = position; |     const std::shared_ptr<rtklib_solver>& position_ = position; | ||||||
|  |  | ||||||
|     double speed_over_ground = position_->get_speed_over_ground();    // expressed in m/s |     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 |     double course_over_ground = position_->get_course_over_ground();  // expressed in deg | ||||||
| @@ -201,10 +198,7 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, | |||||||
|                      << "</gpxtpx:TrackPointExtension></extensions></trkpt>" << std::endl; |                      << "</gpxtpx:TrackPointExtension></extensions></trkpt>" << std::endl; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -218,10 +212,7 @@ bool Gpx_Printer::close_file() | |||||||
|             gpx_file.close(); |             gpx_file.close(); | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -57,7 +57,7 @@ private: | |||||||
| public: | public: | ||||||
|     Gpx_Printer(const std::string& base_path = "."); |     Gpx_Printer(const std::string& base_path = "."); | ||||||
|     ~Gpx_Printer(); |     ~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<rtklib_solver>& position, bool print_average_values); |     bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values); | ||||||
|     bool close_file(); |     bool close_file(); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -34,6 +34,7 @@ | |||||||
| #include "GPS_L1_CA.h" | #include "GPS_L1_CA.h" | ||||||
| #include "GPS_L2C.h" | #include "GPS_L2C.h" | ||||||
| #include <boost/date_time/posix_time/posix_time.hpp> | #include <boost/date_time/posix_time/posix_time.hpp> | ||||||
|  | #include <utility> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -43,7 +44,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag | |||||||
| { | { | ||||||
|     // init empty ephemeris for all the available GNSS channels |     // init empty ephemeris for all the available GNSS channels | ||||||
|     d_nchannels = nchannels; |     d_nchannels = nchannels; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|     d_flag_dump_enabled = flag_dump_to_file; |     d_flag_dump_enabled = flag_dump_to_file; | ||||||
|     d_galileo_current_time = 0; |     d_galileo_current_time = 0; | ||||||
|     count_valid_position = 0; |     count_valid_position = 0; | ||||||
| @@ -173,7 +174,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do | |||||||
|                     { |                     { | ||||||
|                         // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key |                         // 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); |                         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); |                                 gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
|                                 if (gps_ephemeris_iter != gps_ephemeris_map.end()) |                                 if (gps_ephemeris_iter != gps_ephemeris_map.end()) | ||||||
| @@ -228,7 +229,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do | |||||||
|                                         DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; |                                         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); |                                 gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
|                                 if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) |                                 if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) | ||||||
|   | |||||||
| @@ -70,7 +70,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) | |||||||
|         { |         { | ||||||
|             kml_base_path = p.string(); |             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; |             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(); |     boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); | ||||||
|     tm timeinfo = boost::posix_time::to_tm(pt); |     tm timeinfo = boost::posix_time::to_tm(pt); | ||||||
| @@ -143,14 +143,14 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|         { |         { | ||||||
|             DLOG(INFO) << "KML printer writing on " << filename.c_str(); |             DLOG(INFO) << "KML printer writing on " << filename.c_str(); | ||||||
|             // Set iostream numeric format and precision |             // 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); |             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); |             tmp_file << std::setprecision(14); | ||||||
|  |  | ||||||
|             kml_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl |             kml_file << R"(<?xml version="1.0" encoding="UTF-8"?>)" << std::endl | ||||||
|                      << "<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\">" << std::endl |                      << R"(<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">)" << std::endl | ||||||
|                      << indent << "<Document>" << std::endl |                      << indent << "<Document>" << std::endl | ||||||
|                      << indent << indent << "<name>GNSS Track</name>" << std::endl |                      << indent << indent << "<name>GNSS Track</name>" << std::endl | ||||||
|                      << indent << indent << "<description><![CDATA[" << std::endl |                      << indent << indent << "<description><![CDATA[" << std::endl | ||||||
| @@ -206,11 +206,8 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl; | ||||||
|         { |     return false; | ||||||
|             std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -222,7 +219,7 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, | |||||||
|  |  | ||||||
|     positions_printed = true; |     positions_printed = true; | ||||||
|  |  | ||||||
|     std::shared_ptr<rtklib_solver> position_ = position; |     const std::shared_ptr<rtklib_solver>& position_ = position; | ||||||
|  |  | ||||||
|     double speed_over_ground = position_->get_speed_over_ground();    // expressed in m/s |     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 |     double course_over_ground = position_->get_course_over_ground();  // expressed in deg | ||||||
| @@ -282,10 +279,7 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, | |||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -319,10 +313,7 @@ bool Kml_Printer::close_file() | |||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ private: | |||||||
| public: | public: | ||||||
|     Kml_Printer(const std::string& base_path = std::string(".")); |     Kml_Printer(const std::string& base_path = std::string(".")); | ||||||
|     ~Kml_Printer(); |     ~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<rtklib_solver>& position, bool print_average_values); |     bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values); | ||||||
|     bool close_file(); |     bool close_file(); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -44,6 +44,7 @@ Ls_Pvt::Ls_Pvt() : Pvt_Solution() | |||||||
| { | { | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) | 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 |     // 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 |                             Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i));  //armadillo | ||||||
|  |  | ||||||
|                             //--- Find DOA and range of satellites |                             //--- Find DOA and range of satellites | ||||||
|                             double* azim = 0; |                             double* azim = nullptr; | ||||||
|                             double* elev = 0; |                             double* elev = nullptr; | ||||||
|                             double* dist = 0; |                             double* dist = nullptr; | ||||||
|                             topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); |                             topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); | ||||||
|  |  | ||||||
|                             if (traveltime < 0.1 && nmbOfSatellites > 3) |                             if (traveltime < 0.1 && nmbOfSatellites > 3) | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| /*! | /*! | ||||||
|  * \file kml_printer.cc |  * \file nmea_printer.cc | ||||||
|  * \brief Implementation of a NMEA 2.1 printer for GNSS-SDR |  * \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 |  * 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). |  * marine electronic devices as defined by the National Marine Electronics Association (NMEA). | ||||||
| @@ -48,7 +48,7 @@ | |||||||
| using google::LogMessage; | 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; |     nmea_base_path = base_path; | ||||||
|     d_flag_nmea_output_file = flag_nmea_output_file; |     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(); |                     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; |                     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) |     if (flag_nmea_tty_port == true) | ||||||
|         { |         { | ||||||
|             nmea_dev_descriptor = init_serial(nmea_devname.c_str()); |             nmea_dev_descriptor = init_serial(nmea_devname.c_str()); | ||||||
| @@ -126,20 +126,22 @@ 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) |      * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) | ||||||
|      */ |      */ | ||||||
|     int fd = 0; |     int fd = 0; | ||||||
|     struct termios options; |     struct termios options | ||||||
|  |     { | ||||||
|  |     }; | ||||||
|     int64_t BAUD; |     int64_t BAUD; | ||||||
|     int64_t DATABITS; |     int64_t DATABITS; | ||||||
|     int64_t STOPBITS; |     int64_t STOPBITS; | ||||||
|     int64_t PARITYON; |     int64_t PARITYON; | ||||||
|     int64_t PARITY; |     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 (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 |     if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O";  // clear all flags on descriptor, enable direct I/O | ||||||
| @@ -246,9 +248,9 @@ char Nmea_Printer::checkSum(std::string sentence) | |||||||
| { | { | ||||||
|     char check = 0; |     char check = 0; | ||||||
|     // iterate over the string, XOR each byte with the total sum: |     // iterate over the string, XOR each byte with the total sum: | ||||||
|     for (unsigned int c = 0; c < sentence.length(); c++) |     for (char c : sentence) | ||||||
|         { |         { | ||||||
|             check = char(check ^ sentence.at(c)); |             check = char(check ^ c); | ||||||
|         } |         } | ||||||
|     // return the result |     // return the result | ||||||
|     return check; |     return check; | ||||||
|   | |||||||
| @@ -53,12 +53,12 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      * \brief Default constructor. |      * \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 |      * \brief Print NMEA PVT and satellite info to the initialized device | ||||||
|      */ |      */ | ||||||
|     bool Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& position, bool print_average_values); |     bool Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Default destructor. |      * \brief Default destructor. | ||||||
| @@ -72,7 +72,7 @@ private: | |||||||
|     std::string nmea_devname; |     std::string nmea_devname; | ||||||
|     int nmea_dev_descriptor;  // NMEA serial device descriptor (i.e. COM port) |     int nmea_dev_descriptor;  // NMEA serial device descriptor (i.e. COM port) | ||||||
|     std::shared_ptr<rtklib_solver> d_PVT_data; |     std::shared_ptr<rtklib_solver> 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(); |     void close_serial(); | ||||||
|     std::string get_GPGGA();  // fix data |     std::string get_GPGGA();  // fix data | ||||||
|     std::string get_GPGSV();  // satellite data |     std::string get_GPGSV();  // satellite data | ||||||
|   | |||||||
| @@ -188,7 +188,7 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb | |||||||
|     double b; |     double b; | ||||||
|     double rtop; |     double rtop; | ||||||
|  |  | ||||||
|     while (1) |     while (true) | ||||||
|         { |         { | ||||||
|             rtop = pow((a_e + htop), 2) - pow((a_e + hsta_km), 2) * (1 - pow(sinel, 2)); |             rtop = pow((a_e + htop), 2) - pow((a_e + hsta_km), 2) * (1 - pow(sinel, 2)); | ||||||
|  |  | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -146,52 +146,52 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the GPS L2 Observation data header |      *  \brief Generates the GPS L2 Observation data header | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation, const std::string gps_bands = "2S"); |     void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation, const std::string& gps_bands = "2S"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the dual frequency GPS L1 & L2/L5 Observation data header |      *  \brief Generates the dual frequency GPS L1 & L2/L5 Observation data header | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string gps_bands = "1C 2S"); |     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string& gps_bands = "1C 2S"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Galileo Observation data header. Example: bands("1B"), bands("1B 5X"), bands("5X"), ... Default: "1B". |      *  \brief Generates the Galileo Observation data header. Example: bands("1B"), bands("1B 5X"), bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation, const std::string bands = "1B"); |     void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation, const std::string& bands = "1B"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string galileo_bands = "1B"); |     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string gps_bands = "1C 2S", const std::string galileo_bands = "1B"); |     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string& gps_bands = "1C 2S", const std::string& galileo_bands = "1B"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string gps_bands = "2S", const std::string galileo_bands = "1B"); |     void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string& gps_bands = "2S", const std::string& galileo_bands = "1B"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the GLONASS GNAV Observation data header. Example: bands("1C"), bands("1C 2C"), bands("2C"), ... Default: "1C". |      *  \brief Generates the GLONASS GNAV Observation data header. Example: bands("1C"), bands("1C 2C"), bands("2C"), ... Default: "1C". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string bands = "1G"); |     void rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string& bands = "1G"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string glo_bands = "1C"); |     void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1C"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string galileo_bands = "1B", const std::string glo_bands = "1C"); |     void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glo_bands = "1C"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G". |      *  \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G". | ||||||
|      */ |      */ | ||||||
|     void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string glo_bands = "1G"); |     void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1G"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Generates the SBAS raw data header |      *  \brief Generates the SBAS raw data header | ||||||
| @@ -297,7 +297,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      *  \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, const std::string galileo_bands = "1B"); |     void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, const std::string& galileo_bands = "1B"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Writes Mixed GPS / Galileo observables into the RINEX file |      *  \brief Writes Mixed GPS / Galileo observables into the RINEX file | ||||||
| @@ -317,7 +317,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      *  \brief Writes GLONASS GNAV observables into the RINEX file. Example: glonass_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". |      *  \brief Writes GLONASS GNAV observables into the RINEX file. Example: glonass_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". | ||||||
|      */ |      */ | ||||||
|     void log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, const std::string glonass_bands = "1C"); |     void log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, const std::string& glonass_bands = "1C"); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      *  \brief Writes Mixed GPS L1 C/A - GLONASS observables into the RINEX file |      *  \brief Writes Mixed GPS L1 C/A - GLONASS observables into the RINEX file | ||||||
| @@ -406,7 +406,7 @@ private: | |||||||
|      * "RINEX_FILE_TYPE_SBAS" - SBAS broadcast data file. |      * "RINEX_FILE_TYPE_SBAS" - SBAS broadcast data file. | ||||||
|      * "RINEX_FILE_TYPE_CLK" - Clock file. |      * "RINEX_FILE_TYPE_CLK" - Clock file. | ||||||
|      */ |      */ | ||||||
|     std::string createFilename(std::string type); |     std::string createFilename(const std::string& type); | ||||||
|  |  | ||||||
|     /* |     /* | ||||||
|      * Generates the data for the PGM / RUN BY / DATE line |      * Generates the data for the PGM / RUN BY / DATE line | ||||||
| @@ -547,7 +547,7 @@ private: | |||||||
|      */ |      */ | ||||||
|     inline double asDouble(const std::string& s) |     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) |     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) | inline int64_t asInt(const std::string& s) | ||||||
| { | { | ||||||
|     return strtol(s.c_str(), 0, 10); |     return strtol(s.c_str(), nullptr, 10); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,7 +37,9 @@ | |||||||
| #include <boost/filesystem/path.hpp>         // for path, operator<< | #include <boost/filesystem/path.hpp>         // for path, operator<< | ||||||
| #include <boost/filesystem/path_traits.hpp>  // for filesystem | #include <boost/filesystem/path_traits.hpp>  // for filesystem | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  | #include <cstdint> | ||||||
| #include <iomanip> | #include <iomanip> | ||||||
|  | #include <utility> | ||||||
| #include <fcntl.h>    // for O_RDWR | #include <fcntl.h>    // for O_RDWR | ||||||
| #include <termios.h>  // for tcgetattr | #include <termios.h>  // for tcgetattr | ||||||
|  |  | ||||||
| @@ -45,7 +47,7 @@ | |||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
|  |  | ||||||
| Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, std::string rtcm_dump_devname, bool time_tag_name, const std::string& base_path) | Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name, const std::string& base_path) | ||||||
| { | { | ||||||
|     boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); |     boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); | ||||||
|     tm timeinfo = boost::posix_time::to_tm(pt); |     tm timeinfo = boost::posix_time::to_tm(pt); | ||||||
| @@ -77,7 +79,7 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool | |||||||
|                 { |                 { | ||||||
|                     rtcm_base_path = p.string(); |                     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; |                     std::cout << "RTCM binary file will be stored at " << rtcm_base_path << std::endl; | ||||||
|                 } |                 } | ||||||
| @@ -141,7 +143,7 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool | |||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     rtcm_devname = rtcm_dump_devname; |     rtcm_devname = std::move(rtcm_dump_devname); | ||||||
|     if (flag_rtcm_tty_port == true) |     if (flag_rtcm_tty_port == true) | ||||||
|         { |         { | ||||||
|             rtcm_dev_descriptor = init_serial(rtcm_devname.c_str()); |             rtcm_dev_descriptor = init_serial(rtcm_devname.c_str()); | ||||||
| @@ -186,7 +188,7 @@ Rtcm_Printer::~Rtcm_Printer() | |||||||
|         } |         } | ||||||
|     if (rtcm_file_descriptor.is_open()) |     if (rtcm_file_descriptor.is_open()) | ||||||
|         { |         { | ||||||
|             long pos; |             int64_t pos; | ||||||
|             pos = rtcm_file_descriptor.tellp(); |             pos = rtcm_file_descriptor.tellp(); | ||||||
|             rtcm_file_descriptor.close(); |             rtcm_file_descriptor.close(); | ||||||
|             if (pos == 0) |             if (pos == 0) | ||||||
| @@ -337,20 +339,20 @@ bool Rtcm_Printer::Print_Rtcm_MSM(uint32_t msm_number, const Gps_Ephemeris& gps_ | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| int Rtcm_Printer::init_serial(std::string serial_device) | int Rtcm_Printer::init_serial(const std::string& serial_device) | ||||||
| { | { | ||||||
|     /* |     /* | ||||||
|      * Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1) |      * Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1) | ||||||
|      */ |      */ | ||||||
|     int32_t fd = 0; |     int32_t fd = 0; | ||||||
|     struct termios options; |     struct termios options; | ||||||
|     long BAUD; |     int64_t BAUD; | ||||||
|     long DATABITS; |     int64_t DATABITS; | ||||||
|     long STOPBITS; |     int64_t STOPBITS; | ||||||
|     long PARITYON; |     int64_t PARITYON; | ||||||
|     long PARITY; |     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 (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 |     if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O";  // clear all flags on descriptor, enable direct I/O | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      * \brief Default constructor. |      * \brief Default constructor. | ||||||
|      */ |      */ | ||||||
|     Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, std::string rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = "."); |     Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = "."); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Default destructor. |      * \brief Default destructor. | ||||||
| @@ -149,7 +149,7 @@ private: | |||||||
|     uint16_t port; |     uint16_t port; | ||||||
|     uint16_t station_id; |     uint16_t station_id; | ||||||
|     int32_t rtcm_dev_descriptor;                     // RTCM serial device descriptor (i.e. COM port) |     int32_t rtcm_dev_descriptor;                     // RTCM serial device descriptor (i.e. COM port) | ||||||
|     int32_t init_serial(std::string serial_device);  //serial port control |     int32_t init_serial(const std::string& serial_device);  //serial port control | ||||||
|     void close_serial(); |     void close_serial(); | ||||||
|     std::shared_ptr<Rtcm> rtcm; |     std::shared_ptr<Rtcm> rtcm; | ||||||
|     bool Print_Message(const std::string& message); |     bool Print_Message(const std::string& message); | ||||||
|   | |||||||
| @@ -59,26 +59,27 @@ | |||||||
| #include "GLONASS_L1_L2_CA.h" | #include "GLONASS_L1_L2_CA.h" | ||||||
| #include <matio.h> | #include <matio.h> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | 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 |     // init empty ephemeris for all the available GNSS channels | ||||||
|     d_nchannels = nchannels; |     d_nchannels = nchannels; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|     d_flag_dump_enabled = flag_dump_to_file; |     d_flag_dump_enabled = flag_dump_to_file; | ||||||
|     d_flag_dump_mat_enabled = flag_dump_to_mat; |     d_flag_dump_mat_enabled = flag_dump_to_mat; | ||||||
|     count_valid_position = 0; |     count_valid_position = 0; | ||||||
|     this->set_averaging_flag(false); |     this->set_averaging_flag(false); | ||||||
|     rtk_ = rtk; |     rtk_ = rtk; | ||||||
|     for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0; |     for (double &i : dop_) i = 0.0; | ||||||
|     pvt_sol = {{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}; |     pvt_sol = {{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}; | ||||||
|     ssat_t ssat0 = {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}}}, {{}, {}}}; |     ssat_t ssat0 = {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}}}, {{}, {}}}; | ||||||
|     for (unsigned int i = 0; i < MAXSAT; i++) |     for (auto &i : pvt_ssat) | ||||||
|         { |         { | ||||||
|             pvt_ssat[i] = ssat0; |             i = ssat0; | ||||||
|         } |         } | ||||||
|     // ############# ENABLE DATA FILE LOG ################# |     // ############# ENABLE DATA FILE LOG ################# | ||||||
|     if (d_flag_dump_enabled == true) |     if (d_flag_dump_enabled == true) | ||||||
| @@ -137,34 +138,34 @@ bool rtklib_solver::save_matfile() | |||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     uint32_t *TOW_at_current_symbol_ms = new uint32_t[num_epoch]; |     auto *TOW_at_current_symbol_ms = new uint32_t[num_epoch]; | ||||||
|     uint32_t *week = new uint32_t[num_epoch]; |     auto *week = new uint32_t[num_epoch]; | ||||||
|     double *RX_time = new double[num_epoch]; |     auto *RX_time = new double[num_epoch]; | ||||||
|     double *user_clk_offset = new double[num_epoch]; |     auto *user_clk_offset = new double[num_epoch]; | ||||||
|     double *pos_x = new double[num_epoch]; |     auto *pos_x = new double[num_epoch]; | ||||||
|     double *pos_y = new double[num_epoch]; |     auto *pos_y = new double[num_epoch]; | ||||||
|     double *pos_z = new double[num_epoch]; |     auto *pos_z = new double[num_epoch]; | ||||||
|     double *vel_x = new double[num_epoch]; |     auto *vel_x = new double[num_epoch]; | ||||||
|     double *vel_y = new double[num_epoch]; |     auto *vel_y = new double[num_epoch]; | ||||||
|     double *vel_z = new double[num_epoch]; |     auto *vel_z = new double[num_epoch]; | ||||||
|     double *cov_xx = new double[num_epoch]; |     auto *cov_xx = new double[num_epoch]; | ||||||
|     double *cov_yy = new double[num_epoch]; |     auto *cov_yy = new double[num_epoch]; | ||||||
|     double *cov_zz = new double[num_epoch]; |     auto *cov_zz = new double[num_epoch]; | ||||||
|     double *cov_xy = new double[num_epoch]; |     auto *cov_xy = new double[num_epoch]; | ||||||
|     double *cov_yz = new double[num_epoch]; |     auto *cov_yz = new double[num_epoch]; | ||||||
|     double *cov_zx = new double[num_epoch]; |     auto *cov_zx = new double[num_epoch]; | ||||||
|     double *latitude = new double[num_epoch]; |     auto *latitude = new double[num_epoch]; | ||||||
|     double *longitude = new double[num_epoch]; |     auto *longitude = new double[num_epoch]; | ||||||
|     double *height = new double[num_epoch]; |     auto *height = new double[num_epoch]; | ||||||
|     uint8_t *valid_sats = new uint8_t[num_epoch]; |     auto *valid_sats = new uint8_t[num_epoch]; | ||||||
|     uint8_t *solution_status = new uint8_t[num_epoch]; |     auto *solution_status = new uint8_t[num_epoch]; | ||||||
|     uint8_t *solution_type = new uint8_t[num_epoch]; |     auto *solution_type = new uint8_t[num_epoch]; | ||||||
|     float *AR_ratio_factor = new float[num_epoch]; |     auto *AR_ratio_factor = new float[num_epoch]; | ||||||
|     float *AR_ratio_threshold = new float[num_epoch]; |     auto *AR_ratio_threshold = new float[num_epoch]; | ||||||
|     double *gdop = new double[num_epoch]; |     auto *gdop = new double[num_epoch]; | ||||||
|     double *pdop = new double[num_epoch]; |     auto *pdop = new double[num_epoch]; | ||||||
|     double *hdop = new double[num_epoch]; |     auto *hdop = new double[num_epoch]; | ||||||
|     double *vdop = new double[num_epoch]; |     auto *vdop = new double[num_epoch]; | ||||||
|  |  | ||||||
|     try |     try | ||||||
|         { |         { | ||||||
| @@ -245,8 +246,8 @@ bool rtklib_solver::save_matfile() | |||||||
|     std::string filename = dump_filename; |     std::string filename = dump_filename; | ||||||
|     filename.erase(filename.length() - 4, 4); |     filename.erase(filename.length() - 4, 4); | ||||||
|     filename.append(".mat"); |     filename.append(".mat"); | ||||||
|     matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); |     matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); | ||||||
|     if (reinterpret_cast<int64_t *>(matfp) != NULL) |     if (reinterpret_cast<int64_t *>(matfp) != nullptr) | ||||||
|         { |         { | ||||||
|             size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; |             size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; | ||||||
|             matvar = Mat_VarCreate("TOW_at_current_symbol_ms", MAT_C_UINT32, MAT_T_UINT32, 2, dims, TOW_at_current_symbol_ms, 0); |             matvar = Mat_VarCreate("TOW_at_current_symbol_ms", MAT_C_UINT32, MAT_T_UINT32, 2, dims, TOW_at_current_symbol_ms, 0); | ||||||
| @@ -473,11 +474,11 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                 case 'G': |                 case 'G': | ||||||
|                     { |                     { | ||||||
|                         std::string sig_(gnss_observables_iter->second.Signal); |                         std::string sig_(gnss_observables_iter->second.Signal); | ||||||
|                         if (sig_.compare("1C") == 0) |                         if (sig_ == "1C") | ||||||
|                             { |                             { | ||||||
|                                 band1 = true; |                                 band1 = true; | ||||||
|                             } |                             } | ||||||
|                         if (sig_.compare("2S") == 0) |                         if (sig_ == "2S") | ||||||
|                             { |                             { | ||||||
|                                 band2 = true; |                                 band2 = true; | ||||||
|                             } |                             } | ||||||
| @@ -500,7 +501,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                     { |                     { | ||||||
|                         std::string sig_(gnss_observables_iter->second.Signal); |                         std::string sig_(gnss_observables_iter->second.Signal); | ||||||
|                         // Galileo E1 |                         // 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 |                                 // 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); |                                 galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -523,7 +524,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                             } |                             } | ||||||
|  |  | ||||||
|                         // Galileo E5 |                         // 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 |                                 // 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); |                                 galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -548,7 +549,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                                 // convert ephemeris from GNSS-SDR class to RTKLIB structure |                                                 // convert ephemeris from GNSS-SDR class to RTKLIB structure | ||||||
|                                                 eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); |                                                 eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); | ||||||
|                                                 // convert observation from GNSS-SDR class to RTKLIB structure |                                                 // convert observation from GNSS-SDR class to RTKLIB structure | ||||||
|                                                 unsigned char default_code_ = static_cast<unsigned char>(CODE_NONE); |                                                 auto default_code_ = static_cast<unsigned char>(CODE_NONE); | ||||||
|                                                 obsd_t newobs = {{0, 0}, '0', '0', {}, {}, |                                                 obsd_t newobs = {{0, 0}, '0', '0', {}, {}, | ||||||
|                                                     {default_code_, default_code_, default_code_}, |                                                     {default_code_, default_code_, default_code_}, | ||||||
|                                                     {}, {0.0, 0.0, 0.0}, {}}; |                                                     {}, {0.0, 0.0, 0.0}, {}}; | ||||||
| @@ -571,7 +572,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                         // GPS L1 |                         // GPS L1 | ||||||
|                         // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key |                         // 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); |                         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); |                                 gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
|                                 if (gps_ephemeris_iter != gps_ephemeris_map.cend()) |                                 if (gps_ephemeris_iter != gps_ephemeris_map.cend()) | ||||||
| @@ -592,7 +593,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                     } |                                     } | ||||||
|                             } |                             } | ||||||
|                         // GPS L2 (todo: solve NAV/CNAV clash) |                         // 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); |                                 gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
|                                 if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) |                                 if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) | ||||||
| @@ -624,7 +625,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                                 // convert ephemeris from GNSS-SDR class to RTKLIB structure |                                                 // convert ephemeris from GNSS-SDR class to RTKLIB structure | ||||||
|                                                 eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); |                                                 eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); | ||||||
|                                                 // convert observation from GNSS-SDR class to RTKLIB structure |                                                 // convert observation from GNSS-SDR class to RTKLIB structure | ||||||
|                                                 unsigned char default_code_ = static_cast<unsigned char>(CODE_NONE); |                                                 auto default_code_ = static_cast<unsigned char>(CODE_NONE); | ||||||
|                                                 obsd_t newobs = {{0, 0}, '0', '0', {}, {}, |                                                 obsd_t newobs = {{0, 0}, '0', '0', {}, {}, | ||||||
|                                                     {default_code_, default_code_, default_code_}, |                                                     {default_code_, default_code_, default_code_}, | ||||||
|                                                     {}, {0.0, 0.0, 0.0}, {}}; |                                                     {}, {0.0, 0.0, 0.0}, {}}; | ||||||
| @@ -641,7 +642,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                     } |                                     } | ||||||
|                             } |                             } | ||||||
|                         // GPS L5 |                         // GPS L5 | ||||||
|                         if (sig_.compare("L5") == 0) |                         if (sig_ == "L5") | ||||||
|                             { |                             { | ||||||
|                                 gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); |                                 gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
|                                 if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) |                                 if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) | ||||||
| @@ -671,7 +672,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                                 // convert ephemeris from GNSS-SDR class to RTKLIB structure |                                                 // convert ephemeris from GNSS-SDR class to RTKLIB structure | ||||||
|                                                 eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); |                                                 eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); | ||||||
|                                                 // convert observation from GNSS-SDR class to RTKLIB structure |                                                 // convert observation from GNSS-SDR class to RTKLIB structure | ||||||
|                                                 unsigned char default_code_ = static_cast<unsigned char>(CODE_NONE); |                                                 auto default_code_ = static_cast<unsigned char>(CODE_NONE); | ||||||
|                                                 obsd_t newobs = {{0, 0}, '0', '0', {}, {}, |                                                 obsd_t newobs = {{0, 0}, '0', '0', {}, {}, | ||||||
|                                                     {default_code_, default_code_, default_code_}, |                                                     {default_code_, default_code_, default_code_}, | ||||||
|                                                     {}, {0.0, 0.0, 0.0}, {}}; |                                                     {}, {0.0, 0.0, 0.0}, {}}; | ||||||
| @@ -693,7 +694,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                     { |                     { | ||||||
|                         std::string sig_(gnss_observables_iter->second.Signal); |                         std::string sig_(gnss_observables_iter->second.Signal); | ||||||
|                         // GLONASS GNAV L1 |                         // 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 |                                 // 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); |                                 glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -715,7 +716,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                     } |                                     } | ||||||
|                             } |                             } | ||||||
|                         // GLONASS GNAV L2 |                         // 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 |                                 // 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); |                                 glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); | ||||||
| @@ -775,11 +776,11 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|             nav_data.n = valid_obs; |             nav_data.n = valid_obs; | ||||||
|             nav_data.ng = glo_valid_obs; |             nav_data.ng = glo_valid_obs; | ||||||
|  |  | ||||||
|             for (int i = 0; i < MAXSAT; i++) |             for (auto &i : nav_data.lam) | ||||||
|                 { |                 { | ||||||
|                     nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1;  // L1/E1 |                     i[0] = SPEED_OF_LIGHT / FREQ1;  // L1/E1 | ||||||
|                     nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2;  // L2 |                     i[1] = SPEED_OF_LIGHT / FREQ2;  // L2 | ||||||
|                     nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5;  // L5/E5 |                     i[2] = SPEED_OF_LIGHT / FREQ5;  // L5/E5 | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|             result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data); |             result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data); | ||||||
| @@ -809,12 +810,12 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                     std::vector<double> azel; |                     std::vector<double> azel; | ||||||
|                     azel.reserve(used_sats * 2); |                     azel.reserve(used_sats * 2); | ||||||
|                     unsigned int index_aux = 0; |                     unsigned int index_aux = 0; | ||||||
|                     for (unsigned int i = 0; i < MAXSAT; i++) |                     for (auto &i : rtk_.ssat) | ||||||
|                         { |                         { | ||||||
|                             if (rtk_.ssat[i].vs == 1) |                             if (i.vs == 1) | ||||||
|                                 { |                                 { | ||||||
|                                     azel[2 * index_aux] = rtk_.ssat[i].azel[0]; |                                     azel[2 * index_aux] = i.azel[0]; | ||||||
|                                     azel[2 * index_aux + 1] = rtk_.ssat[i].azel[1]; |                                     azel[2 * index_aux + 1] = i.azel[1]; | ||||||
|                                     index_aux++; |                                     index_aux++; | ||||||
|                                 } |                                 } | ||||||
|                         } |                         } | ||||||
|   | |||||||
| @@ -87,7 +87,7 @@ private: | |||||||
| public: | public: | ||||||
|     sol_t pvt_sol; |     sol_t pvt_sol; | ||||||
|     ssat_t pvt_ssat[MAXSAT]; |     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(); |     ~rtklib_solver(); | ||||||
|  |  | ||||||
|     bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging); |     bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging); | ||||||
|   | |||||||
| @@ -30,7 +30,6 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" | #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include "galileo_e1_signal_processing.h" | #include "galileo_e1_signal_processing.h" | ||||||
| @@ -40,12 +39,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
| GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -56,7 +57,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | |||||||
|     item_type_ = configuration_->property(role + ".item_type", |     item_type_ = configuration_->property(role + ".item_type", | ||||||
|         default_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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||||
| @@ -86,7 +87,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_, |             acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_, | ||||||
| @@ -107,7 +108,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -137,7 +143,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) | void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(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); |     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_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -163,7 +169,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ | |||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             acquisition_cc_->set_doppler_step(doppler_step_); | ||||||
|         } |         } | ||||||
| @@ -184,7 +190,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( | |||||||
|     Gnss_Synchro* gnss_synchro) |     Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -193,14 +199,11 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( | |||||||
|  |  | ||||||
| signed int GalileoE1Pcps8msAmbiguousAcquisition::mag() | signed int GalileoE1Pcps8msAmbiguousAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -213,12 +216,12 @@ void GalileoE1Pcps8msAmbiguousAcquisition::init() | |||||||
|  |  | ||||||
| void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() | void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             bool cboc = configuration_->property( |             bool cboc = configuration_->property( | ||||||
|                 "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false); |                 "Acquisition" + std::to_string(channel_) + ".cboc", false); | ||||||
|  |  | ||||||
|             std::complex<float>* code = new std::complex<float>[code_length_]; |             auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|             galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, |             galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, | ||||||
|                 cboc, gnss_synchro_->PRN, fs_in_, 0, false); |                 cboc, gnss_synchro_->PRN, fs_in_, 0, false); | ||||||
| @@ -238,7 +241,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() | |||||||
|  |  | ||||||
| void GalileoE1Pcps8msAmbiguousAcquisition::reset() | void GalileoE1Pcps8msAmbiguousAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -257,9 +260,9 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -267,7 +270,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | 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); |             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
| @@ -276,7 +279,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| void GalileoE1Pcps8msAmbiguousAcquisition::disconnect(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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -48,7 +48,8 @@ class GalileoE1Pcps8msAmbiguousAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE1Pcps8msAmbiguousAcquisition(ConfigurationInterface* configuration, |     GalileoE1Pcps8msAmbiguousAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE1Pcps8msAmbiguousAcquisition(); |     virtual ~GalileoE1Pcps8msAmbiguousAcquisition(); | ||||||
| @@ -144,7 +145,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -35,20 +35,20 @@ | |||||||
| #include "Galileo_E1.h" | #include "Galileo_E1.h" | ||||||
| #include "gnss_sdr_flags.h" | #include "gnss_sdr_flags.h" | ||||||
| #include "acq_conf.h" | #include "acq_conf.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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 acq_parameters; | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -59,7 +59,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||||
| @@ -103,7 +103,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[vector_length_]; |     code_ = new gr_complex[vector_length_]; | ||||||
|  |  | ||||||
|     if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -119,7 +119,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | |||||||
|     acquisition_ = pcps_make_acquisition(acq_parameters); |     acquisition_ = pcps_make_acquisition(acq_parameters); | ||||||
|     DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; |     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(); |             cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); | ||||||
|             float_to_complex_ = gr::blocks::float_to_complex::make(); |             float_to_complex_ = gr::blocks::float_to_complex::make(); | ||||||
| @@ -128,7 +128,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -155,7 +160,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) | void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(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); |     if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||||
|  |  | ||||||
| @@ -214,9 +219,9 @@ void GalileoE1PcpsAmbiguousAcquisition::init() | |||||||
| void GalileoE1PcpsAmbiguousAcquisition::set_local_code() | void GalileoE1PcpsAmbiguousAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     bool cboc = configuration_->property( |     bool cboc = configuration_->property( | ||||||
|         "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false); |         "Acquisition" + std::to_string(channel_) + ".cboc", false); | ||||||
|  |  | ||||||
|     std::complex<float>* code = new std::complex<float>[code_length_]; |     auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|     if (acquire_pilot_ == true) |     if (acquire_pilot_ == true) | ||||||
|         { |         { | ||||||
| @@ -267,9 +272,9 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -277,15 +282,15 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     else if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             // Since a byte-based acq implementation is not available, |             // Since a byte-based acq implementation is not available, | ||||||
|             // we just convert cshorts to gr_complex |             // 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) | void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // 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_, 0, float_to_complex_, 0); | ||||||
|             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); |             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); | ||||||
| @@ -325,23 +330,21 @@ void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() | gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             return cbyte_to_float_x2_; |             return cbyte_to_float_x2_; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << item_type_ << " unknown acquisition item type"; | ||||||
|             LOG(WARNING) << item_type_ << " unknown acquisition item type"; |     return nullptr; | ||||||
|             return nullptr; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -51,7 +51,8 @@ class GalileoE1PcpsAmbiguousAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE1PcpsAmbiguousAcquisition(ConfigurationInterface* configuration, |     GalileoE1PcpsAmbiguousAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE1PcpsAmbiguousAcquisition(); |     virtual ~GalileoE1PcpsAmbiguousAcquisition(); | ||||||
| @@ -154,7 +155,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|   | |||||||
| @@ -41,13 +41,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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("top acq constructor start\n"); |     //printf("top acq constructor start\n"); | ||||||
|     pcpsconf_fpga_t acq_parameters; |     pcpsconf_fpga_t acq_parameters; | ||||||
| @@ -59,8 +60,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | |||||||
|  |  | ||||||
|     //    item_type_ = configuration_->property(role + ".item_type", default_item_type); |     //    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); | ||||||
|     long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); |     int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in; |     acq_parameters.fs_in = fs_in; | ||||||
|     //if_ = configuration_->property(role + ".if", 0); |     //if_ = configuration_->property(role + ".if", 0); | ||||||
|     //acq_parameters.freq = if_; |     //acq_parameters.freq = if_; | ||||||
| @@ -296,7 +297,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     //threshold_ = 0.0; |     //threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     //printf("top acq constructor end\n"); |     //printf("top acq constructor end\n"); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -310,6 +311,11 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::~GalileoE1PcpsAmbiguousAcquisitionFpga() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() | ||||||
|  | { | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void GalileoE1PcpsAmbiguousAcquisitionFpga::set_channel(unsigned int channel) | void GalileoE1PcpsAmbiguousAcquisitionFpga::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     //printf("top acq set channel start\n"); |     //printf("top acq set channel start\n"); | ||||||
|   | |||||||
| @@ -52,7 +52,8 @@ class GalileoE1PcpsAmbiguousAcquisitionFpga : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE1PcpsAmbiguousAcquisitionFpga(ConfigurationInterface* configuration, |     GalileoE1PcpsAmbiguousAcquisitionFpga(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE1PcpsAmbiguousAcquisitionFpga(); |     virtual ~GalileoE1PcpsAmbiguousAcquisitionFpga(); | ||||||
|   | |||||||
| @@ -30,7 +30,6 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" | #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include "galileo_e1_signal_processing.h" | #include "galileo_e1_signal_processing.h" | ||||||
| @@ -40,13 +39,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition( | GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -56,7 +56,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||||
| @@ -88,7 +88,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition | |||||||
|     code_data_ = new gr_complex[vector_length_]; |     code_data_ = new gr_complex[vector_length_]; | ||||||
|     code_pilot_ = 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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_, |             acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_, | ||||||
| @@ -109,7 +109,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -140,7 +145,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) | void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     //    float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(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); |     //    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_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -168,7 +173,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppl | |||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             acquisition_cc_->set_doppler_step(doppler_step_); | ||||||
|         } |         } | ||||||
| @@ -188,7 +193,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro( | |||||||
|     Gnss_Synchro* gnss_synchro) |     Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -197,14 +202,11 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro( | |||||||
|  |  | ||||||
| signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag() | signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -217,10 +219,10 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::init() | |||||||
|  |  | ||||||
| void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() | void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             bool cboc = configuration_->property( |             bool cboc = configuration_->property( | ||||||
|                 "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false); |                 "Acquisition" + std::to_string(channel_) + ".cboc", false); | ||||||
|  |  | ||||||
|             char signal[3]; |             char signal[3]; | ||||||
|  |  | ||||||
| @@ -241,7 +243,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() | |||||||
|  |  | ||||||
| void GalileoE1PcpsCccwsrAmbiguousAcquisition::reset() | void GalileoE1PcpsCccwsrAmbiguousAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -264,7 +266,7 @@ float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | 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); |             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
| @@ -273,7 +275,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_blo | |||||||
|  |  | ||||||
| void GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) | 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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -48,7 +48,8 @@ class GalileoE1PcpsCccwsrAmbiguousAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE1PcpsCccwsrAmbiguousAcquisition(ConfigurationInterface* configuration, |     GalileoE1PcpsCccwsrAmbiguousAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition(); |     virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition(); | ||||||
| @@ -145,7 +146,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_data_; |     std::complex<float>* code_data_; | ||||||
|   | |||||||
| @@ -30,7 +30,6 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" | #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include "galileo_e1_signal_processing.h" | #include "galileo_e1_signal_processing.h" | ||||||
| @@ -40,13 +39,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( | GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -57,7 +57,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui | |||||||
|     item_type_ = configuration_->property(role + ".item_type", |     item_type_ = configuration_->property(role + ".item_type", | ||||||
|         default_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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||||
| @@ -119,7 +119,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui | |||||||
|               << ", Folding factor: " << folding_factor_ |               << ", Folding factor: " << folding_factor_ | ||||||
|               << ", Sampled  ms: " << sampled_ms_ |               << ", Sampled  ms: " << sampled_ms_ | ||||||
|               << ", Code Length: " << code_length_; |               << ", Code Length: " << code_length_; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(gr_complex); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, |             acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, | ||||||
| @@ -142,7 +142,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -172,7 +177,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channe | |||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) | void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(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); |     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_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -198,7 +203,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int do | |||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             acquisition_cc_->set_doppler_step(doppler_step_); | ||||||
|         } |         } | ||||||
| @@ -218,7 +223,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro( | |||||||
|     Gnss_Synchro* gnss_synchro) |     Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -228,14 +233,11 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro( | |||||||
| signed int | signed int | ||||||
| GalileoE1PcpsQuickSyncAmbiguousAcquisition::mag() | GalileoE1PcpsQuickSyncAmbiguousAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -248,12 +250,12 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::init() | |||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() | void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             bool cboc = configuration_->property( |             bool cboc = configuration_->property( | ||||||
|                 "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false); |                 "Acquisition" + std::to_string(channel_) + ".cboc", false); | ||||||
|  |  | ||||||
|             std::complex<float>* code = new std::complex<float>[code_length_]; |             auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|             galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, |             galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, | ||||||
|                 cboc, gnss_synchro_->PRN, fs_in_, 0, false); |                 cboc, gnss_synchro_->PRN, fs_in_, 0, false); | ||||||
| @@ -269,14 +271,14 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() | |||||||
|             acquisition_cc_->set_local_code(code_); |             acquisition_cc_->set_local_code(code_); | ||||||
|  |  | ||||||
|             delete[] code; |             delete[] code; | ||||||
|             code = NULL; |             code = nullptr; | ||||||
|         } |         } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() | void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -284,7 +286,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() | |||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state) | void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_state(state); |             acquisition_cc_->set_state(state); | ||||||
|         } |         } | ||||||
| @@ -306,7 +308,7 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = static_cast<double>(code_length_) / static_cast<double>(folding_factor_); |     double lambda = static_cast<double>(code_length_) / static_cast<double>(folding_factor_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -314,7 +316,7 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | 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); |             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
| @@ -323,7 +325,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_ | |||||||
|  |  | ||||||
| void GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) | 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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -49,7 +49,8 @@ class GalileoE1PcpsQuickSyncAmbiguousAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE1PcpsQuickSyncAmbiguousAcquisition(ConfigurationInterface* configuration, |     GalileoE1PcpsQuickSyncAmbiguousAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition(); |     virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition(); | ||||||
| @@ -150,7 +151,7 @@ private: | |||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     unsigned int folding_factor_; |     unsigned int folding_factor_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -30,7 +30,6 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" | #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include "galileo_e1_signal_processing.h" | #include "galileo_e1_signal_processing.h" | ||||||
| @@ -40,13 +39,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -57,7 +57,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | |||||||
|     item_type_ = configuration_->property(role + ".item_type", |     item_type_ = configuration_->property(role + ".item_type", | ||||||
|         default_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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||||
| @@ -90,7 +90,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, |             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, | ||||||
| @@ -112,7 +112,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -142,7 +147,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) | void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(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); |     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_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -168,7 +173,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler | |||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             acquisition_cc_->set_doppler_step(doppler_step_); | ||||||
|         } |         } | ||||||
| @@ -189,7 +194,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( | |||||||
|     Gnss_Synchro* gnss_synchro) |     Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -198,14 +203,11 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( | |||||||
|  |  | ||||||
| signed int GalileoE1PcpsTongAmbiguousAcquisition::mag() | signed int GalileoE1PcpsTongAmbiguousAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -218,12 +220,12 @@ void GalileoE1PcpsTongAmbiguousAcquisition::init() | |||||||
|  |  | ||||||
| void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() | void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             bool cboc = configuration_->property( |             bool cboc = configuration_->property( | ||||||
|                 "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false); |                 "Acquisition" + std::to_string(channel_) + ".cboc", false); | ||||||
|  |  | ||||||
|             std::complex<float>* code = new std::complex<float>[code_length_]; |             auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|             galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, |             galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, | ||||||
|                 cboc, gnss_synchro_->PRN, fs_in_, 0, false); |                 cboc, gnss_synchro_->PRN, fs_in_, 0, false); | ||||||
| @@ -243,7 +245,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() | |||||||
|  |  | ||||||
| void GalileoE1PcpsTongAmbiguousAcquisition::reset() | void GalileoE1PcpsTongAmbiguousAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -268,9 +270,9 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -278,7 +280,7 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block) | 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); |             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
| @@ -287,7 +289,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block | |||||||
|  |  | ||||||
| void GalileoE1PcpsTongAmbiguousAcquisition::disconnect(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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -48,7 +48,8 @@ class GalileoE1PcpsTongAmbiguousAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE1PcpsTongAmbiguousAcquisition(ConfigurationInterface* configuration, |     GalileoE1PcpsTongAmbiguousAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE1PcpsTongAmbiguousAcquisition(); |     virtual ~GalileoE1PcpsTongAmbiguousAcquisition(); | ||||||
| @@ -149,7 +150,7 @@ private: | |||||||
|     unsigned int tong_init_val_; |     unsigned int tong_init_val_; | ||||||
|     unsigned int tong_max_val_; |     unsigned int tong_max_val_; | ||||||
|     unsigned int tong_max_dwells_; |     unsigned int tong_max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -36,7 +36,6 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" | #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include "galileo_e5_signal_processing.h" | #include "galileo_e5_signal_processing.h" | ||||||
| @@ -46,13 +45,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -62,7 +62,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||||
| @@ -101,7 +101,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | |||||||
|         { |         { | ||||||
|             both_signal_components = true; |             both_signal_components = true; | ||||||
|         } |         } | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(gr_complex); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_, |             acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_, | ||||||
| @@ -117,7 +117,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -148,7 +153,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) | void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(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); |     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_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -174,7 +179,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_max(unsigned int doppler | |||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             acquisition_cc_->set_doppler_step(doppler_step_); | ||||||
|         } |         } | ||||||
| @@ -195,7 +200,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( | |||||||
|     Gnss_Synchro* gnss_synchro) |     Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -204,14 +209,11 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( | |||||||
|  |  | ||||||
| signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag() | signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -224,10 +226,10 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::init() | |||||||
|  |  | ||||||
| void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() | void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             std::complex<float>* codeI = new std::complex<float>[code_length_]; |             auto* codeI = new std::complex<float>[code_length_]; | ||||||
|             std::complex<float>* codeQ = new std::complex<float>[code_length_]; |             auto* codeQ = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|             if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X') |             if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X') | ||||||
|                 { |                 { | ||||||
| @@ -281,7 +283,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() | |||||||
|  |  | ||||||
| void GalileoE5aNoncoherentIQAcquisitionCaf::reset() | void GalileoE5aNoncoherentIQAcquisitionCaf::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -300,9 +302,9 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -49,7 +49,8 @@ class GalileoE5aNoncoherentIQAcquisitionCaf : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE5aNoncoherentIQAcquisitionCaf(ConfigurationInterface* configuration, |     GalileoE5aNoncoherentIQAcquisitionCaf(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE5aNoncoherentIQAcquisitionCaf(); |     virtual ~GalileoE5aNoncoherentIQAcquisitionCaf(); | ||||||
| @@ -150,7 +151,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     int Zero_padding; |     int Zero_padding; | ||||||
|   | |||||||
| @@ -34,7 +34,6 @@ | |||||||
| #include "Galileo_E5a.h" | #include "Galileo_E5a.h" | ||||||
| #include "gnss_sdr_flags.h" | #include "gnss_sdr_flags.h" | ||||||
| #include "acq_conf.h" | #include "acq_conf.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <volk_gnsssdr/volk_gnsssdr_complex.h> | #include <volk_gnsssdr/volk_gnsssdr_complex.h> | ||||||
| @@ -42,12 +41,13 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, | 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(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -58,7 +58,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||||
| @@ -91,11 +91,11 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | |||||||
|  |  | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -118,7 +118,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -145,7 +150,7 @@ void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisition::set_threshold(float threshold) | void GalileoE5aPcpsAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|  |  | ||||||
|     if (pfa == 0.0) |     if (pfa == 0.0) | ||||||
|         { |         { | ||||||
| @@ -203,7 +208,7 @@ void GalileoE5aPcpsAcquisition::init() | |||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisition::set_local_code() | void GalileoE5aPcpsAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     gr_complex* code = new gr_complex[code_length_]; |     auto* code = new gr_complex[code_length_]; | ||||||
|     char signal_[3]; |     char signal_[3]; | ||||||
|  |  | ||||||
|     if (acq_iq_) |     if (acq_iq_) | ||||||
| @@ -248,9 +253,9 @@ float GalileoE5aPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -264,11 +269,11 @@ void GalileoE5aPcpsAcquisition::set_state(int state) | |||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute__((unused))) | 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 |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // 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))) | 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 |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -43,7 +43,8 @@ class GalileoE5aPcpsAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, |     GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE5aPcpsAcquisition(); |     virtual ~GalileoE5aPcpsAcquisition(); | ||||||
| @@ -157,7 +158,7 @@ private: | |||||||
|     unsigned int in_streams_; |     unsigned int in_streams_; | ||||||
|     unsigned int out_streams_; |     unsigned int out_streams_; | ||||||
|  |  | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|  |  | ||||||
|     float threshold_; |     float threshold_; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -33,7 +33,6 @@ | |||||||
| #include "galileo_e5_signal_processing.h" | #include "galileo_e5_signal_processing.h" | ||||||
| #include "Galileo_E5a.h" | #include "Galileo_E5a.h" | ||||||
| #include "gnss_sdr_flags.h" | #include "gnss_sdr_flags.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <boost/math/distributions/exponential.hpp> | #include <boost/math/distributions/exponential.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <volk_gnsssdr/volk_gnsssdr_complex.h> | #include <volk_gnsssdr/volk_gnsssdr_complex.h> | ||||||
| @@ -41,12 +40,13 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, | 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"); |     //printf("creating the E5A acquisition"); | ||||||
|     pcpsconf_fpga_t acq_parameters; |     pcpsconf_fpga_t acq_parameters; | ||||||
| @@ -58,8 +58,8 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | |||||||
|  |  | ||||||
|     //item_type_ = configuration_->property(role + ".item_type", default_item_type); |     //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); | ||||||
|     long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); |     int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in; |     acq_parameters.fs_in = fs_in; | ||||||
|     //acq_parameters.freq = 0; |     //acq_parameters.freq = 0; | ||||||
|  |  | ||||||
| @@ -209,7 +209,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     //threshold_ = 0.0; |     //threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     //printf("creating the E5A acquisition end"); |     //printf("creating the E5A acquisition end"); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -221,6 +221,11 @@ GalileoE5aPcpsAcquisitionFpga::~GalileoE5aPcpsAcquisitionFpga() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() | ||||||
|  | { | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) | void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -231,7 +236,7 @@ void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold) | void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     //    float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     //    float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|     // |     // | ||||||
|     //    if (pfa == 0.0) |     //    if (pfa == 0.0) | ||||||
|     //        { |     //        { | ||||||
|   | |||||||
| @@ -45,7 +45,8 @@ class GalileoE5aPcpsAcquisitionFpga : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, |     GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GalileoE5aPcpsAcquisitionFpga(); |     virtual ~GalileoE5aPcpsAcquisitionFpga(); | ||||||
| @@ -160,7 +161,7 @@ private: | |||||||
|     unsigned int in_streams_; |     unsigned int in_streams_; | ||||||
|     unsigned int out_streams_; |     unsigned int out_streams_; | ||||||
|  |  | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|  |  | ||||||
|  |  | ||||||
|     float threshold_; |     float threshold_; | ||||||
|   | |||||||
| @@ -43,13 +43,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GlonassL1CaPcpsAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -60,7 +61,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GLONASS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GLONASS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); | ||||||
| @@ -94,7 +95,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[vector_length_]; |     code_ = new gr_complex[vector_length_]; | ||||||
|  |  | ||||||
|     if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -114,7 +115,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | |||||||
|     acquisition_ = pcps_make_acquisition(acq_parameters); |     acquisition_ = pcps_make_acquisition(acq_parameters); | ||||||
|     DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; |     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(); |             cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); | ||||||
|             float_to_complex_ = gr::blocks::float_to_complex::make(); |             float_to_complex_ = gr::blocks::float_to_complex::make(); | ||||||
| @@ -123,7 +124,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GlonassL1CaPcpsAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -207,7 +213,7 @@ void GlonassL1CaPcpsAcquisition::init() | |||||||
|  |  | ||||||
| void GlonassL1CaPcpsAcquisition::set_local_code() | void GlonassL1CaPcpsAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     std::complex<float>* code = new std::complex<float>[code_length_]; |     auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|     glonass_l1_ca_code_gen_complex_sampled(code, /* gnss_synchro_->PRN,*/ fs_in_, 0); |     glonass_l1_ca_code_gen_complex_sampled(code, /* gnss_synchro_->PRN,*/ fs_in_, 0); | ||||||
|  |  | ||||||
| @@ -251,9 +257,9 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = static_cast<double>(vector_length_); |     auto lambda = static_cast<double>(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -261,15 +267,15 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) | void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // 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_, 0, float_to_complex_, 0); | ||||||
|             top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); |             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) | void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     else if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             // Since a byte-based acq implementation is not available, |             // Since a byte-based acq implementation is not available, | ||||||
|             // we just convert cshorts to gr_complex |             // we just convert cshorts to gr_complex | ||||||
| @@ -309,23 +315,21 @@ void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() | gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             return cbyte_to_float_x2_; |             return cbyte_to_float_x2_; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << item_type_ << " unknown acquisition item type"; | ||||||
|             LOG(WARNING) << item_type_ << " unknown acquisition item type"; |     return nullptr; | ||||||
|             return nullptr; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -51,7 +51,8 @@ class GlonassL1CaPcpsAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GlonassL1CaPcpsAcquisition(ConfigurationInterface* configuration, |     GlonassL1CaPcpsAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GlonassL1CaPcpsAcquisition(); |     virtual ~GlonassL1CaPcpsAcquisition(); | ||||||
| @@ -153,7 +154,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|   | |||||||
| @@ -42,13 +42,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GlonassL2CaPcpsAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -59,7 +60,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GLONASS_L2_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GLONASS_L2_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); | ||||||
| @@ -93,7 +94,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[vector_length_]; |     code_ = new gr_complex[vector_length_]; | ||||||
|  |  | ||||||
|     if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -113,7 +114,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | |||||||
|     acquisition_ = pcps_make_acquisition(acq_parameters); |     acquisition_ = pcps_make_acquisition(acq_parameters); | ||||||
|     DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; |     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(); |             cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); | ||||||
|             float_to_complex_ = gr::blocks::float_to_complex::make(); |             float_to_complex_ = gr::blocks::float_to_complex::make(); | ||||||
| @@ -122,7 +123,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GlonassL2CaPcpsAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -206,7 +212,7 @@ void GlonassL2CaPcpsAcquisition::init() | |||||||
|  |  | ||||||
| void GlonassL2CaPcpsAcquisition::set_local_code() | void GlonassL2CaPcpsAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     std::complex<float>* code = new std::complex<float>[code_length_]; |     auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|     glonass_l2_ca_code_gen_complex_sampled(code, /* gnss_synchro_->PRN,*/ fs_in_, 0); |     glonass_l2_ca_code_gen_complex_sampled(code, /* gnss_synchro_->PRN,*/ fs_in_, 0); | ||||||
|  |  | ||||||
| @@ -250,9 +256,9 @@ float GlonassL2CaPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = static_cast<double>(vector_length_); |     auto lambda = static_cast<double>(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -260,15 +266,15 @@ float GlonassL2CaPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) | void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     else if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             // Since a byte-based acq implementation is not available, |             // Since a byte-based acq implementation is not available, | ||||||
|             // we just convert cshorts to gr_complex |             // 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) | void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // 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_, 0, float_to_complex_, 0); | ||||||
|             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); |             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); | ||||||
| @@ -308,23 +314,21 @@ void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() | gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             return cbyte_to_float_x2_; |             return cbyte_to_float_x2_; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << item_type_ << " unknown acquisition item type"; | ||||||
|             LOG(WARNING) << item_type_ << " unknown acquisition item type"; |     return nullptr; | ||||||
|             return nullptr; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -50,7 +50,8 @@ class GlonassL2CaPcpsAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GlonassL2CaPcpsAcquisition(ConfigurationInterface* configuration, |     GlonassL2CaPcpsAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GlonassL2CaPcpsAcquisition(); |     virtual ~GlonassL2CaPcpsAcquisition(); | ||||||
| @@ -152,7 +153,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|   | |||||||
| @@ -45,13 +45,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -61,7 +62,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | |||||||
|     DLOG(INFO) << "role " << role; |     DLOG(INFO) << "role " << role; | ||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(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); |     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_]; |     code_ = new gr_complex[vector_length_]; | ||||||
|  |  | ||||||
|     if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -109,7 +110,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | |||||||
|     acquisition_ = pcps_make_acquisition(acq_parameters); |     acquisition_ = pcps_make_acquisition(acq_parameters); | ||||||
|     DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; |     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(); |             cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); | ||||||
|             float_to_complex_ = gr::blocks::float_to_complex::make(); |             float_to_complex_ = gr::blocks::float_to_complex::make(); | ||||||
| @@ -118,7 +119,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -200,7 +206,7 @@ void GpsL1CaPcpsAcquisition::init() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsAcquisition::set_local_code() | void GpsL1CaPcpsAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     std::complex<float>* code = new std::complex<float>[code_length_]; |     auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|     gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); |     gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); | ||||||
|  |  | ||||||
| @@ -239,9 +245,9 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -249,15 +255,15 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) | void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     else if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             // Since a byte-based acq implementation is not available, |             // Since a byte-based acq implementation is not available, | ||||||
|             // we just convert cshorts to gr_complex |             // 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) | void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // 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_, 0, float_to_complex_, 0); | ||||||
|             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); |             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); | ||||||
| @@ -297,23 +303,21 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() | gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             return cbyte_to_float_x2_; |             return cbyte_to_float_x2_; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << item_type_ << " unknown acquisition item type"; | ||||||
|             LOG(WARNING) << item_type_ << " unknown acquisition item type"; |     return nullptr; | ||||||
|             return nullptr; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -55,7 +55,8 @@ class GpsL1CaPcpsAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsAcquisition(ConfigurationInterface* configuration, |     GpsL1CaPcpsAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsAcquisition(); |     virtual ~GpsL1CaPcpsAcquisition(); | ||||||
| @@ -157,7 +158,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|   | |||||||
| @@ -42,13 +42,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( | GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
|     std::string default_dump_filename = "./acquisition.mat"; |     std::string default_dump_filename = "./acquisition.mat"; | ||||||
| @@ -57,7 +58,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( | |||||||
|     Acq_Conf acq_parameters = Acq_Conf(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|  |  | ||||||
|     item_type_ = configuration->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in))); | ||||||
| @@ -80,7 +81,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( | |||||||
|     acq_parameters.samples_per_ms = vector_length_; |     acq_parameters.samples_per_ms = vector_length_; | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters); |             acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters); | ||||||
| @@ -94,7 +95,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL1CaPcpsAcquisitionFineDoppler::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|   | |||||||
| @@ -49,7 +49,8 @@ class GpsL1CaPcpsAcquisitionFineDoppler : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration, |     GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsAcquisitionFineDoppler(); |     virtual ~GpsL1CaPcpsAcquisitionFineDoppler(); | ||||||
| @@ -142,7 +143,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     int max_dwells_; |     int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -48,13 +48,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     pcpsconf_fpga_t acq_parameters; |     pcpsconf_fpga_t acq_parameters; | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -62,8 +63,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | |||||||
|  |  | ||||||
|     DLOG(INFO) << "role " << role; |     DLOG(INFO) << "role " << role; | ||||||
|  |  | ||||||
|     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); | ||||||
|     long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); |     int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     //fs_in = fs_in/2.0; // downampling filter |     //fs_in = fs_in/2.0; // downampling filter | ||||||
|     //printf("####### DEBUG Acq: fs_in = %d\n", fs_in); |     //printf("####### DEBUG Acq: fs_in = %d\n", fs_in); | ||||||
|     acq_parameters.fs_in = fs_in; |     acq_parameters.fs_in = fs_in; | ||||||
| @@ -173,7 +174,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | |||||||
|  |  | ||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     doppler_step_ = 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) | void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|   | |||||||
| @@ -53,7 +53,8 @@ class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration, |     GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsAcquisitionFpga(); |     virtual ~GpsL1CaPcpsAcquisitionFpga(); | ||||||
|   | |||||||
| @@ -42,13 +42,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( | GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
|     std::string default_dump_filename = "./data/acquisition.dat"; |     std::string default_dump_filename = "./data/acquisition.dat"; | ||||||
| @@ -56,7 +57,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( | |||||||
|     DLOG(INFO) << "role " << role; |     DLOG(INFO) << "role " << role; | ||||||
|  |  | ||||||
|     item_type_ = configuration->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration->property(role + ".dump", false); |     dump_ = configuration->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||||
| @@ -71,7 +72,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_, |             acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_, | ||||||
| @@ -87,7 +88,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL1CaPcpsAssistedAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|   | |||||||
| @@ -49,7 +49,8 @@ class GpsL1CaPcpsAssistedAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsAssistedAcquisition(ConfigurationInterface* configuration, |     GpsL1CaPcpsAssistedAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsAssistedAcquisition(); |     virtual ~GpsL1CaPcpsAssistedAcquisition(); | ||||||
| @@ -140,7 +141,7 @@ private: | |||||||
|     int doppler_min_; |     int doppler_min_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     int max_dwells_; |     int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -40,13 +40,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( | GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -57,7 +58,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( | |||||||
|     item_type_ = configuration_->property(role + ".item_type", |     item_type_ = configuration_->property(role + ".item_type", | ||||||
|         default_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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||||
| @@ -85,7 +86,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, |             acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, | ||||||
| @@ -106,7 +107,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -136,7 +142,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) | void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|  |  | ||||||
|     if (pfa == 0.0) |     if (pfa == 0.0) | ||||||
|         { |         { | ||||||
| @@ -153,7 +159,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) | |||||||
|  |  | ||||||
|     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -163,7 +169,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) | |||||||
| void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max) | void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max) | ||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             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) | void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -192,7 +198,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | |||||||
|  |  | ||||||
| signed int GpsL1CaPcpsOpenClAcquisition::mag() | signed int GpsL1CaPcpsOpenClAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
| @@ -212,7 +218,7 @@ void GpsL1CaPcpsOpenClAcquisition::init() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsOpenClAcquisition::set_local_code() | void GpsL1CaPcpsOpenClAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             std::complex<float>* code = new std::complex<float>[code_length_]; |             std::complex<float>* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
| @@ -233,7 +239,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsOpenClAcquisition::reset() | void GpsL1CaPcpsOpenClAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -265,7 +271,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block) | 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); |             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) | 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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -48,7 +48,8 @@ class GpsL1CaPcpsOpenClAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsOpenClAcquisition(ConfigurationInterface* configuration, |     GpsL1CaPcpsOpenClAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsOpenClAcquisition(); |     virtual ~GpsL1CaPcpsOpenClAcquisition(); | ||||||
| @@ -144,7 +145,7 @@ private: | |||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -41,13 +41,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -56,7 +57,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | |||||||
|     DLOG(INFO) << "role " << role; |     DLOG(INFO) << "role " << role; | ||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||||
| @@ -67,7 +68,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | |||||||
|     code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); |     code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); | ||||||
|  |  | ||||||
|     /*Calculate the folding factor value based on the calculations*/ |     /*Calculate the folding factor value based on the calculations*/ | ||||||
|     unsigned int temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_)))); |     auto temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_)))); | ||||||
|     folding_factor_ = configuration_->property(role + ".folding_factor", temp); |     folding_factor_ = configuration_->property(role + ".folding_factor", temp); | ||||||
|  |  | ||||||
|     if (sampled_ms_ % folding_factor_ != 0) |     if (sampled_ms_ % folding_factor_ != 0) | ||||||
| @@ -112,7 +113,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | |||||||
|               << ", Sampled  ms: " << sampled_ms_ |               << ", Sampled  ms: " << sampled_ms_ | ||||||
|               << ", Code Length: " << code_length_; |               << ", Code Length: " << code_length_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(gr_complex); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, |             acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, | ||||||
| @@ -135,7 +136,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -165,9 +171,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) | void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + |     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|                                              boost::lexical_cast<std::string>(channel_) + ".pfa", |  | ||||||
|         0.0); |  | ||||||
|  |  | ||||||
|     if (pfa == 0.0) |     if (pfa == 0.0) | ||||||
|         { |         { | ||||||
| @@ -184,7 +188,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) | |||||||
|  |  | ||||||
|     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; |     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -194,7 +198,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) | |||||||
| void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_max(unsigned int doppler_max) | void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_max(unsigned int doppler_max) | ||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             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) | void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -223,14 +227,11 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchr | |||||||
|  |  | ||||||
| signed int GpsL1CaPcpsQuickSyncAcquisition::mag() | signed int GpsL1CaPcpsQuickSyncAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -243,13 +244,12 @@ void GpsL1CaPcpsQuickSyncAcquisition::init() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() | void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             std::complex<float>* code = new std::complex<float>[code_length_](); |             auto* code = new std::complex<float>[code_length_](); | ||||||
|  |  | ||||||
|             gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); |             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++) |             for (unsigned int i = 0; i < (sampled_ms_ / folding_factor_); i++) | ||||||
|                 { |                 { | ||||||
|                     memcpy(&(code_[i * code_length_]), code, |                     memcpy(&(code_[i * code_length_]), code, | ||||||
| @@ -266,7 +266,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::reset() | void GpsL1CaPcpsQuickSyncAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -275,7 +275,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::reset() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state) | void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_state(state); |             acquisition_cc_->set_state(state); | ||||||
|         } |         } | ||||||
| @@ -296,7 +296,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) | |||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = static_cast<double>(code_length_) / static_cast<double>(folding_factor_); |     double lambda = static_cast<double>(code_length_) / static_cast<double>(folding_factor_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -304,7 +304,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block) | 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); |             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
| @@ -313,7 +313,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsQuickSyncAcquisition::disconnect(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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -50,7 +50,8 @@ class GpsL1CaPcpsQuickSyncAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsQuickSyncAcquisition(ConfigurationInterface* configuration, |     GpsL1CaPcpsQuickSyncAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsQuickSyncAcquisition(); |     virtual ~GpsL1CaPcpsQuickSyncAcquisition(); | ||||||
| @@ -151,7 +152,7 @@ private: | |||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     unsigned int folding_factor_; |     unsigned int folding_factor_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -40,13 +40,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
|     std::string default_item_type = "gr_complex"; |     std::string default_item_type = "gr_complex"; | ||||||
| @@ -56,7 +57,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     dump_ = configuration_->property(role + ".dump", false); |     dump_ = configuration_->property(role + ".dump", false); | ||||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); |     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||||
| @@ -76,7 +77,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[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); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_, |             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_, | ||||||
| @@ -97,7 +98,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_channel(channel_); |             acquisition_cc_->set_channel(channel_); | ||||||
|         } |         } | ||||||
| @@ -127,7 +133,7 @@ void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) | void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|  |  | ||||||
|     if (pfa == 0.0) |     if (pfa == 0.0) | ||||||
|         { |         { | ||||||
| @@ -144,7 +150,7 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) | |||||||
|  |  | ||||||
|     DLOG(INFO) << "Channel " << channel_ << "  Threshold = " << threshold_; |     DLOG(INFO) << "Channel " << channel_ << "  Threshold = " << threshold_; | ||||||
|  |  | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_threshold(threshold_); |             acquisition_cc_->set_threshold(threshold_); | ||||||
|         } |         } | ||||||
| @@ -154,7 +160,7 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) | |||||||
| void GpsL1CaPcpsTongAcquisition::set_doppler_max(unsigned int doppler_max) | void GpsL1CaPcpsTongAcquisition::set_doppler_max(unsigned int doppler_max) | ||||||
| { | { | ||||||
|     doppler_max_ = 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_); |             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) | void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step) | ||||||
| { | { | ||||||
|     doppler_step_ = 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_); |             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) | void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* 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_); |             acquisition_cc_->set_gnss_synchro(gnss_synchro_); | ||||||
|         } |         } | ||||||
| @@ -183,14 +189,11 @@ void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | |||||||
|  |  | ||||||
| signed int GpsL1CaPcpsTongAcquisition::mag() | signed int GpsL1CaPcpsTongAcquisition::mag() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_cc_->mag(); |             return acquisition_cc_->mag(); | ||||||
|         } |         } | ||||||
|     else |     return 0; | ||||||
|         { |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -202,9 +205,9 @@ void GpsL1CaPcpsTongAcquisition::init() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::set_local_code() | void GpsL1CaPcpsTongAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             std::complex<float>* code = new std::complex<float>[code_length_]; |             auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|             gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); |             gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); | ||||||
|  |  | ||||||
| @@ -223,7 +226,7 @@ void GpsL1CaPcpsTongAcquisition::set_local_code() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::reset() | void GpsL1CaPcpsTongAcquisition::reset() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_active(true); |             acquisition_cc_->set_active(true); | ||||||
|         } |         } | ||||||
| @@ -232,7 +235,7 @@ void GpsL1CaPcpsTongAcquisition::reset() | |||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::set_state(int state) | void GpsL1CaPcpsTongAcquisition::set_state(int state) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             acquisition_cc_->set_state(state); |             acquisition_cc_->set_state(state); | ||||||
|         } |         } | ||||||
| @@ -253,9 +256,9 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1 / static_cast<double>(ncells); |     double exponent = 1 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -263,7 +266,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) | 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); |             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
| @@ -272,7 +275,7 @@ void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| void GpsL1CaPcpsTongAcquisition::disconnect(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); |             top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -49,7 +49,8 @@ class GpsL1CaPcpsTongAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL1CaPcpsTongAcquisition(ConfigurationInterface* configuration, |     GpsL1CaPcpsTongAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL1CaPcpsTongAcquisition(); |     virtual ~GpsL1CaPcpsTongAcquisition(); | ||||||
| @@ -150,7 +151,7 @@ private: | |||||||
|     unsigned int tong_init_val_; |     unsigned int tong_init_val_; | ||||||
|     unsigned int tong_max_val_; |     unsigned int tong_max_val_; | ||||||
|     unsigned int tong_max_dwells_; |     unsigned int tong_max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|     std::complex<float>* code_; |     std::complex<float>* code_; | ||||||
|   | |||||||
| @@ -43,13 +43,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -61,7 +62,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | |||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     item_type_ = configuration_->property(role + ".item_type", default_item_type); | ||||||
|     //float pfa =  configuration_->property(role + ".pfa", 0.0); |     //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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||||
| @@ -97,7 +98,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | |||||||
|  |  | ||||||
|     code_ = new gr_complex[vector_length_]; |     code_ = new gr_complex[vector_length_]; | ||||||
|  |  | ||||||
|     if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -116,7 +117,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | |||||||
|     acquisition_ = pcps_make_acquisition(acq_parameters); |     acquisition_ = pcps_make_acquisition(acq_parameters); | ||||||
|     DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; |     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(); |             cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); | ||||||
|             float_to_complex_ = gr::blocks::float_to_complex::make(); |             float_to_complex_ = gr::blocks::float_to_complex::make(); | ||||||
| @@ -125,7 +126,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     num_codes_ = acq_parameters.sampled_ms / acq_parameters.ms_per_code; |     num_codes_ = acq_parameters.sampled_ms / acq_parameters.ms_per_code; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
| @@ -144,6 +145,11 @@ GpsL2MPcpsAcquisition::~GpsL2MPcpsAcquisition() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void GpsL2MPcpsAcquisition::stop_acquisition() | ||||||
|  | { | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) | void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -153,7 +159,7 @@ void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisition::set_threshold(float threshold) | void GpsL2MPcpsAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|  |  | ||||||
|     if (pfa == 0.0) |     if (pfa == 0.0) | ||||||
|         { |         { | ||||||
| @@ -215,7 +221,7 @@ void GpsL2MPcpsAcquisition::init() | |||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisition::set_local_code() | void GpsL2MPcpsAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     std::complex<float>* code = new std::complex<float>[code_length_]; |     auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|     gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); |     gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); | ||||||
|  |  | ||||||
| @@ -253,9 +259,9 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1.0 / static_cast<double>(ncells); |     double exponent = 1.0 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -263,15 +269,15 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) | void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     else if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             // Since a byte-based acq implementation is not available, |             // Since a byte-based acq implementation is not available, | ||||||
|             // we just convert cshorts to gr_complex |             // 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) | void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // 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_, 0, float_to_complex_, 0); | ||||||
|             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); |             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); | ||||||
| @@ -311,23 +317,21 @@ void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() | gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             return cbyte_to_float_x2_; |             return cbyte_to_float_x2_; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << item_type_ << " unknown acquisition item type"; | ||||||
|             LOG(WARNING) << item_type_ << " unknown acquisition item type"; |     return nullptr; | ||||||
|             return nullptr; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -53,7 +53,8 @@ class GpsL2MPcpsAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL2MPcpsAcquisition(ConfigurationInterface* configuration, |     GpsL2MPcpsAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL2MPcpsAcquisition(); |     virtual ~GpsL2MPcpsAcquisition(); | ||||||
| @@ -154,7 +155,7 @@ private: | |||||||
|     unsigned int doppler_max_; |     unsigned int doppler_max_; | ||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|   | |||||||
| @@ -43,13 +43,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisitionFpga::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( | GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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) | ||||||
| { | { | ||||||
|     //pcpsconf_t acq_parameters; |     //pcpsconf_t acq_parameters; | ||||||
|     pcpsconf_fpga_t acq_parameters; |     pcpsconf_fpga_t acq_parameters; | ||||||
| @@ -62,7 +63,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( | |||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     item_type_ = configuration_->property(role + ".item_type", default_item_type); | ||||||
|     //float pfa =  configuration_->property(role + ".pfa", 0.0); |     //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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     //if_ = configuration_->property(role + ".if", 0); |     //if_ = configuration_->property(role + ".if", 0); | ||||||
| @@ -153,7 +154,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( | |||||||
|  |  | ||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|  |  | ||||||
|  |  | ||||||
|     //    vector_length_ = code_length_; |     //    vector_length_ = code_length_; | ||||||
| @@ -206,6 +207,11 @@ GpsL2MPcpsAcquisitionFpga::~GpsL2MPcpsAcquisitionFpga() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void GpsL2MPcpsAcquisitionFpga::stop_acquisition() | ||||||
|  | { | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) | void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -215,7 +221,7 @@ void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold) | void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     //    float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     //    float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|     // |     // | ||||||
|     //    if (pfa == 0.0) |     //    if (pfa == 0.0) | ||||||
|     //        { |     //        { | ||||||
|   | |||||||
| @@ -54,7 +54,8 @@ class GpsL2MPcpsAcquisitionFpga : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL2MPcpsAcquisitionFpga(ConfigurationInterface* configuration, |     GpsL2MPcpsAcquisitionFpga(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL2MPcpsAcquisitionFpga(); |     virtual ~GpsL2MPcpsAcquisitionFpga(); | ||||||
| @@ -157,7 +158,7 @@ private: | |||||||
|     unsigned int doppler_max_; |     unsigned int doppler_max_; | ||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     //long if_; |     //long if_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|   | |||||||
| @@ -43,13 +43,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisition::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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(); |     Acq_Conf acq_parameters = Acq_Conf(); | ||||||
|     configuration_ = configuration; |     configuration_ = configuration; | ||||||
| @@ -60,7 +61,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | |||||||
|  |  | ||||||
|     item_type_ = configuration_->property(role + ".item_type", default_item_type); |     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); |     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in_; |     acq_parameters.fs_in = fs_in_; | ||||||
|     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); |     acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(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); |     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_]; |     code_ = new gr_complex[vector_length_]; | ||||||
|  |  | ||||||
|     if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(lv_16sc_t); |             item_size_ = sizeof(lv_16sc_t); | ||||||
|         } |         } | ||||||
| @@ -108,7 +109,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | |||||||
|     acquisition_ = pcps_make_acquisition(acq_parameters); |     acquisition_ = pcps_make_acquisition(acq_parameters); | ||||||
|     DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; |     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(); |             cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); | ||||||
|             float_to_complex_ = gr::blocks::float_to_complex::make(); |             float_to_complex_ = gr::blocks::float_to_complex::make(); | ||||||
| @@ -116,7 +117,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     threshold_ = 0.0; |     threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     if (in_streams_ > 1) |     if (in_streams_ > 1) | ||||||
|         { |         { | ||||||
|             LOG(ERROR) << "This implementation only supports one input stream"; |             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) | void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -143,7 +149,7 @@ void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisition::set_threshold(float threshold) | void GpsL5iPcpsAcquisition::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|  |  | ||||||
|     if (pfa == 0.0) |     if (pfa == 0.0) | ||||||
|         { |         { | ||||||
| @@ -203,7 +209,7 @@ void GpsL5iPcpsAcquisition::init() | |||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisition::set_local_code() | void GpsL5iPcpsAcquisition::set_local_code() | ||||||
| { | { | ||||||
|     std::complex<float>* code = new std::complex<float>[code_length_]; |     auto* code = new std::complex<float>[code_length_]; | ||||||
|  |  | ||||||
|     gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); |     gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); | ||||||
|  |  | ||||||
| @@ -241,9 +247,9 @@ float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|     unsigned int ncells = vector_length_ * frequency_bins; |     unsigned int ncells = vector_length_ * frequency_bins; | ||||||
|     double exponent = 1.0 / static_cast<double>(ncells); |     double exponent = 1.0 / static_cast<double>(ncells); | ||||||
|     double val = pow(1.0 - pfa, exponent); |     double val = pow(1.0 - pfa, exponent); | ||||||
|     double lambda = double(vector_length_); |     auto lambda = double(vector_length_); | ||||||
|     boost::math::exponential_distribution<double> mydist(lambda); |     boost::math::exponential_distribution<double> mydist(lambda); | ||||||
|     float threshold = static_cast<float>(quantile(mydist, val)); |     auto threshold = static_cast<float>(quantile(mydist, val)); | ||||||
|  |  | ||||||
|     return threshold; |     return threshold; | ||||||
| } | } | ||||||
| @@ -251,15 +257,15 @@ float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) | |||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) | void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to connect |             // nothing to connect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     else if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             // Since a byte-based acq implementation is not available, |             // Since a byte-based acq implementation is not available, | ||||||
|             // we just convert cshorts to gr_complex |             // 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) | void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // nothing to disconnect | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     else if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             // nothing to disconnect |             // 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_, 0, float_to_complex_, 0); | ||||||
|             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); |             top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); | ||||||
| @@ -299,23 +305,21 @@ void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) | |||||||
|  |  | ||||||
| gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() | gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() | ||||||
| { | { | ||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_ == "gr_complex") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cshort") == 0) |     if (item_type_ == "cshort") | ||||||
|         { |         { | ||||||
|             return acquisition_; |             return acquisition_; | ||||||
|         } |         } | ||||||
|     else if (item_type_.compare("cbyte") == 0) |     if (item_type_ == "cbyte") | ||||||
|         { |         { | ||||||
|             return cbyte_to_float_x2_; |             return cbyte_to_float_x2_; | ||||||
|         } |         } | ||||||
|     else |  | ||||||
|         { |     LOG(WARNING) << item_type_ << " unknown acquisition item type"; | ||||||
|             LOG(WARNING) << item_type_ << " unknown acquisition item type"; |     return nullptr; | ||||||
|             return nullptr; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -53,7 +53,8 @@ class GpsL5iPcpsAcquisition : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL5iPcpsAcquisition(ConfigurationInterface* configuration, |     GpsL5iPcpsAcquisition(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL5iPcpsAcquisition(); |     virtual ~GpsL5iPcpsAcquisition(); | ||||||
| @@ -154,7 +155,7 @@ private: | |||||||
|     unsigned int doppler_max_; |     unsigned int doppler_max_; | ||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|     std::string dump_filename_; |     std::string dump_filename_; | ||||||
|   | |||||||
| @@ -43,13 +43,14 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisitionFpga::stop_acquisition() |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||||
|     ConfigurationInterface* configuration, std::string role, |     ConfigurationInterface* configuration, | ||||||
|     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("L5 ACQ CLASS CREATED\n"); |     //printf("L5 ACQ CLASS CREATED\n"); | ||||||
|     pcpsconf_fpga_t acq_parameters; |     pcpsconf_fpga_t acq_parameters; | ||||||
| @@ -61,8 +62,8 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | |||||||
|  |  | ||||||
|     //item_type_ = configuration_->property(role + ".item_type", default_item_type); |     //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); | ||||||
|     long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); |     int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||||
|     acq_parameters.fs_in = fs_in; |     acq_parameters.fs_in = fs_in; | ||||||
|     //if_ = configuration_->property(role + ".if", 0); |     //if_ = configuration_->property(role + ".if", 0); | ||||||
|     //acq_parameters.freq = if_; |     //acq_parameters.freq = if_; | ||||||
| @@ -207,7 +208,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | |||||||
|     channel_ = 0; |     channel_ = 0; | ||||||
|     //    threshold_ = 0.0; |     //    threshold_ = 0.0; | ||||||
|     doppler_step_ = 0; |     doppler_step_ = 0; | ||||||
|     gnss_synchro_ = 0; |     gnss_synchro_ = nullptr; | ||||||
|     //printf("L5 ACQ CLASS FINISHED\n"); |     //printf("L5 ACQ CLASS FINISHED\n"); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -219,6 +220,11 @@ GpsL5iPcpsAcquisitionFpga::~GpsL5iPcpsAcquisitionFpga() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void GpsL5iPcpsAcquisitionFpga::stop_acquisition() | ||||||
|  | { | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) | void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) | ||||||
| { | { | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
| @@ -228,7 +234,7 @@ void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) | |||||||
|  |  | ||||||
| void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold) | void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold) | ||||||
| { | { | ||||||
|     //    float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); |     //    float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||||
|     // |     // | ||||||
|     //    if (pfa == 0.0) |     //    if (pfa == 0.0) | ||||||
|     //        { |     //        { | ||||||
|   | |||||||
| @@ -54,7 +54,8 @@ class GpsL5iPcpsAcquisitionFpga : public AcquisitionInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     GpsL5iPcpsAcquisitionFpga(ConfigurationInterface* configuration, |     GpsL5iPcpsAcquisitionFpga(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, | ||||||
|  |         unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~GpsL5iPcpsAcquisitionFpga(); |     virtual ~GpsL5iPcpsAcquisitionFpga(); | ||||||
| @@ -157,7 +158,7 @@ private: | |||||||
|     unsigned int doppler_max_; |     unsigned int doppler_max_; | ||||||
|     unsigned int doppler_step_; |     unsigned int doppler_step_; | ||||||
|     unsigned int max_dwells_; |     unsigned int max_dwells_; | ||||||
|     long fs_in_; |     int64_t fs_in_; | ||||||
|     //long if_; |     //long if_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|     bool blocking_; |     bool blocking_; | ||||||
|   | |||||||
| @@ -42,6 +42,7 @@ | |||||||
| #include <volk/volk.h> | #include <volk/volk.h> | ||||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | #include <volk_gnsssdr/volk_gnsssdr.h> | ||||||
| #include <sstream> | #include <sstream> | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| @@ -59,7 +60,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make | |||||||
| { | { | ||||||
|     return galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr( |     return galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr( | ||||||
|         new galileo_e5a_noncoherentIQ_acquisition_caf_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms, |         new galileo_e5a_noncoherentIQ_acquisition_caf_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms, | ||||||
|             samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_)); |             samples_per_code, bit_transition_flag, dump, std::move(dump_filename), both_signal_components_, CAF_window_hz_, Zero_padding_)); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -117,8 +118,8 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit | |||||||
|         } |         } | ||||||
|     else |     else | ||||||
|         { |         { | ||||||
|             d_fft_code_Q_A = 0; |             d_fft_code_Q_A = nullptr; | ||||||
|             d_magnitudeQA = 0; |             d_magnitudeQA = nullptr; | ||||||
|         } |         } | ||||||
|     // IF COHERENT INTEGRATION TIME > 1 |     // IF COHERENT INTEGRATION TIME > 1 | ||||||
|     if (d_sampled_ms > 1) |     if (d_sampled_ms > 1) | ||||||
| @@ -132,16 +133,16 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit | |||||||
|                 } |                 } | ||||||
|             else |             else | ||||||
|                 { |                 { | ||||||
|                     d_fft_code_Q_B = 0; |                     d_fft_code_Q_B = nullptr; | ||||||
|                     d_magnitudeQB = 0; |                     d_magnitudeQB = nullptr; | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
|         { |         { | ||||||
|             d_fft_code_I_B = 0; |             d_fft_code_I_B = nullptr; | ||||||
|             d_magnitudeIB = 0; |             d_magnitudeIB = nullptr; | ||||||
|             d_fft_code_Q_B = 0; |             d_fft_code_Q_B = nullptr; | ||||||
|             d_magnitudeQB = 0; |             d_magnitudeQB = nullptr; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     // Direct FFT |     // Direct FFT | ||||||
| @@ -152,19 +153,19 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit | |||||||
|  |  | ||||||
|     // For dumping samples into a file |     // For dumping samples into a file | ||||||
|     d_dump = dump; |     d_dump = dump; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|  |  | ||||||
|     d_doppler_resolution = 0; |     d_doppler_resolution = 0; | ||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
|     d_doppler_step = 250; |     d_doppler_step = 250; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
|     d_CAF_vector = 0; |     d_CAF_vector = nullptr; | ||||||
|     d_CAF_vector_I = 0; |     d_CAF_vector_I = nullptr; | ||||||
|     d_CAF_vector_Q = 0; |     d_CAF_vector_Q = nullptr; | ||||||
|     d_channel = 0; |     d_channel = 0; | ||||||
|     d_gr_stream_buffer = 0; |     d_gr_stream_buffer = 0; | ||||||
| } | } | ||||||
| @@ -393,7 +394,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items | |||||||
|             } |             } | ||||||
|         case 1: |         case 1: | ||||||
|             { |             { | ||||||
|                 const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |                 const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|                 unsigned int buff_increment; |                 unsigned int buff_increment; | ||||||
|                 if ((ninput_items[0] + d_buffer_count) <= d_fft_size) |                 if ((ninput_items[0] + d_buffer_count) <= d_fft_size) | ||||||
|                     { |                     { | ||||||
| @@ -417,7 +418,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items | |||||||
|         case 2: |         case 2: | ||||||
|             { |             { | ||||||
|                 // Fill last part of the buffer and reset counter |                 // Fill last part of the buffer and reset counter | ||||||
|                 const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |                 const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|                 if (d_buffer_count < d_fft_size) |                 if (d_buffer_count < d_fft_size) | ||||||
|                     { |                     { | ||||||
|                         memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex) * (d_fft_size - d_buffer_count)); |                         memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex) * (d_fft_size - d_buffer_count)); | ||||||
| @@ -674,7 +675,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items | |||||||
|                 if (d_CAF_window_hz > 0) |                 if (d_CAF_window_hz > 0) | ||||||
|                     { |                     { | ||||||
|                         int CAF_bins_half; |                         int CAF_bins_half; | ||||||
|                         float *accum = static_cast<float *>(volk_gnsssdr_malloc(sizeof(float), volk_gnsssdr_get_alignment())); |                         auto *accum = static_cast<float *>(volk_gnsssdr_malloc(sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|                         CAF_bins_half = d_CAF_window_hz / (2 * d_doppler_step); |                         CAF_bins_half = d_CAF_window_hz / (2 * d_doppler_step); | ||||||
|                         float weighting_factor; |                         float weighting_factor; | ||||||
|                         weighting_factor = 0.5 / static_cast<float>(CAF_bins_half); |                         weighting_factor = 0.5 / static_cast<float>(CAF_bins_half); | ||||||
|   | |||||||
| @@ -31,6 +31,7 @@ | |||||||
|  |  | ||||||
| #include "galileo_pcps_8ms_acquisition_cc.h" | #include "galileo_pcps_8ms_acquisition_cc.h" | ||||||
| #include <sstream> | #include <sstream> | ||||||
|  | #include <utility> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <gnuradio/io_signature.h> | #include <gnuradio/io_signature.h> | ||||||
| #include <volk/volk.h> | #include <volk/volk.h> | ||||||
| @@ -40,20 +41,26 @@ | |||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc( | galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t sampled_ms, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t max_dwells, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|     bool dump, std::string dump_filename) |     bool dump, std::string dump_filename) | ||||||
| { | { | ||||||
|     return galileo_pcps_8ms_acquisition_cc_sptr( |     return galileo_pcps_8ms_acquisition_cc_sptr( | ||||||
|         new galileo_pcps_8ms_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms, |         new galileo_pcps_8ms_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms, | ||||||
|             samples_per_code, dump, dump_filename)); |             samples_per_code, dump, std::move(dump_filename))); | ||||||
| } | } | ||||||
|  |  | ||||||
| galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( | galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t sampled_ms, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t max_dwells, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|     bool dump, |     bool dump, | ||||||
|     std::string dump_filename) : gr::block("galileo_pcps_8ms_acquisition_cc", |     std::string dump_filename) : gr::block("galileo_pcps_8ms_acquisition_cc", | ||||||
|                                      gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), |                                      gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), | ||||||
| @@ -87,24 +94,25 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( | |||||||
|  |  | ||||||
|     // For dumping samples into a file |     // For dumping samples into a file | ||||||
|     d_dump = dump; |     d_dump = dump; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|  |  | ||||||
|     d_doppler_resolution = 0; |     d_doppler_resolution = 0; | ||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
|     d_doppler_step = 0; |     d_doppler_step = 0; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
|     d_channel = 0; |     d_channel = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc() | galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc() | ||||||
| { | { | ||||||
|     if (d_num_doppler_bins > 0) |     if (d_num_doppler_bins > 0) | ||||||
|         { |         { | ||||||
|             for (unsigned int i = 0; i < d_num_doppler_bins; i++) |             for (uint32_t i = 0; i < d_num_doppler_bins; i++) | ||||||
|                 { |                 { | ||||||
|                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); |                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); | ||||||
|                 } |                 } | ||||||
| @@ -124,6 +132,7 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc() | |||||||
|         } |         } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void galileo_pcps_8ms_acquisition_cc::set_local_code(std::complex<float> *code) | void galileo_pcps_8ms_acquisition_cc::set_local_code(std::complex<float> *code) | ||||||
| { | { | ||||||
|     // code A: two replicas of a primary code |     // code A: two replicas of a primary code | ||||||
| @@ -145,6 +154,7 @@ void galileo_pcps_8ms_acquisition_cc::set_local_code(std::complex<float> *code) | |||||||
|     volk_32fc_conjugate_32fc(d_fft_code_B, d_fft_if->get_outbuf(), d_fft_size); |     volk_32fc_conjugate_32fc(d_fft_code_B, d_fft_if->get_outbuf(), d_fft_size); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void galileo_pcps_8ms_acquisition_cc::init() | void galileo_pcps_8ms_acquisition_cc::init() | ||||||
| { | { | ||||||
|     d_gnss_synchro->Flag_valid_acquisition = false; |     d_gnss_synchro->Flag_valid_acquisition = false; | ||||||
| @@ -160,8 +170,8 @@ void galileo_pcps_8ms_acquisition_cc::init() | |||||||
|     const double GALILEO_TWO_PI = 6.283185307179600; |     const double GALILEO_TWO_PI = 6.283185307179600; | ||||||
|     // Count the number of bins |     // Count the number of bins | ||||||
|     d_num_doppler_bins = 0; |     d_num_doppler_bins = 0; | ||||||
|     for (int doppler = static_cast<int>(-d_doppler_max); |     for (auto doppler = static_cast<int32_t>(-d_doppler_max); | ||||||
|          doppler <= static_cast<int>(d_doppler_max); |          doppler <= static_cast<int32_t>(d_doppler_max); | ||||||
|          doppler += d_doppler_step) |          doppler += d_doppler_step) | ||||||
|         { |         { | ||||||
|             d_num_doppler_bins++; |             d_num_doppler_bins++; | ||||||
| @@ -169,10 +179,10 @@ void galileo_pcps_8ms_acquisition_cc::init() | |||||||
|  |  | ||||||
|     // Create the carrier Doppler wipeoff signals |     // Create the carrier Doppler wipeoff signals | ||||||
|     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; |     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; | ||||||
|     for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |     for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|         { |         { | ||||||
|             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|             int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |             int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|             float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * doppler / static_cast<float>(d_fs_in); |             float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * doppler / static_cast<float>(d_fs_in); | ||||||
|             float _phase[1]; |             float _phase[1]; | ||||||
|             _phase[0] = 0; |             _phase[0] = 0; | ||||||
| @@ -181,7 +191,7 @@ void galileo_pcps_8ms_acquisition_cc::init() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void galileo_pcps_8ms_acquisition_cc::set_state(int state) | void galileo_pcps_8ms_acquisition_cc::set_state(int32_t state) | ||||||
| { | { | ||||||
|     d_state = state; |     d_state = state; | ||||||
|     if (d_state == 1) |     if (d_state == 1) | ||||||
| @@ -209,7 +219,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items, | |||||||
|     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, |     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, | ||||||
|     gr_vector_void_star &output_items __attribute__((unused))) |     gr_vector_void_star &output_items __attribute__((unused))) | ||||||
| { | { | ||||||
|     int acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL |     int32_t acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL | ||||||
|  |  | ||||||
|     switch (d_state) |     switch (d_state) | ||||||
|         { |         { | ||||||
| @@ -239,14 +249,14 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items, | |||||||
|         case 1: |         case 1: | ||||||
|             { |             { | ||||||
|                 // initialize acquisition algorithm |                 // initialize acquisition algorithm | ||||||
|                 int doppler; |                 int32_t doppler; | ||||||
|                 uint32_t indext = 0; |                 uint32_t indext = 0; | ||||||
|                 uint32_t indext_A = 0; |                 uint32_t indext_A = 0; | ||||||
|                 uint32_t indext_B = 0; |                 uint32_t indext_B = 0; | ||||||
|                 float magt = 0.0; |                 float magt = 0.0; | ||||||
|                 float magt_A = 0.0; |                 float magt_A = 0.0; | ||||||
|                 float magt_B = 0.0; |                 float magt_B = 0.0; | ||||||
|                 const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |                 const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|                 float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); |                 float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); | ||||||
|                 d_input_power = 0.0; |                 d_input_power = 0.0; | ||||||
|                 d_mag = 0.0; |                 d_mag = 0.0; | ||||||
| @@ -267,10 +277,10 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items, | |||||||
|                 d_input_power /= static_cast<float>(d_fft_size); |                 d_input_power /= static_cast<float>(d_fft_size); | ||||||
|  |  | ||||||
|                 // 2- Doppler frequency search loop |                 // 2- Doppler frequency search loop | ||||||
|                 for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |                 for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|                     { |                     { | ||||||
|                         // doppler search steps |                         // doppler search steps | ||||||
|                         doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |                         doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|  |  | ||||||
|                         volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, |                         volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, | ||||||
|                             d_grid_doppler_wipeoffs[doppler_index], d_fft_size); |                             d_grid_doppler_wipeoffs[doppler_index], d_fft_size); | ||||||
|   | |||||||
| @@ -44,10 +44,14 @@ class galileo_pcps_8ms_acquisition_cc; | |||||||
| typedef boost::shared_ptr<galileo_pcps_8ms_acquisition_cc> galileo_pcps_8ms_acquisition_cc_sptr; | typedef boost::shared_ptr<galileo_pcps_8ms_acquisition_cc> galileo_pcps_8ms_acquisition_cc_sptr; | ||||||
|  |  | ||||||
| galileo_pcps_8ms_acquisition_cc_sptr | galileo_pcps_8ms_acquisition_cc_sptr | ||||||
| galileo_pcps_8ms_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, | galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t max_dwells, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t doppler_max, | ||||||
|     bool dump, std::string dump_filename); |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|  |     bool dump, | ||||||
|  |     std::string dump_filename); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
|  * \brief This class implements a Parallel Code Phase Search Acquisition for |  * \brief This class implements a Parallel Code Phase Search Acquisition for | ||||||
| @@ -57,41 +61,52 @@ class galileo_pcps_8ms_acquisition_cc : public gr::block | |||||||
| { | { | ||||||
| private: | private: | ||||||
|     friend galileo_pcps_8ms_acquisition_cc_sptr |     friend galileo_pcps_8ms_acquisition_cc_sptr | ||||||
|     galileo_pcps_8ms_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, |     galileo_pcps_8ms_make_acquisition_cc( | ||||||
|         unsigned int doppler_max, long fs_in, |         uint32_t sampled_ms, | ||||||
|         int samples_per_ms, int samples_per_code, |         uint32_t max_dwells, | ||||||
|         bool dump, std::string dump_filename); |         uint32_t doppler_max, | ||||||
|  |         int64_t fs_in, | ||||||
|  |         int32_t samples_per_ms, | ||||||
|  |         int32_t samples_per_code, | ||||||
|  |         bool dump, | ||||||
|  |         std::string dump_filename); | ||||||
|  |  | ||||||
|  |     galileo_pcps_8ms_acquisition_cc( | ||||||
|  |         uint32_t sampled_ms, | ||||||
|  |         uint32_t max_dwells, | ||||||
|  |         uint32_t doppler_max, | ||||||
|  |         int64_t fs_in, | ||||||
|  |         int32_t samples_per_ms, | ||||||
|  |         int32_t samples_per_code, | ||||||
|  |         bool dump, | ||||||
|  |         std::string dump_filename); | ||||||
|  |  | ||||||
|     galileo_pcps_8ms_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, |     void calculate_magnitudes( | ||||||
|         unsigned int doppler_max, long fs_in, |         gr_complex* fft_begin, | ||||||
|         int samples_per_ms, int samples_per_code, |         int32_t doppler_shift, | ||||||
|         bool dump, std::string dump_filename); |         int32_t doppler_offset); | ||||||
|  |  | ||||||
|     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, |     int64_t d_fs_in; | ||||||
|         int doppler_offset); |     int32_t d_samples_per_ms; | ||||||
|  |     int32_t d_samples_per_code; | ||||||
|     long d_fs_in; |     uint32_t d_doppler_resolution; | ||||||
|     int d_samples_per_ms; |  | ||||||
|     int d_samples_per_code; |  | ||||||
|     unsigned int d_doppler_resolution; |  | ||||||
|     float d_threshold; |     float d_threshold; | ||||||
|     std::string d_satellite_str; |     std::string d_satellite_str; | ||||||
|     unsigned int d_doppler_max; |     uint32_t d_doppler_max; | ||||||
|     unsigned int d_doppler_step; |     uint32_t d_doppler_step; | ||||||
|     unsigned int d_sampled_ms; |     uint32_t d_sampled_ms; | ||||||
|     unsigned int d_max_dwells; |     uint32_t d_max_dwells; | ||||||
|     unsigned int d_well_count; |     uint32_t d_well_count; | ||||||
|     unsigned int d_fft_size; |     uint32_t d_fft_size; | ||||||
|     uint64_t d_sample_counter; |     uint64_t d_sample_counter; | ||||||
|     gr_complex** d_grid_doppler_wipeoffs; |     gr_complex** d_grid_doppler_wipeoffs; | ||||||
|     unsigned int d_num_doppler_bins; |     uint32_t d_num_doppler_bins; | ||||||
|     gr_complex* d_fft_code_A; |     gr_complex* d_fft_code_A; | ||||||
|     gr_complex* d_fft_code_B; |     gr_complex* d_fft_code_B; | ||||||
|     gr::fft::fft_complex* d_fft_if; |     gr::fft::fft_complex* d_fft_if; | ||||||
|     gr::fft::fft_complex* d_ifft; |     gr::fft::fft_complex* d_ifft; | ||||||
|     Gnss_Synchro* d_gnss_synchro; |     Gnss_Synchro* d_gnss_synchro; | ||||||
|     unsigned int d_code_phase; |     uint32_t d_code_phase; | ||||||
|     float d_doppler_freq; |     float d_doppler_freq; | ||||||
|     float d_mag; |     float d_mag; | ||||||
|     float* d_magnitude; |     float* d_magnitude; | ||||||
| @@ -99,9 +114,9 @@ private: | |||||||
|     float d_test_statistics; |     float d_test_statistics; | ||||||
|     std::ofstream d_dump_file; |     std::ofstream d_dump_file; | ||||||
|     bool d_active; |     bool d_active; | ||||||
|     int d_state; |     int32_t d_state; | ||||||
|     bool d_dump; |     bool d_dump; | ||||||
|     unsigned int d_channel; |     uint32_t d_channel; | ||||||
|     std::string d_dump_filename; |     std::string d_dump_filename; | ||||||
|  |  | ||||||
| public: | public: | ||||||
| @@ -123,7 +138,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      * \brief Returns the maximum peak of grid search. |      * \brief Returns the maximum peak of grid search. | ||||||
|      */ |      */ | ||||||
|     inline unsigned int mag() const |     inline uint32_t mag() const | ||||||
|     { |     { | ||||||
|         return d_mag; |         return d_mag; | ||||||
|     } |     } | ||||||
| @@ -154,13 +169,13 @@ public: | |||||||
|      * first available sample. |      * first available sample. | ||||||
|      * \param state - int=1 forces start of acquisition |      * \param state - int=1 forces start of acquisition | ||||||
|      */ |      */ | ||||||
|     void set_state(int state); |     void set_state(int32_t state); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Set acquisition channel unique ID |      * \brief Set acquisition channel unique ID | ||||||
|      * \param channel - receiver channel. |      * \param channel - receiver channel. | ||||||
|      */ |      */ | ||||||
|     inline void set_channel(unsigned int channel) |     inline void set_channel(uint32_t channel) | ||||||
|     { |     { | ||||||
|         d_channel = channel; |         d_channel = channel; | ||||||
|     } |     } | ||||||
| @@ -179,7 +194,7 @@ public: | |||||||
|      * \brief Set maximum Doppler grid search |      * \brief Set maximum Doppler grid search | ||||||
|      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. |      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. | ||||||
|      */ |      */ | ||||||
|     inline void set_doppler_max(unsigned int doppler_max) |     inline void set_doppler_max(uint32_t doppler_max) | ||||||
|     { |     { | ||||||
|         d_doppler_max = doppler_max; |         d_doppler_max = doppler_max; | ||||||
|     } |     } | ||||||
| @@ -188,7 +203,7 @@ public: | |||||||
|      * \brief Set Doppler steps for the grid search |      * \brief Set Doppler steps for the grid search | ||||||
|      * \param doppler_step - Frequency bin of the search grid [Hz]. |      * \param doppler_step - Frequency bin of the search grid [Hz]. | ||||||
|      */ |      */ | ||||||
|     inline void set_doppler_step(unsigned int doppler_step) |     inline void set_doppler_step(uint32_t doppler_step) | ||||||
|     { |     { | ||||||
|         d_doppler_step = doppler_step; |         d_doppler_step = doppler_step; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -34,8 +34,8 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "pcps_acquisition.h" | #include "pcps_acquisition.h" | ||||||
|  | #include "GLONASS_L1_L2_CA.h"  // for GLONASS_TWO_PI | ||||||
| #include "GPS_L1_CA.h"         // for GPS_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 "gnss_sdr_create_directory.h" | ||||||
| #include <boost/filesystem/path.hpp> | #include <boost/filesystem/path.hpp> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| @@ -120,7 +120,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu | |||||||
|     // Inverse FFT |     // Inverse FFT | ||||||
|     d_ifft = new gr::fft::fft_complex(d_fft_size, false); |     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 = nullptr; | ||||||
|     d_grid_doppler_wipeoffs_step_two = nullptr; |     d_grid_doppler_wipeoffs_step_two = nullptr; | ||||||
|     d_magnitude_grid = nullptr; |     d_magnitude_grid = nullptr; | ||||||
| @@ -158,10 +158,10 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu | |||||||
|         { |         { | ||||||
|             std::string dump_path; |             std::string dump_path; | ||||||
|             // Get path |             // Get path | ||||||
|             if (d_dump_filename.find_last_of("/") != std::string::npos) |             if (d_dump_filename.find_last_of('/') != std::string::npos) | ||||||
|                 { |                 { | ||||||
|                     std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); |                     std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); | ||||||
|                     dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); |                     dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); | ||||||
|                     d_dump_filename = dump_filename_; |                     d_dump_filename = dump_filename_; | ||||||
|                 } |                 } | ||||||
|             else |             else | ||||||
| @@ -173,9 +173,9 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu | |||||||
|                     d_dump_filename = "acquisition"; |                     d_dump_filename = "acquisition"; | ||||||
|                 } |                 } | ||||||
|             // remove extension if any |             // remove extension if any | ||||||
|             if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) |             if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos) | ||||||
|                 { |                 { | ||||||
|                     d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); |                     d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.')); | ||||||
|                 } |                 } | ||||||
|             d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; |             d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; | ||||||
|             // create directory |             // create directory | ||||||
| @@ -268,16 +268,13 @@ bool pcps_acquisition::is_fdma() | |||||||
|             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; |             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else if (strcmp(d_gnss_synchro->Signal, "2G") == 0) |     if (strcmp(d_gnss_synchro->Signal, "2G") == 0) | ||||||
|         { |         { | ||||||
|             d_old_freq += DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); |             d_old_freq += DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); | ||||||
|             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; |             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     return false; | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -445,8 +442,8 @@ void pcps_acquisition::dump_results(int32_t effective_fft_size) | |||||||
|     filename.append(std::to_string(d_gnss_synchro->PRN)); |     filename.append(std::to_string(d_gnss_synchro->PRN)); | ||||||
|     filename.append(".mat"); |     filename.append(".mat"); | ||||||
|  |  | ||||||
|     mat_t* matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); |     mat_t* matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); | ||||||
|     if (matfp == NULL) |     if (matfp == nullptr) | ||||||
|         { |         { | ||||||
|             std::cout << "Unable to create or open Acquisition dump file" << std::endl; |             std::cout << "Unable to create or open Acquisition dump file" << std::endl; | ||||||
|             //acq_parameters.dump = false; |             //acq_parameters.dump = false; | ||||||
| @@ -472,7 +469,7 @@ void pcps_acquisition::dump_results(int32_t effective_fft_size) | |||||||
|             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE |             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE | ||||||
|             Mat_VarFree(matvar); |             Mat_VarFree(matvar); | ||||||
|  |  | ||||||
|             float aux = static_cast<float>(d_gnss_synchro->Acq_doppler_hz); |             auto aux = static_cast<float>(d_gnss_synchro->Acq_doppler_hz); | ||||||
|             matvar = Mat_VarCreate("acq_doppler_hz", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &aux, 0); |             matvar = Mat_VarCreate("acq_doppler_hz", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &aux, 0); | ||||||
|             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE |             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE | ||||||
|             Mat_VarFree(matvar); |             Mat_VarFree(matvar); | ||||||
| @@ -927,7 +924,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), | |||||||
|                 uint32_t buff_increment; |                 uint32_t buff_increment; | ||||||
|                 if (d_cshort) |                 if (d_cshort) | ||||||
|                     { |                     { | ||||||
|                         const lv_16sc_t* in = reinterpret_cast<const lv_16sc_t*>(input_items[0]);  // Get the input samples pointer |                         const auto* in = reinterpret_cast<const lv_16sc_t*>(input_items[0]);  // Get the input samples pointer | ||||||
|                         if ((ninput_items[0] + d_buffer_count) <= d_consumed_samples) |                         if ((ninput_items[0] + d_buffer_count) <= d_consumed_samples) | ||||||
|                             { |                             { | ||||||
|                                 buff_increment = ninput_items[0]; |                                 buff_increment = ninput_items[0]; | ||||||
| @@ -940,7 +937,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), | |||||||
|                     } |                     } | ||||||
|                 else |                 else | ||||||
|                     { |                     { | ||||||
|                         const gr_complex* in = reinterpret_cast<const gr_complex*>(input_items[0]);  // Get the input samples pointer |                         const auto* in = reinterpret_cast<const gr_complex*>(input_items[0]);  // Get the input samples pointer | ||||||
|                         if ((ninput_items[0] + d_buffer_count) <= d_consumed_samples) |                         if ((ninput_items[0] + d_buffer_count) <= d_consumed_samples) | ||||||
|                             { |                             { | ||||||
|                                 buff_increment = ninput_items[0]; |                                 buff_increment = ninput_items[0]; | ||||||
|   | |||||||
| @@ -91,10 +91,10 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con | |||||||
|         { |         { | ||||||
|             std::string dump_path; |             std::string dump_path; | ||||||
|             // Get path |             // Get path | ||||||
|             if (d_dump_filename.find_last_of("/") != std::string::npos) |             if (d_dump_filename.find_last_of('/') != std::string::npos) | ||||||
|                 { |                 { | ||||||
|                     std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); |                     std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); | ||||||
|                     dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); |                     dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); | ||||||
|                     d_dump_filename = dump_filename_; |                     d_dump_filename = dump_filename_; | ||||||
|                 } |                 } | ||||||
|             else |             else | ||||||
| @@ -106,9 +106,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con | |||||||
|                     d_dump_filename = "acquisition"; |                     d_dump_filename = "acquisition"; | ||||||
|                 } |                 } | ||||||
|             // remove extension if any |             // remove extension if any | ||||||
|             if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) |             if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos) | ||||||
|                 { |                 { | ||||||
|                     d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); |                     d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.')); | ||||||
|                 } |                 } | ||||||
|             d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; |             d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; | ||||||
|             // create directory |             // create directory | ||||||
| @@ -123,9 +123,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con | |||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
|     d_num_doppler_points = 0; |     d_num_doppler_points = 0; | ||||||
|     d_doppler_step = 0; |     d_doppler_step = 0; | ||||||
|     d_grid_data = 0; |     d_grid_data = nullptr; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
| @@ -337,7 +337,7 @@ double pcps_acquisition_fine_doppler_cc::compute_CAF() | |||||||
|  |  | ||||||
| float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_void_star &input_items) | float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_void_star &input_items) | ||||||
| { | { | ||||||
|     const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |     const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|     // Compute the input signal power estimation |     // Compute the input signal power estimation | ||||||
|     float power = 0; |     float power = 0; | ||||||
|     volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); |     volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size); | ||||||
| @@ -350,7 +350,7 @@ float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_voi | |||||||
| int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items) | int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items) | ||||||
| { | { | ||||||
|     // initialize acquisition algorithm |     // initialize acquisition algorithm | ||||||
|     const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |     const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|  |  | ||||||
|     DLOG(INFO) << "Channel: " << d_channel |     DLOG(INFO) << "Channel: " << d_channel | ||||||
|                << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN |                << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN | ||||||
| @@ -359,7 +359,7 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons | |||||||
|                << ", doppler_step: " << d_doppler_step; |                << ", doppler_step: " << d_doppler_step; | ||||||
|  |  | ||||||
|     // 2- Doppler frequency search loop |     // 2- Doppler frequency search loop | ||||||
|     float *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); |     auto *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|     for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) |     for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) | ||||||
|         { |         { | ||||||
| @@ -405,12 +405,12 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler() | |||||||
|     int signal_samples = prn_replicas * d_fft_size; |     int signal_samples = prn_replicas * d_fft_size; | ||||||
|     //int fft_size_extended = nextPowerOf2(signal_samples * zero_padding_factor); |     //int fft_size_extended = nextPowerOf2(signal_samples * zero_padding_factor); | ||||||
|     int fft_size_extended = signal_samples * zero_padding_factor; |     int fft_size_extended = signal_samples * zero_padding_factor; | ||||||
|     gr::fft::fft_complex *fft_operator = new gr::fft::fft_complex(fft_size_extended, true); |     auto *fft_operator = new gr::fft::fft_complex(fft_size_extended, true); | ||||||
|     //zero padding the entire vector |     //zero padding the entire vector | ||||||
|     std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0)); |     std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0)); | ||||||
|  |  | ||||||
|     //1. generate local code aligned with the acquisition code phase estimation |     //1. generate local code aligned with the acquisition code phase estimation | ||||||
|     gr_complex *code_replica = static_cast<gr_complex *>(volk_gnsssdr_malloc(signal_samples * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |     auto *code_replica = static_cast<gr_complex *>(volk_gnsssdr_malloc(signal_samples * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|     gps_l1_ca_code_gen_complex_sampled(code_replica, d_gnss_synchro->PRN, d_fs_in, 0); |     gps_l1_ca_code_gen_complex_sampled(code_replica, d_gnss_synchro->PRN, d_fs_in, 0); | ||||||
|  |  | ||||||
| @@ -433,7 +433,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler() | |||||||
|     fft_operator->execute(); |     fft_operator->execute(); | ||||||
|  |  | ||||||
|     // 4. Compute the magnitude and find the maximum |     // 4. Compute the magnitude and find the maximum | ||||||
|     float *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(fft_size_extended * sizeof(float), volk_gnsssdr_get_alignment())); |     auto *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(fft_size_extended * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|     volk_32fc_magnitude_squared_32f(p_tmp_vector, fft_operator->get_outbuf(), fft_size_extended); |     volk_32fc_magnitude_squared_32f(p_tmp_vector, fft_operator->get_outbuf(), fft_size_extended); | ||||||
|  |  | ||||||
| @@ -442,7 +442,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler() | |||||||
|  |  | ||||||
|     //case even |     //case even | ||||||
|     int counter = 0; |     int counter = 0; | ||||||
|     float *fftFreqBins = new float[fft_size_extended]; |     auto *fftFreqBins = new float[fft_size_extended]; | ||||||
|  |  | ||||||
|     std::fill_n(fftFreqBins, fft_size_extended, 0.0); |     std::fill_n(fftFreqBins, fft_size_extended, 0.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(std::to_string(d_gnss_synchro->PRN)); | ||||||
|     filename.append(".mat"); |     filename.append(".mat"); | ||||||
|  |  | ||||||
|     mat_t *matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); |     mat_t *matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); | ||||||
|     if (matfp == NULL) |     if (matfp == nullptr) | ||||||
|         { |         { | ||||||
|             std::cout << "Unable to create or open Acquisition dump file" << std::endl; |             std::cout << "Unable to create or open Acquisition dump file" << std::endl; | ||||||
|             d_dump = false; |             d_dump = false; | ||||||
| @@ -699,7 +699,7 @@ void pcps_acquisition_fine_doppler_cc::dump_results(int effective_fft_size) | |||||||
|             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE |             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE | ||||||
|             Mat_VarFree(matvar); |             Mat_VarFree(matvar); | ||||||
|  |  | ||||||
|             float aux = static_cast<float>(d_gnss_synchro->Acq_doppler_hz); |             auto aux = static_cast<float>(d_gnss_synchro->Acq_doppler_hz); | ||||||
|             matvar = Mat_VarCreate("acq_doppler_hz", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &aux, 0); |             matvar = Mat_VarCreate("acq_doppler_hz", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &aux, 0); | ||||||
|             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE |             Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);  // or MAT_COMPRESSION_NONE | ||||||
|             Mat_VarFree(matvar); |             Mat_VarFree(matvar); | ||||||
|   | |||||||
| @@ -32,6 +32,7 @@ | |||||||
|  |  | ||||||
| #include "pcps_assisted_acquisition_cc.h" | #include "pcps_assisted_acquisition_cc.h" | ||||||
| #include <sstream> | #include <sstream> | ||||||
|  | #include <utility> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <gnuradio/io_signature.h> | #include <gnuradio/io_signature.h> | ||||||
| #include <volk/volk.h> | #include <volk/volk.h> | ||||||
| @@ -46,19 +47,19 @@ extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map; | |||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( | pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( | ||||||
|     int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, |     int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min, | ||||||
|     long fs_in, int samples_per_ms, bool dump, |     int64_t fs_in, int32_t samples_per_ms, bool dump, | ||||||
|     std::string dump_filename) |     std::string dump_filename) | ||||||
| { | { | ||||||
|     return pcps_assisted_acquisition_cc_sptr( |     return pcps_assisted_acquisition_cc_sptr( | ||||||
|         new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, |         new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, | ||||||
|             fs_in, samples_per_ms, dump, dump_filename)); |             fs_in, samples_per_ms, dump, std::move(dump_filename))); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( | pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( | ||||||
|     int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, |     int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min, | ||||||
|     long fs_in, int samples_per_ms, bool dump, |     int64_t fs_in, int32_t samples_per_ms, bool dump, | ||||||
|     std::string dump_filename) : gr::block("pcps_assisted_acquisition_cc", |     std::string dump_filename) : gr::block("pcps_assisted_acquisition_cc", | ||||||
|                                      gr::io_signature::make(1, 1, sizeof(gr_complex)), |                                      gr::io_signature::make(1, 1, sizeof(gr_complex)), | ||||||
|                                      gr::io_signature::make(0, 0, sizeof(gr_complex))) |                                      gr::io_signature::make(0, 0, sizeof(gr_complex))) | ||||||
| @@ -89,7 +90,7 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( | |||||||
|  |  | ||||||
|     // For dumping samples into a file |     // For dumping samples into a file | ||||||
|     d_dump = dump; |     d_dump = dump; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|  |  | ||||||
|     d_doppler_resolution = 0; |     d_doppler_resolution = 0; | ||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
| @@ -97,9 +98,9 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( | |||||||
|     d_doppler_min = 0; |     d_doppler_min = 0; | ||||||
|     d_num_doppler_points = 0; |     d_num_doppler_points = 0; | ||||||
|     d_doppler_step = 0; |     d_doppler_step = 0; | ||||||
|     d_grid_data = 0; |     d_grid_data = nullptr; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
| @@ -108,7 +109,7 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void pcps_assisted_acquisition_cc::set_doppler_step(unsigned int doppler_step) | void pcps_assisted_acquisition_cc::set_doppler_step(uint32_t doppler_step) | ||||||
| { | { | ||||||
|     d_doppler_step = doppler_step; |     d_doppler_step = doppler_step; | ||||||
| } | } | ||||||
| @@ -116,7 +117,7 @@ void pcps_assisted_acquisition_cc::set_doppler_step(unsigned int doppler_step) | |||||||
|  |  | ||||||
| void pcps_assisted_acquisition_cc::free_grid_memory() | void pcps_assisted_acquisition_cc::free_grid_memory() | ||||||
| { | { | ||||||
|     for (int i = 0; i < d_num_doppler_points; i++) |     for (int32_t i = 0; i < d_num_doppler_points; i++) | ||||||
|         { |         { | ||||||
|             delete[] d_grid_data[i]; |             delete[] d_grid_data[i]; | ||||||
|             delete[] d_grid_doppler_wipeoffs[i]; |             delete[] d_grid_doppler_wipeoffs[i]; | ||||||
| @@ -205,9 +206,9 @@ void pcps_assisted_acquisition_cc::get_assistance() | |||||||
| void pcps_assisted_acquisition_cc::reset_grid() | void pcps_assisted_acquisition_cc::reset_grid() | ||||||
| { | { | ||||||
|     d_well_count = 0; |     d_well_count = 0; | ||||||
|     for (int i = 0; i < d_num_doppler_points; i++) |     for (int32_t i = 0; i < d_num_doppler_points; i++) | ||||||
|         { |         { | ||||||
|             for (unsigned int j = 0; j < d_fft_size; j++) |             for (uint32_t j = 0; j < d_fft_size; j++) | ||||||
|                 { |                 { | ||||||
|                     d_grid_data[i][j] = 0.0; |                     d_grid_data[i][j] = 0.0; | ||||||
|                 } |                 } | ||||||
| @@ -226,16 +227,16 @@ void pcps_assisted_acquisition_cc::redefine_grid() | |||||||
|     d_num_doppler_points = floor(std::abs(d_doppler_max - d_doppler_min) / d_doppler_step); |     d_num_doppler_points = floor(std::abs(d_doppler_max - d_doppler_min) / d_doppler_step); | ||||||
|  |  | ||||||
|     d_grid_data = new float *[d_num_doppler_points]; |     d_grid_data = new float *[d_num_doppler_points]; | ||||||
|     for (int i = 0; i < d_num_doppler_points; i++) |     for (int32_t i = 0; i < d_num_doppler_points; i++) | ||||||
|         { |         { | ||||||
|             d_grid_data[i] = new float[d_fft_size]; |             d_grid_data[i] = new float[d_fft_size]; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     // create the carrier Doppler wipeoff signals |     // create the carrier Doppler wipeoff signals | ||||||
|     int doppler_hz; |     int32_t doppler_hz; | ||||||
|     float phase_step_rad; |     float phase_step_rad; | ||||||
|     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_points]; |     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_points]; | ||||||
|     for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) |     for (int32_t doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) | ||||||
|         { |         { | ||||||
|             doppler_hz = d_doppler_min + d_doppler_step * doppler_index; |             doppler_hz = d_doppler_min + d_doppler_step * doppler_index; | ||||||
|             // doppler search steps |             // doppler search steps | ||||||
| @@ -253,11 +254,11 @@ double pcps_assisted_acquisition_cc::search_maximum() | |||||||
| { | { | ||||||
|     float magt = 0.0; |     float magt = 0.0; | ||||||
|     float fft_normalization_factor; |     float fft_normalization_factor; | ||||||
|     int index_doppler = 0; |     int32_t index_doppler = 0; | ||||||
|     uint32_t tmp_intex_t = 0; |     uint32_t tmp_intex_t = 0; | ||||||
|     uint32_t index_time = 0; |     uint32_t index_time = 0; | ||||||
|  |  | ||||||
|     for (int i = 0; i < d_num_doppler_points; i++) |     for (int32_t i = 0; i < d_num_doppler_points; i++) | ||||||
|         { |         { | ||||||
|             volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_grid_data[i], d_fft_size); |             volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_grid_data[i], d_fft_size); | ||||||
|             if (d_grid_data[i][tmp_intex_t] > magt) |             if (d_grid_data[i][tmp_intex_t] > magt) | ||||||
| @@ -301,9 +302,9 @@ double pcps_assisted_acquisition_cc::search_maximum() | |||||||
|  |  | ||||||
| float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_star &input_items) | float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_star &input_items) | ||||||
| { | { | ||||||
|     const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |     const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|     // 1- Compute the input signal power estimation |     // 1- Compute the input signal power estimation | ||||||
|     float *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); |     auto *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|     volk_32fc_magnitude_squared_32f(p_tmp_vector, in, d_fft_size); |     volk_32fc_magnitude_squared_32f(p_tmp_vector, in, d_fft_size); | ||||||
|  |  | ||||||
| @@ -315,10 +316,10 @@ float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_st | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items) | int32_t pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items) | ||||||
| { | { | ||||||
|     // initialize acquisition algorithm |     // initialize acquisition algorithm | ||||||
|     const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |     const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|  |  | ||||||
|     DLOG(INFO) << "Channel: " << d_channel |     DLOG(INFO) << "Channel: " << d_channel | ||||||
|                << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " |                << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " | ||||||
| @@ -328,9 +329,9 @@ int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_vo | |||||||
|                << ", doppler_step: " << d_doppler_step; |                << ", doppler_step: " << d_doppler_step; | ||||||
|  |  | ||||||
|     // 2- Doppler frequency search loop |     // 2- Doppler frequency search loop | ||||||
|     float *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); |     auto *p_tmp_vector = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|     for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) |     for (int32_t doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) | ||||||
|         { |         { | ||||||
|             // doppler search steps |             // doppler search steps | ||||||
|             // Perform the carrier wipe-off |             // Perform the carrier wipe-off | ||||||
| @@ -393,7 +394,7 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items, | |||||||
|             d_state = 2; |             d_state = 2; | ||||||
|             break; |             break; | ||||||
|         case 2:  // S2. ComputeGrid |         case 2:  // S2. ComputeGrid | ||||||
|             int consumed_samples; |             int32_t consumed_samples; | ||||||
|             consumed_samples = compute_and_accumulate_grid(input_items); |             consumed_samples = compute_and_accumulate_grid(input_items); | ||||||
|             d_well_count++; |             d_well_count++; | ||||||
|             if (d_well_count >= d_max_dwells) |             if (d_well_count >= d_max_dwells) | ||||||
|   | |||||||
| @@ -61,8 +61,13 @@ typedef boost::shared_ptr<pcps_assisted_acquisition_cc> | |||||||
|     pcps_assisted_acquisition_cc_sptr; |     pcps_assisted_acquisition_cc_sptr; | ||||||
|  |  | ||||||
| pcps_assisted_acquisition_cc_sptr | pcps_assisted_acquisition_cc_sptr | ||||||
| pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, | pcps_make_assisted_acquisition_cc( | ||||||
|     int doppler_max, int doppler_min, long fs_in, int samples_per_ms, |     int32_t max_dwells, | ||||||
|  |     uint32_t sampled_ms, | ||||||
|  |     int32_t doppler_max, | ||||||
|  |     int32_t doppler_min, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|     bool dump, std::string dump_filename); |     bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
| @@ -75,20 +80,20 @@ class pcps_assisted_acquisition_cc : public gr::block | |||||||
| { | { | ||||||
| private: | private: | ||||||
|     friend pcps_assisted_acquisition_cc_sptr |     friend pcps_assisted_acquisition_cc_sptr | ||||||
|     pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, |     pcps_make_assisted_acquisition_cc(int32_t max_dwells, uint32_t sampled_ms, | ||||||
|         int doppler_max, int doppler_min, long fs_in, |         int32_t doppler_max, int32_t doppler_min, int64_t fs_in, | ||||||
|         int samples_per_ms, bool dump, |         int32_t samples_per_ms, bool dump, | ||||||
|         std::string dump_filename); |         std::string dump_filename); | ||||||
|  |  | ||||||
|     pcps_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms, |     pcps_assisted_acquisition_cc(int32_t max_dwells, uint32_t sampled_ms, | ||||||
|         int doppler_max, int doppler_min, long fs_in, |         int32_t doppler_max, int32_t doppler_min, int64_t fs_in, | ||||||
|         int samples_per_ms, bool dump, |         int32_t samples_per_ms, bool dump, | ||||||
|         std::string dump_filename); |         std::string dump_filename); | ||||||
|  |  | ||||||
|     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, |     void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift, | ||||||
|         int doppler_offset); |         int32_t doppler_offset); | ||||||
|  |  | ||||||
|     int compute_and_accumulate_grid(gr_vector_const_void_star& input_items); |     int32_t compute_and_accumulate_grid(gr_vector_const_void_star& input_items); | ||||||
|     float estimate_input_power(gr_vector_const_void_star& input_items); |     float estimate_input_power(gr_vector_const_void_star& input_items); | ||||||
|     double search_maximum(); |     double search_maximum(); | ||||||
|     void get_assistance(); |     void get_assistance(); | ||||||
| @@ -96,22 +101,22 @@ private: | |||||||
|     void redefine_grid(); |     void redefine_grid(); | ||||||
|     void free_grid_memory(); |     void free_grid_memory(); | ||||||
|  |  | ||||||
|     long d_fs_in; |     int64_t d_fs_in; | ||||||
|     int d_samples_per_ms; |     int32_t d_samples_per_ms; | ||||||
|     int d_max_dwells; |     int32_t d_max_dwells; | ||||||
|     unsigned int d_doppler_resolution; |     uint32_t d_doppler_resolution; | ||||||
|     int d_gnuradio_forecast_samples; |     int32_t d_gnuradio_forecast_samples; | ||||||
|     float d_threshold; |     float d_threshold; | ||||||
|     std::string d_satellite_str; |     std::string d_satellite_str; | ||||||
|     int d_doppler_max; |     int32_t d_doppler_max; | ||||||
|     int d_doppler_min; |     int32_t d_doppler_min; | ||||||
|     int d_config_doppler_max; |     int32_t d_config_doppler_max; | ||||||
|     int d_config_doppler_min; |     int32_t d_config_doppler_min; | ||||||
|  |  | ||||||
|     int d_num_doppler_points; |     int32_t d_num_doppler_points; | ||||||
|     int d_doppler_step; |     int32_t d_doppler_step; | ||||||
|     unsigned int d_sampled_ms; |     uint32_t d_sampled_ms; | ||||||
|     unsigned int d_fft_size; |     uint32_t d_fft_size; | ||||||
|     uint64_t d_sample_counter; |     uint64_t d_sample_counter; | ||||||
|     gr_complex* d_carrier; |     gr_complex* d_carrier; | ||||||
|     gr_complex* d_fft_codes; |     gr_complex* d_fft_codes; | ||||||
| @@ -122,17 +127,17 @@ private: | |||||||
|     gr::fft::fft_complex* d_fft_if; |     gr::fft::fft_complex* d_fft_if; | ||||||
|     gr::fft::fft_complex* d_ifft; |     gr::fft::fft_complex* d_ifft; | ||||||
|     Gnss_Synchro* d_gnss_synchro; |     Gnss_Synchro* d_gnss_synchro; | ||||||
|     unsigned int d_code_phase; |     uint32_t d_code_phase; | ||||||
|     float d_doppler_freq; |     float d_doppler_freq; | ||||||
|     float d_input_power; |     float d_input_power; | ||||||
|     float d_test_statistics; |     float d_test_statistics; | ||||||
|     std::ofstream d_dump_file; |     std::ofstream d_dump_file; | ||||||
|     int d_state; |     int32_t d_state; | ||||||
|     bool d_active; |     bool d_active; | ||||||
|     bool d_disable_assist; |     bool d_disable_assist; | ||||||
|     int d_well_count; |     int32_t d_well_count; | ||||||
|     bool d_dump; |     bool d_dump; | ||||||
|     unsigned int d_channel; |     uint32_t d_channel; | ||||||
|  |  | ||||||
|     std::string d_dump_filename; |     std::string d_dump_filename; | ||||||
|  |  | ||||||
| @@ -155,7 +160,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      * \brief Returns the maximum peak of grid search. |      * \brief Returns the maximum peak of grid search. | ||||||
|      */ |      */ | ||||||
|     inline unsigned int mag() const |     inline uint32_t mag() const | ||||||
|     { |     { | ||||||
|         return d_test_statistics; |         return d_test_statistics; | ||||||
|     } |     } | ||||||
| @@ -185,7 +190,7 @@ public: | |||||||
|      * \brief Set acquisition channel unique ID |      * \brief Set acquisition channel unique ID | ||||||
|      * \param channel - receiver channel. |      * \param channel - receiver channel. | ||||||
|      */ |      */ | ||||||
|     inline void set_channel(unsigned int channel) |     inline void set_channel(uint32_t channel) | ||||||
|     { |     { | ||||||
|         d_channel = channel; |         d_channel = channel; | ||||||
|     } |     } | ||||||
| @@ -204,7 +209,7 @@ public: | |||||||
|      * \brief Set maximum Doppler grid search |      * \brief Set maximum Doppler grid search | ||||||
|      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. |      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. | ||||||
|      */ |      */ | ||||||
|     inline void set_doppler_max(unsigned int doppler_max) |     inline void set_doppler_max(uint32_t doppler_max) | ||||||
|     { |     { | ||||||
|         d_doppler_max = doppler_max; |         d_doppler_max = doppler_max; | ||||||
|     } |     } | ||||||
| @@ -213,7 +218,7 @@ public: | |||||||
|      * \brief Set Doppler steps for the grid search |      * \brief Set Doppler steps for the grid search | ||||||
|      * \param doppler_step - Frequency bin of the search grid [Hz]. |      * \param doppler_step - Frequency bin of the search grid [Hz]. | ||||||
|      */ |      */ | ||||||
|     void set_doppler_step(unsigned int doppler_step); |     void set_doppler_step(uint32_t doppler_step); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Parallel Code Phase Search Acquisition signal processing. |      * \brief Parallel Code Phase Search Acquisition signal processing. | ||||||
|   | |||||||
| @@ -35,32 +35,39 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "pcps_cccwsr_acquisition_cc.h" | #include "pcps_cccwsr_acquisition_cc.h" | ||||||
| #include <sstream> | #include "control_message_factory.h" | ||||||
|  | #include "GPS_L1_CA.h"  // GPS_TWO_PI | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <gnuradio/io_signature.h> | #include <gnuradio/io_signature.h> | ||||||
| #include <volk/volk.h> | #include <volk/volk.h> | ||||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | #include <volk_gnsssdr/volk_gnsssdr.h> | ||||||
| #include "control_message_factory.h" | #include <sstream> | ||||||
| #include "GPS_L1_CA.h"  //GPS_TWO_PI | #include <utility> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc( | pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t sampled_ms, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t max_dwells, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|     bool dump, std::string dump_filename) |     bool dump, std::string dump_filename) | ||||||
| { | { | ||||||
|     return pcps_cccwsr_acquisition_cc_sptr( |     return pcps_cccwsr_acquisition_cc_sptr( | ||||||
|         new pcps_cccwsr_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, |         new pcps_cccwsr_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, | ||||||
|             samples_per_ms, samples_per_code, dump, dump_filename)); |             samples_per_ms, samples_per_code, dump, std::move(dump_filename))); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( | pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t sampled_ms, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t max_dwells, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|     bool dump, |     bool dump, | ||||||
|     std::string dump_filename) : gr::block("pcps_cccwsr_acquisition_cc", |     std::string dump_filename) : gr::block("pcps_cccwsr_acquisition_cc", | ||||||
|                                      gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), |                                      gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), | ||||||
| @@ -98,13 +105,13 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( | |||||||
|  |  | ||||||
|     // For dumping samples into a file |     // For dumping samples into a file | ||||||
|     d_dump = dump; |     d_dump = dump; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|  |  | ||||||
|     d_doppler_resolution = 0; |     d_doppler_resolution = 0; | ||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
|     d_doppler_step = 0; |     d_doppler_step = 0; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
| @@ -115,7 +122,7 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() | |||||||
| { | { | ||||||
|     if (d_num_doppler_bins > 0) |     if (d_num_doppler_bins > 0) | ||||||
|         { |         { | ||||||
|             for (unsigned int i = 0; i < d_num_doppler_bins; i++) |             for (uint32_t i = 0; i < d_num_doppler_bins; i++) | ||||||
|                 { |                 { | ||||||
|                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); |                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); | ||||||
|                 } |                 } | ||||||
| @@ -174,8 +181,8 @@ void pcps_cccwsr_acquisition_cc::init() | |||||||
|  |  | ||||||
|     // Count the number of bins |     // Count the number of bins | ||||||
|     d_num_doppler_bins = 0; |     d_num_doppler_bins = 0; | ||||||
|     for (int doppler = static_cast<int>(-d_doppler_max); |     for (auto doppler = static_cast<int32_t>(-d_doppler_max); | ||||||
|          doppler <= static_cast<int>(d_doppler_max); |          doppler <= static_cast<int32_t>(d_doppler_max); | ||||||
|          doppler += d_doppler_step) |          doppler += d_doppler_step) | ||||||
|         { |         { | ||||||
|             d_num_doppler_bins++; |             d_num_doppler_bins++; | ||||||
| @@ -183,11 +190,11 @@ void pcps_cccwsr_acquisition_cc::init() | |||||||
|  |  | ||||||
|     // Create the carrier Doppler wipeoff signals |     // Create the carrier Doppler wipeoff signals | ||||||
|     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; |     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; | ||||||
|     for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |     for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|         { |         { | ||||||
|             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|             int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |             int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|             float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in); |             float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in); | ||||||
|             float _phase[1]; |             float _phase[1]; | ||||||
|             _phase[0] = 0; |             _phase[0] = 0; | ||||||
| @@ -196,7 +203,7 @@ void pcps_cccwsr_acquisition_cc::init() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void pcps_cccwsr_acquisition_cc::set_state(int state) | void pcps_cccwsr_acquisition_cc::set_state(int32_t state) | ||||||
| { | { | ||||||
|     d_state = state; |     d_state = state; | ||||||
|     if (d_state == 1) |     if (d_state == 1) | ||||||
| @@ -224,7 +231,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, | |||||||
|     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, |     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, | ||||||
|     gr_vector_void_star &output_items __attribute__((unused))) |     gr_vector_void_star &output_items __attribute__((unused))) | ||||||
| { | { | ||||||
|     int acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL |     int32_t acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL | ||||||
|  |  | ||||||
|     switch (d_state) |     switch (d_state) | ||||||
|         { |         { | ||||||
| @@ -253,7 +260,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, | |||||||
|         case 1: |         case 1: | ||||||
|             { |             { | ||||||
|                 // initialize acquisition algorithm |                 // initialize acquisition algorithm | ||||||
|                 int doppler; |                 int32_t doppler; | ||||||
|  |  | ||||||
|                 uint32_t indext = 0; |                 uint32_t indext = 0; | ||||||
|                 uint32_t indext_plus = 0; |                 uint32_t indext_plus = 0; | ||||||
| @@ -261,7 +268,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, | |||||||
|                 float magt = 0.0; |                 float magt = 0.0; | ||||||
|                 float magt_plus = 0.0; |                 float magt_plus = 0.0; | ||||||
|                 float magt_minus = 0.0; |                 float magt_minus = 0.0; | ||||||
|                 const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |                 const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|                 float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); |                 float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); | ||||||
|  |  | ||||||
|                 d_sample_counter += static_cast<uint64_t>(d_fft_size);  // sample counter |                 d_sample_counter += static_cast<uint64_t>(d_fft_size);  // sample counter | ||||||
| @@ -280,11 +287,11 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, | |||||||
|                 d_input_power /= static_cast<float>(d_fft_size); |                 d_input_power /= static_cast<float>(d_fft_size); | ||||||
|  |  | ||||||
|                 // 2- Doppler frequency search loop |                 // 2- Doppler frequency search loop | ||||||
|                 for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |                 for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|                     { |                     { | ||||||
|                         // doppler search steps |                         // doppler search steps | ||||||
|  |  | ||||||
|                         doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |                         doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|  |  | ||||||
|                         volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, |                         volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, | ||||||
|                             d_grid_doppler_wipeoffs[doppler_index], d_fft_size); |                             d_grid_doppler_wipeoffs[doppler_index], d_fft_size); | ||||||
| @@ -319,7 +326,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, | |||||||
|                         // d_data_correlation. |                         // d_data_correlation. | ||||||
|                         memcpy(d_pilot_correlation, d_ifft->get_outbuf(), sizeof(gr_complex) * d_fft_size); |                         memcpy(d_pilot_correlation, d_ifft->get_outbuf(), sizeof(gr_complex) * d_fft_size); | ||||||
|  |  | ||||||
|                         for (unsigned int i = 0; i < d_fft_size; i++) |                         for (uint32_t i = 0; i < d_fft_size; i++) | ||||||
|                             { |                             { | ||||||
|                                 d_correlation_plus[i] = std::complex<float>( |                                 d_correlation_plus[i] = std::complex<float>( | ||||||
|                                     d_data_correlation[i].real() - d_pilot_correlation[i].imag(), |                                     d_data_correlation[i].real() - d_pilot_correlation[i].imag(), | ||||||
|   | |||||||
| @@ -50,10 +50,15 @@ class pcps_cccwsr_acquisition_cc; | |||||||
| typedef boost::shared_ptr<pcps_cccwsr_acquisition_cc> pcps_cccwsr_acquisition_cc_sptr; | typedef boost::shared_ptr<pcps_cccwsr_acquisition_cc> pcps_cccwsr_acquisition_cc_sptr; | ||||||
|  |  | ||||||
| pcps_cccwsr_acquisition_cc_sptr | pcps_cccwsr_acquisition_cc_sptr | ||||||
| pcps_cccwsr_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, | pcps_cccwsr_make_acquisition_cc( | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t sampled_ms, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t max_dwells, | ||||||
|     bool dump, std::string dump_filename); |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|  |     bool dump, | ||||||
|  |     std::string dump_filename); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
|  * \brief This class implements a Parallel Code Phase Search Acquisition with |  * \brief This class implements a Parallel Code Phase Search Acquisition with | ||||||
| @@ -63,40 +68,40 @@ class pcps_cccwsr_acquisition_cc : public gr::block | |||||||
| { | { | ||||||
| private: | private: | ||||||
|     friend pcps_cccwsr_acquisition_cc_sptr |     friend pcps_cccwsr_acquisition_cc_sptr | ||||||
|     pcps_cccwsr_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, |     pcps_cccwsr_make_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells, | ||||||
|         unsigned int doppler_max, long fs_in, |         uint32_t doppler_max, int64_t fs_in, | ||||||
|         int samples_per_ms, int samples_per_code, |         int32_t samples_per_ms, int32_t samples_per_code, | ||||||
|         bool dump, std::string dump_filename); |         bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
|     pcps_cccwsr_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, |     pcps_cccwsr_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells, | ||||||
|         unsigned int doppler_max, long fs_in, |         uint32_t doppler_max, int64_t fs_in, | ||||||
|         int samples_per_ms, int samples_per_code, |         int32_t samples_per_ms, int32_t samples_per_code, | ||||||
|         bool dump, std::string dump_filename); |         bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
|     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, |     void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift, | ||||||
|         int doppler_offset); |         int32_t doppler_offset); | ||||||
|  |  | ||||||
|     long d_fs_in; |     int64_t d_fs_in; | ||||||
|     int d_samples_per_ms; |     int32_t d_samples_per_ms; | ||||||
|     int d_samples_per_code; |     int32_t d_samples_per_code; | ||||||
|     unsigned int d_doppler_resolution; |     uint32_t d_doppler_resolution; | ||||||
|     float d_threshold; |     float d_threshold; | ||||||
|     std::string d_satellite_str; |     std::string d_satellite_str; | ||||||
|     unsigned int d_doppler_max; |     uint32_t d_doppler_max; | ||||||
|     unsigned int d_doppler_step; |     uint32_t d_doppler_step; | ||||||
|     unsigned int d_sampled_ms; |     uint32_t d_sampled_ms; | ||||||
|     unsigned int d_max_dwells; |     uint32_t d_max_dwells; | ||||||
|     unsigned int d_well_count; |     uint32_t d_well_count; | ||||||
|     unsigned int d_fft_size; |     uint32_t d_fft_size; | ||||||
|     uint64_t d_sample_counter; |     uint64_t d_sample_counter; | ||||||
|     gr_complex** d_grid_doppler_wipeoffs; |     gr_complex** d_grid_doppler_wipeoffs; | ||||||
|     unsigned int d_num_doppler_bins; |     uint32_t d_num_doppler_bins; | ||||||
|     gr_complex* d_fft_code_data; |     gr_complex* d_fft_code_data; | ||||||
|     gr_complex* d_fft_code_pilot; |     gr_complex* d_fft_code_pilot; | ||||||
|     gr::fft::fft_complex* d_fft_if; |     gr::fft::fft_complex* d_fft_if; | ||||||
|     gr::fft::fft_complex* d_ifft; |     gr::fft::fft_complex* d_ifft; | ||||||
|     Gnss_Synchro* d_gnss_synchro; |     Gnss_Synchro* d_gnss_synchro; | ||||||
|     unsigned int d_code_phase; |     uint32_t d_code_phase; | ||||||
|     float d_doppler_freq; |     float d_doppler_freq; | ||||||
|     float d_mag; |     float d_mag; | ||||||
|     float* d_magnitude; |     float* d_magnitude; | ||||||
| @@ -108,9 +113,9 @@ private: | |||||||
|     float d_test_statistics; |     float d_test_statistics; | ||||||
|     std::ofstream d_dump_file; |     std::ofstream d_dump_file; | ||||||
|     bool d_active; |     bool d_active; | ||||||
|     int d_state; |     int32_t d_state; | ||||||
|     bool d_dump; |     bool d_dump; | ||||||
|     unsigned int d_channel; |     uint32_t d_channel; | ||||||
|     std::string d_dump_filename; |     std::string d_dump_filename; | ||||||
|  |  | ||||||
| public: | public: | ||||||
| @@ -132,7 +137,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|       * \brief Returns the maximum peak of grid search. |       * \brief Returns the maximum peak of grid search. | ||||||
|       */ |       */ | ||||||
|     inline unsigned int mag() const |     inline uint32_t mag() const | ||||||
|     { |     { | ||||||
|         return d_mag; |         return d_mag; | ||||||
|     } |     } | ||||||
| @@ -164,13 +169,13 @@ public: | |||||||
|       * first available sample. |       * first available sample. | ||||||
|       * \param state - int=1 forces start of acquisition |       * \param state - int=1 forces start of acquisition | ||||||
|       */ |       */ | ||||||
|     void set_state(int state); |     void set_state(int32_t state); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|       * \brief Set acquisition channel unique ID |       * \brief Set acquisition channel unique ID | ||||||
|       * \param channel - receiver channel. |       * \param channel - receiver channel. | ||||||
|       */ |       */ | ||||||
|     inline void set_channel(unsigned int channel) |     inline void set_channel(uint32_t channel) | ||||||
|     { |     { | ||||||
|         d_channel = channel; |         d_channel = channel; | ||||||
|     } |     } | ||||||
| @@ -189,7 +194,7 @@ public: | |||||||
|       * \brief Set maximum Doppler grid search |       * \brief Set maximum Doppler grid search | ||||||
|       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. |       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. | ||||||
|       */ |       */ | ||||||
|     inline void set_doppler_max(unsigned int doppler_max) |     inline void set_doppler_max(uint32_t doppler_max) | ||||||
|     { |     { | ||||||
|         d_doppler_max = doppler_max; |         d_doppler_max = doppler_max; | ||||||
|     } |     } | ||||||
| @@ -198,7 +203,7 @@ public: | |||||||
|       * \brief Set Doppler steps for the grid search |       * \brief Set Doppler steps for the grid search | ||||||
|       * \param doppler_step - Frequency bin of the search grid [Hz]. |       * \param doppler_step - Frequency bin of the search grid [Hz]. | ||||||
|       */ |       */ | ||||||
|     inline void set_doppler_step(unsigned int doppler_step) |     inline void set_doppler_step(uint32_t doppler_step) | ||||||
|     { |     { | ||||||
|         d_doppler_step = doppler_step; |         d_doppler_step = doppler_step; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -37,15 +37,19 @@ | |||||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | #include <volk_gnsssdr/volk_gnsssdr.h> | ||||||
| #include <cmath> | #include <cmath> | ||||||
| #include <sstream> | #include <sstream> | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( | pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( | ||||||
|     unsigned int folding_factor, |     uint32_t folding_factor, | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t sampled_ms, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t max_dwells, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|     bool bit_transition_flag, |     bool bit_transition_flag, | ||||||
|     bool dump, |     bool dump, | ||||||
|     std::string dump_filename) |     std::string dump_filename) | ||||||
| @@ -57,15 +61,15 @@ pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( | |||||||
|             fs_in, samples_per_ms, |             fs_in, samples_per_ms, | ||||||
|             samples_per_code, |             samples_per_code, | ||||||
|             bit_transition_flag, |             bit_transition_flag, | ||||||
|             dump, dump_filename)); |             dump, std::move(dump_filename))); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( | pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( | ||||||
|     unsigned int folding_factor, |     uint32_t folding_factor, | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t sampled_ms, uint32_t max_dwells, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t doppler_max, int64_t fs_in, | ||||||
|     int samples_per_ms, int samples_per_code, |     int32_t samples_per_ms, int32_t samples_per_code, | ||||||
|     bool bit_transition_flag, |     bool bit_transition_flag, | ||||||
|     bool dump, |     bool dump, | ||||||
|     std::string dump_filename) : gr::block("pcps_quicksync_acquisition_cc", |     std::string dump_filename) : gr::block("pcps_quicksync_acquisition_cc", | ||||||
| @@ -96,7 +100,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( | |||||||
|     d_magnitude = static_cast<float*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(float), volk_gnsssdr_get_alignment())); |     d_magnitude = static_cast<float*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|     d_magnitude_folded = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); |     d_magnitude_folded = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|     d_possible_delay = new unsigned int[d_folding_factor]; |     d_possible_delay = new uint32_t[d_folding_factor]; | ||||||
|     d_corr_output_f = new float[d_folding_factor]; |     d_corr_output_f = new float[d_folding_factor]; | ||||||
|  |  | ||||||
|     /*Create the d_code signal , which would store the values of the code in its |     /*Create the d_code signal , which would store the values of the code in its | ||||||
| @@ -110,18 +114,18 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( | |||||||
|  |  | ||||||
|     // For dumping samples into a file |     // For dumping samples into a file | ||||||
|     d_dump = dump; |     d_dump = dump; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|  |  | ||||||
|     d_corr_acumulator = 0; |     d_corr_acumulator = nullptr; | ||||||
|     d_signal_folded = 0; |     d_signal_folded = nullptr; | ||||||
|     d_code_folded = new gr_complex[d_fft_size](); |     d_code_folded = new gr_complex[d_fft_size](); | ||||||
|     d_noise_floor_power = 0; |     d_noise_floor_power = 0; | ||||||
|     d_doppler_resolution = 0; |     d_doppler_resolution = 0; | ||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
|     d_doppler_step = 0; |     d_doppler_step = 0; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_fft_if2 = 0; |     d_fft_if2 = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
| @@ -137,7 +141,7 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc() | |||||||
|     //DLOG(INFO) << "START DESTROYER"; |     //DLOG(INFO) << "START DESTROYER"; | ||||||
|     if (d_num_doppler_bins > 0) |     if (d_num_doppler_bins > 0) | ||||||
|         { |         { | ||||||
|             for (unsigned int i = 0; i < d_num_doppler_bins; i++) |             for (uint32_t i = 0; i < d_num_doppler_bins; i++) | ||||||
|                 { |                 { | ||||||
|                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); |                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); | ||||||
|                 } |                 } | ||||||
| @@ -175,7 +179,7 @@ void pcps_quicksync_acquisition_cc::set_local_code(std::complex<float>* code) | |||||||
|     /*perform folding of the code by the factorial factor parameter. Notice that |     /*perform folding of the code by the factorial factor parameter. Notice that | ||||||
|     folding of the code in the time stage would result in a downsampled spectrum |     folding of the code in the time stage would result in a downsampled spectrum | ||||||
|     in the frequency domain after applying the fftw operation*/ |     in the frequency domain after applying the fftw operation*/ | ||||||
|     for (unsigned int i = 0; i < d_folding_factor; i++) |     for (uint32_t i = 0; i < d_folding_factor; i++) | ||||||
|         { |         { | ||||||
|             std::transform((code + i * d_fft_size), (code + ((i + 1) * d_fft_size)), |             std::transform((code + i * d_fft_size), (code + ((i + 1) * d_fft_size)), | ||||||
|                 d_fft_if->get_inbuf(), d_fft_if->get_inbuf(), |                 d_fft_if->get_inbuf(), d_fft_if->get_inbuf(), | ||||||
| @@ -208,8 +212,8 @@ void pcps_quicksync_acquisition_cc::init() | |||||||
|  |  | ||||||
|     // Count the number of bins |     // Count the number of bins | ||||||
|     d_num_doppler_bins = 0; |     d_num_doppler_bins = 0; | ||||||
|     for (int doppler = static_cast<int>(-d_doppler_max); |     for (auto doppler = static_cast<int32_t>(-d_doppler_max); | ||||||
|          doppler <= static_cast<int>(d_doppler_max); |          doppler <= static_cast<int32_t>(d_doppler_max); | ||||||
|          doppler += d_doppler_step) |          doppler += d_doppler_step) | ||||||
|         { |         { | ||||||
|             d_num_doppler_bins++; |             d_num_doppler_bins++; | ||||||
| @@ -217,10 +221,10 @@ void pcps_quicksync_acquisition_cc::init() | |||||||
|  |  | ||||||
|     // Create the carrier Doppler wipeoff signals |     // Create the carrier Doppler wipeoff signals | ||||||
|     d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; |     d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; | ||||||
|     for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |     for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|         { |         { | ||||||
|             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|             int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |             int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|             float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in); |             float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in); | ||||||
|             float _phase[1]; |             float _phase[1]; | ||||||
|             _phase[0] = 0; |             _phase[0] = 0; | ||||||
| @@ -230,7 +234,7 @@ void pcps_quicksync_acquisition_cc::init() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void pcps_quicksync_acquisition_cc::set_state(int state) | void pcps_quicksync_acquisition_cc::set_state(int32_t state) | ||||||
| { | { | ||||||
|     d_state = state; |     d_state = state; | ||||||
|     if (d_state == 1) |     if (d_state == 1) | ||||||
| @@ -269,7 +273,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|      * 6. Declare positive or negative acquisition using a message queue |      * 6. Declare positive or negative acquisition using a message queue | ||||||
|      */ |      */ | ||||||
|     //DLOG(INFO) << "START GENERAL WORK"; |     //DLOG(INFO) << "START GENERAL WORK"; | ||||||
|     int acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL |     int32_t acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL | ||||||
|     //std::cout<<"general_work in quicksync gnuradio block"<<std::endl; |     //std::cout<<"general_work in quicksync gnuradio block"<<std::endl; | ||||||
|     switch (d_state) |     switch (d_state) | ||||||
|         { |         { | ||||||
| @@ -301,21 +305,21 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|             { |             { | ||||||
|                 /* initialize acquisition  implementing the QuickSync algorithm*/ |                 /* initialize acquisition  implementing the QuickSync algorithm*/ | ||||||
|                 //DLOG(INFO) << "START CASE 1"; |                 //DLOG(INFO) << "START CASE 1"; | ||||||
|                 int doppler; |                 int32_t doppler; | ||||||
|                 uint32_t indext = 0; |                 uint32_t indext = 0; | ||||||
|                 float magt = 0.0; |                 float magt = 0.0; | ||||||
|                 const gr_complex* in = reinterpret_cast<const gr_complex*>(input_items[0]);  //Get the input samples pointer |                 const auto* in = reinterpret_cast<const gr_complex*>(input_items[0]);  //Get the input samples pointer | ||||||
|  |  | ||||||
|                 gr_complex* in_temp = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |                 auto* in_temp = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|                 gr_complex* in_temp_folded = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |                 auto* in_temp_folded = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|                 /*Create a signal to store a signal of size 1ms, to perform correlation |                 /*Create a signal to store a signal of size 1ms, to perform correlation | ||||||
|             in time. No folding on this data is required*/ |             in time. No folding on this data is required*/ | ||||||
|                 gr_complex* in_1code = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |                 auto* in_1code = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|                 /*Stores the values of the correlation output between the local code |                 /*Stores the values of the correlation output between the local code | ||||||
|             and the signal with doppler shift corrected */ |             and the signal with doppler shift corrected */ | ||||||
|                 gr_complex* corr_output = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |                 auto* corr_output = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|                 /*Stores a copy of the folded version of the signal.This is used for |                 /*Stores a copy of the folded version of the signal.This is used for | ||||||
|             the FFT operations in future steps of execution*/ |             the FFT operations in future steps of execution*/ | ||||||
| @@ -348,7 +352,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                 volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_samples_per_code * d_folding_factor); |                 volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_samples_per_code * d_folding_factor); | ||||||
|                 d_input_power /= static_cast<float>(d_samples_per_code * d_folding_factor); |                 d_input_power /= static_cast<float>(d_samples_per_code * d_folding_factor); | ||||||
|  |  | ||||||
|                 for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |                 for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|                     { |                     { | ||||||
|                         /*Ensure that the signal is going to start with all samples |                         /*Ensure that the signal is going to start with all samples | ||||||
|                     at zero. This is done to avoid over acumulation when performing |                     at zero. This is done to avoid over acumulation when performing | ||||||
| @@ -359,7 +363,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                         /*Doppler search steps and then multiplication of the incoming |                         /*Doppler search steps and then multiplication of the incoming | ||||||
|                     signal with the doppler wipeoffs to eliminate frequency offset |                     signal with the doppler wipeoffs to eliminate frequency offset | ||||||
|                      */ |                      */ | ||||||
|                         doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |                         doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|  |  | ||||||
|                         /*Perform multiplication of the incoming signal with the |                         /*Perform multiplication of the incoming signal with the | ||||||
|                    complex exponential vector. This removes the frequency doppler |                    complex exponential vector. This removes the frequency doppler | ||||||
| @@ -371,7 +375,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                         /*Perform folding of the carrier wiped-off incoming signal. Since |                         /*Perform folding of the carrier wiped-off incoming signal. Since | ||||||
|                    superlinear method is being used the folding factor in the |                    superlinear method is being used the folding factor in the | ||||||
|                    incoming raw data signal is of d_folding_factor^2*/ |                    incoming raw data signal is of d_folding_factor^2*/ | ||||||
|                         for (int i = 0; i < static_cast<int>(d_folding_factor * d_folding_factor); i++) |                         for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor * d_folding_factor); i++) | ||||||
|                             { |                             { | ||||||
|                                 std::transform((in_temp + i * d_fft_size), |                                 std::transform((in_temp + i * d_fft_size), | ||||||
|                                     (in_temp + ((i + 1) * d_fft_size)), |                                     (in_temp + ((i + 1) * d_fft_size)), | ||||||
| @@ -422,17 +426,17 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                             restarted between consecutive dwells in multidwell operation.*/ |                             restarted between consecutive dwells in multidwell operation.*/ | ||||||
|                                 if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) |                                 if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag) | ||||||
|                                     { |                                     { | ||||||
|                                         unsigned int detected_delay_samples_folded = 0; |                                         uint32_t detected_delay_samples_folded = 0; | ||||||
|                                         detected_delay_samples_folded = (indext % d_samples_per_code); |                                         detected_delay_samples_folded = (indext % d_samples_per_code); | ||||||
|                                         gr_complex complex_acumulator[100]; |                                         gr_complex complex_acumulator[100]; | ||||||
|                                         //gr_complex complex_acumulator[d_folding_factor]; |                                         //gr_complex complex_acumulator[d_folding_factor]; | ||||||
|  |  | ||||||
|                                         for (int i = 0; i < static_cast<int>(d_folding_factor); i++) |                                         for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) | ||||||
|                                             { |                                             { | ||||||
|                                                 d_possible_delay[i] = detected_delay_samples_folded + (i)*d_fft_size; |                                                 d_possible_delay[i] = detected_delay_samples_folded + (i)*d_fft_size; | ||||||
|                                             } |                                             } | ||||||
|  |  | ||||||
|                                         for (int i = 0; i < static_cast<int>(d_folding_factor); i++) |                                         for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) | ||||||
|                                             { |                                             { | ||||||
|                                                 /*Copy a signal of 1 code length into suggested buffer. |                                                 /*Copy a signal of 1 code length into suggested buffer. | ||||||
|                                                                       The copied signal must have doppler effect corrected*/ |                                                                       The copied signal must have doppler effect corrected*/ | ||||||
| @@ -446,7 +450,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                                                               of a shift*/ |                                                               of a shift*/ | ||||||
|                                                 volk_32fc_x2_multiply_32fc(corr_output, in_1code, d_code, d_samples_per_code); |                                                 volk_32fc_x2_multiply_32fc(corr_output, in_1code, d_code, d_samples_per_code); | ||||||
|  |  | ||||||
|                                                 for (int j = 0; j < d_samples_per_code; j++) |                                                 for (int32_t j = 0; j < d_samples_per_code; j++) | ||||||
|                                                     { |                                                     { | ||||||
|                                                         complex_acumulator[i] += (corr_output[j]); |                                                         complex_acumulator[i] += (corr_output[j]); | ||||||
|                                                     } |                                                     } | ||||||
| @@ -531,7 +535,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                 DLOG(INFO) << "test statistics threshold " << d_threshold; |                 DLOG(INFO) << "test statistics threshold " << d_threshold; | ||||||
|                 DLOG(INFO) << "folding factor " << d_folding_factor; |                 DLOG(INFO) << "folding factor " << d_folding_factor; | ||||||
|                 DLOG(INFO) << "possible delay correlation output"; |                 DLOG(INFO) << "possible delay correlation output"; | ||||||
|                 for (int i = 0; i < static_cast<int>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; |                 for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; | ||||||
|                 DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; |                 DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; | ||||||
|                 DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; |                 DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; | ||||||
|                 DLOG(INFO) << "magnitude folded " << d_mag; |                 DLOG(INFO) << "magnitude folded " << d_mag; | ||||||
| @@ -560,7 +564,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | |||||||
|                 DLOG(INFO) << "test statistics threshold " << d_threshold; |                 DLOG(INFO) << "test statistics threshold " << d_threshold; | ||||||
|                 DLOG(INFO) << "folding factor " << d_folding_factor; |                 DLOG(INFO) << "folding factor " << d_folding_factor; | ||||||
|                 DLOG(INFO) << "possible delay    corr output"; |                 DLOG(INFO) << "possible delay    corr output"; | ||||||
|                 for (int i = 0; i < static_cast<int>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; |                 for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; | ||||||
|                 DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; |                 DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; | ||||||
|                 DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; |                 DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; | ||||||
|                 DLOG(INFO) << "magnitude folded " << d_mag; |                 DLOG(INFO) << "magnitude folded " << d_mag; | ||||||
|   | |||||||
| @@ -67,10 +67,14 @@ typedef boost::shared_ptr<pcps_quicksync_acquisition_cc> | |||||||
|     pcps_quicksync_acquisition_cc_sptr; |     pcps_quicksync_acquisition_cc_sptr; | ||||||
|  |  | ||||||
| pcps_quicksync_acquisition_cc_sptr | pcps_quicksync_acquisition_cc_sptr | ||||||
| pcps_quicksync_make_acquisition_cc(unsigned int folding_factor, | pcps_quicksync_make_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int max_dwells, |     uint32_t folding_factor, | ||||||
|     unsigned int doppler_max, long fs_in, |     uint32_t sampled_ms, | ||||||
|     int samples_per_ms, int samples_per_code, |     uint32_t max_dwells, | ||||||
|  |     uint32_t doppler_max, | ||||||
|  |     int64_t fs_in, | ||||||
|  |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|     bool bit_transition_flag, |     bool bit_transition_flag, | ||||||
|     bool dump, |     bool dump, | ||||||
|     std::string dump_filename); |     std::string dump_filename); | ||||||
| @@ -86,56 +90,56 @@ class pcps_quicksync_acquisition_cc : public gr::block | |||||||
| { | { | ||||||
| private: | private: | ||||||
|     friend pcps_quicksync_acquisition_cc_sptr |     friend pcps_quicksync_acquisition_cc_sptr | ||||||
|     pcps_quicksync_make_acquisition_cc(unsigned int folding_factor, |     pcps_quicksync_make_acquisition_cc(uint32_t  folding_factor, | ||||||
|         unsigned int sampled_ms, unsigned int max_dwells, |         uint32_t  sampled_ms, uint32_t  max_dwells, | ||||||
|         unsigned int doppler_max, long fs_in, |         uint32_t  doppler_max, int64_t  fs_in, | ||||||
|         int samples_per_ms, int samples_per_code, |         int32_t samples_per_ms, int32_t samples_per_code, | ||||||
|         bool bit_transition_flag, |         bool bit_transition_flag, | ||||||
|         bool dump, |         bool dump, | ||||||
|         std::string dump_filename); |         std::string dump_filename); | ||||||
|  |  | ||||||
|     pcps_quicksync_acquisition_cc(unsigned int folding_factor, |     pcps_quicksync_acquisition_cc(uint32_t  folding_factor, | ||||||
|         unsigned int sampled_ms, unsigned int max_dwells, |         uint32_t  sampled_ms, uint32_t  max_dwells, | ||||||
|         unsigned int doppler_max, long fs_in, |         uint32_t  doppler_max, int64_t  fs_in, | ||||||
|         int samples_per_ms, int samples_per_code, |         int32_t samples_per_ms, int32_t samples_per_code, | ||||||
|         bool bit_transition_flag, |         bool bit_transition_flag, | ||||||
|         bool dump, |         bool dump, | ||||||
|         std::string dump_filename); |         std::string dump_filename); | ||||||
|  |  | ||||||
|     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, |     void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift, | ||||||
|         int doppler_offset); |         int32_t doppler_offset); | ||||||
|  |  | ||||||
|     gr_complex* d_code; |     gr_complex* d_code; | ||||||
|     unsigned int d_folding_factor;  // also referred in the paper as 'p' |     uint32_t  d_folding_factor;  // also referred in the paper as 'p' | ||||||
|     float* d_corr_acumulator; |     float* d_corr_acumulator; | ||||||
|     unsigned int* d_possible_delay; |     uint32_t * d_possible_delay; | ||||||
|     float* d_corr_output_f; |     float* d_corr_output_f; | ||||||
|     float* d_magnitude_folded; |     float* d_magnitude_folded; | ||||||
|     gr_complex* d_signal_folded; |     gr_complex* d_signal_folded; | ||||||
|     gr_complex* d_code_folded; |     gr_complex* d_code_folded; | ||||||
|     float d_noise_floor_power; |     float d_noise_floor_power; | ||||||
|  |  | ||||||
|     long d_fs_in; |     int64_t  d_fs_in; | ||||||
|     int d_samples_per_ms; |     int32_t d_samples_per_ms; | ||||||
|     int d_samples_per_code; |     int32_t d_samples_per_code; | ||||||
|     unsigned int d_doppler_resolution; |     uint32_t  d_doppler_resolution; | ||||||
|     float d_threshold; |     float d_threshold; | ||||||
|     std::string d_satellite_str; |     std::string d_satellite_str; | ||||||
|     unsigned int d_doppler_max; |     uint32_t  d_doppler_max; | ||||||
|     unsigned int d_doppler_step; |     uint32_t  d_doppler_step; | ||||||
|     unsigned int d_sampled_ms; |     uint32_t  d_sampled_ms; | ||||||
|     unsigned int d_max_dwells; |     uint32_t  d_max_dwells; | ||||||
|     unsigned int d_well_count; |     uint32_t  d_well_count; | ||||||
|     unsigned int d_fft_size; |     uint32_t  d_fft_size; | ||||||
|     uint64_t d_sample_counter; |     uint64_t d_sample_counter; | ||||||
|     gr_complex** d_grid_doppler_wipeoffs; |     gr_complex** d_grid_doppler_wipeoffs; | ||||||
|     unsigned int d_num_doppler_bins; |     uint32_t  d_num_doppler_bins; | ||||||
|     gr_complex* d_fft_codes; |     gr_complex* d_fft_codes; | ||||||
|     gr::fft::fft_complex* d_fft_if; |     gr::fft::fft_complex* d_fft_if; | ||||||
|     gr::fft::fft_complex* d_fft_if2; |     gr::fft::fft_complex* d_fft_if2; | ||||||
|     gr::fft::fft_complex* d_ifft; |     gr::fft::fft_complex* d_ifft; | ||||||
|     Gnss_Synchro* d_gnss_synchro; |     Gnss_Synchro* d_gnss_synchro; | ||||||
|     unsigned int d_code_phase; |     uint32_t  d_code_phase; | ||||||
|     float d_doppler_freq; |     float d_doppler_freq; | ||||||
|     float d_mag; |     float d_mag; | ||||||
|     float* d_magnitude; |     float* d_magnitude; | ||||||
| @@ -144,9 +148,9 @@ private: | |||||||
|     bool d_bit_transition_flag; |     bool d_bit_transition_flag; | ||||||
|     std::ofstream d_dump_file; |     std::ofstream d_dump_file; | ||||||
|     bool d_active; |     bool d_active; | ||||||
|     int d_state; |     int32_t d_state; | ||||||
|     bool d_dump; |     bool d_dump; | ||||||
|     unsigned int d_channel; |     uint32_t  d_channel; | ||||||
|     std::string d_dump_filename; |     std::string d_dump_filename; | ||||||
|  |  | ||||||
| public: | public: | ||||||
| @@ -168,7 +172,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|      * \brief Returns the maximum peak of grid search. |      * \brief Returns the maximum peak of grid search. | ||||||
|      */ |      */ | ||||||
|     inline unsigned int mag() const |     inline uint32_t  mag() const | ||||||
|     { |     { | ||||||
|         return d_mag; |         return d_mag; | ||||||
|     } |     } | ||||||
| @@ -199,13 +203,13 @@ public: | |||||||
|      * first available sample. |      * first available sample. | ||||||
|      * \param state - int=1 forces start of acquisition |      * \param state - int=1 forces start of acquisition | ||||||
|      */ |      */ | ||||||
|     void set_state(int state); |     void set_state(int32_t state); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Set acquisition channel unique ID |      * \brief Set acquisition channel unique ID | ||||||
|      * \param channel - receiver channel. |      * \param channel - receiver channel. | ||||||
|      */ |      */ | ||||||
|     inline void set_channel(unsigned int channel) |     inline void set_channel(uint32_t  channel) | ||||||
|     { |     { | ||||||
|         d_channel = channel; |         d_channel = channel; | ||||||
|     } |     } | ||||||
| @@ -224,7 +228,7 @@ public: | |||||||
|      * \brief Set maximum Doppler grid search |      * \brief Set maximum Doppler grid search | ||||||
|      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. |      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. | ||||||
|      */ |      */ | ||||||
|     inline void set_doppler_max(unsigned int doppler_max) |     inline void set_doppler_max(uint32_t  doppler_max) | ||||||
|     { |     { | ||||||
|         d_doppler_max = doppler_max; |         d_doppler_max = doppler_max; | ||||||
|     } |     } | ||||||
| @@ -233,7 +237,7 @@ public: | |||||||
|      * \brief Set Doppler steps for the grid search |      * \brief Set Doppler steps for the grid search | ||||||
|      * \param doppler_step - Frequency bin of the search grid [Hz]. |      * \param doppler_step - Frequency bin of the search grid [Hz]. | ||||||
|      */ |      */ | ||||||
|     inline void set_doppler_step(unsigned int doppler_step) |     inline void set_doppler_step(uint32_t  doppler_step) | ||||||
|     { |     { | ||||||
|         d_doppler_step = doppler_step; |         d_doppler_step = doppler_step; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -56,26 +56,35 @@ | |||||||
| #include <volk/volk.h> | #include <volk/volk.h> | ||||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | #include <volk_gnsssdr/volk_gnsssdr.h> | ||||||
| #include <sstream> | #include <sstream> | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( | pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int doppler_max, |     uint32_t sampled_ms, | ||||||
|     long fs_in, int samples_per_ms, |     uint32_t doppler_max, | ||||||
|     int samples_per_code, unsigned int tong_init_val, |     int64_t fs_in, | ||||||
|     unsigned int tong_max_val, unsigned int tong_max_dwells, |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|  |     uint32_t tong_init_val, | ||||||
|  |     uint32_t tong_max_val, | ||||||
|  |     uint32_t tong_max_dwells, | ||||||
|     bool dump, std::string dump_filename) |     bool dump, std::string dump_filename) | ||||||
| { | { | ||||||
|     return pcps_tong_acquisition_cc_sptr( |     return pcps_tong_acquisition_cc_sptr( | ||||||
|         new pcps_tong_acquisition_cc(sampled_ms, doppler_max, fs_in, samples_per_ms, samples_per_code, |         new pcps_tong_acquisition_cc(sampled_ms, doppler_max, fs_in, samples_per_ms, samples_per_code, | ||||||
|             tong_init_val, tong_max_val, tong_max_dwells, dump, dump_filename)); |             tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename))); | ||||||
| } | } | ||||||
|  |  | ||||||
| pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | ||||||
|     unsigned int sampled_ms, unsigned int doppler_max, |     uint32_t sampled_ms, | ||||||
|     long fs_in, int samples_per_ms, |     uint32_t doppler_max, | ||||||
|     int samples_per_code, unsigned int tong_init_val, |     int64_t fs_in, | ||||||
|     unsigned int tong_max_val, unsigned int tong_max_dwells, |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|  |     uint32_t tong_init_val, | ||||||
|  |     uint32_t tong_max_val, | ||||||
|  |     uint32_t tong_max_dwells, | ||||||
|     bool dump, |     bool dump, | ||||||
|     std::string dump_filename) : gr::block("pcps_tong_acquisition_cc", |     std::string dump_filename) : gr::block("pcps_tong_acquisition_cc", | ||||||
|                                      gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), |                                      gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), | ||||||
| @@ -111,14 +120,14 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | |||||||
|  |  | ||||||
|     // For dumping samples into a file |     // For dumping samples into a file | ||||||
|     d_dump = dump; |     d_dump = dump; | ||||||
|     d_dump_filename = dump_filename; |     d_dump_filename = std::move(dump_filename); | ||||||
|  |  | ||||||
|     d_doppler_resolution = 0; |     d_doppler_resolution = 0; | ||||||
|     d_threshold = 0; |     d_threshold = 0; | ||||||
|     d_doppler_step = 0; |     d_doppler_step = 0; | ||||||
|     d_grid_data = 0; |     d_grid_data = nullptr; | ||||||
|     d_grid_doppler_wipeoffs = 0; |     d_grid_doppler_wipeoffs = nullptr; | ||||||
|     d_gnss_synchro = 0; |     d_gnss_synchro = nullptr; | ||||||
|     d_code_phase = 0; |     d_code_phase = 0; | ||||||
|     d_doppler_freq = 0; |     d_doppler_freq = 0; | ||||||
|     d_test_statistics = 0; |     d_test_statistics = 0; | ||||||
| @@ -129,7 +138,7 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc() | |||||||
| { | { | ||||||
|     if (d_num_doppler_bins > 0) |     if (d_num_doppler_bins > 0) | ||||||
|         { |         { | ||||||
|             for (unsigned int i = 0; i < d_num_doppler_bins; i++) |             for (uint32_t i = 0; i < d_num_doppler_bins; i++) | ||||||
|                 { |                 { | ||||||
|                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); |                     volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); | ||||||
|                     volk_gnsssdr_free(d_grid_data[i]); |                     volk_gnsssdr_free(d_grid_data[i]); | ||||||
| @@ -175,8 +184,8 @@ void pcps_tong_acquisition_cc::init() | |||||||
|  |  | ||||||
|     // Count the number of bins |     // Count the number of bins | ||||||
|     d_num_doppler_bins = 0; |     d_num_doppler_bins = 0; | ||||||
|     for (int doppler = static_cast<int>(-d_doppler_max); |     for (auto doppler = static_cast<int32_t>(-d_doppler_max); | ||||||
|          doppler <= static_cast<int>(d_doppler_max); |          doppler <= static_cast<int32_t>(d_doppler_max); | ||||||
|          doppler += d_doppler_step) |          doppler += d_doppler_step) | ||||||
|         { |         { | ||||||
|             d_num_doppler_bins++; |             d_num_doppler_bins++; | ||||||
| @@ -185,11 +194,11 @@ void pcps_tong_acquisition_cc::init() | |||||||
|     // Create the carrier Doppler wipeoff signals and allocate data grid. |     // Create the carrier Doppler wipeoff signals and allocate data grid. | ||||||
|     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; |     d_grid_doppler_wipeoffs = new gr_complex *[d_num_doppler_bins]; | ||||||
|     d_grid_data = new float *[d_num_doppler_bins]; |     d_grid_data = new float *[d_num_doppler_bins]; | ||||||
|     for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |     for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|         { |         { | ||||||
|             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); |             d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|             int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |             int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|             float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in); |             float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in); | ||||||
|             float _phase[1]; |             float _phase[1]; | ||||||
|             _phase[0] = 0; |             _phase[0] = 0; | ||||||
| @@ -197,14 +206,14 @@ void pcps_tong_acquisition_cc::init() | |||||||
|  |  | ||||||
|             d_grid_data[doppler_index] = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); |             d_grid_data[doppler_index] = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); | ||||||
|  |  | ||||||
|             for (unsigned int i = 0; i < d_fft_size; i++) |             for (uint32_t i = 0; i < d_fft_size; i++) | ||||||
|                 { |                 { | ||||||
|                     d_grid_data[doppler_index][i] = 0; |                     d_grid_data[doppler_index][i] = 0; | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
| } | } | ||||||
|  |  | ||||||
| void pcps_tong_acquisition_cc::set_state(int state) | void pcps_tong_acquisition_cc::set_state(int32_t state) | ||||||
| { | { | ||||||
|     d_state = state; |     d_state = state; | ||||||
|     if (d_state == 1) |     if (d_state == 1) | ||||||
| @@ -219,9 +228,9 @@ void pcps_tong_acquisition_cc::set_state(int state) | |||||||
|             d_input_power = 0.0; |             d_input_power = 0.0; | ||||||
|             d_test_statistics = 0.0; |             d_test_statistics = 0.0; | ||||||
|  |  | ||||||
|             for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |             for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|                 { |                 { | ||||||
|                     for (unsigned int i = 0; i < d_fft_size; i++) |                     for (uint32_t i = 0; i < d_fft_size; i++) | ||||||
|                         { |                         { | ||||||
|                             d_grid_data[doppler_index][i] = 0; |                             d_grid_data[doppler_index][i] = 0; | ||||||
|                         } |                         } | ||||||
| @@ -240,7 +249,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, |     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, | ||||||
|     gr_vector_void_star &output_items __attribute__((unused))) |     gr_vector_void_star &output_items __attribute__((unused))) | ||||||
| { | { | ||||||
|     int acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL |     int32_t acquisition_message = -1;  //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL | ||||||
|  |  | ||||||
|     switch (d_state) |     switch (d_state) | ||||||
|         { |         { | ||||||
| @@ -259,9 +268,9 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|                         d_input_power = 0.0; |                         d_input_power = 0.0; | ||||||
|                         d_test_statistics = 0.0; |                         d_test_statistics = 0.0; | ||||||
|  |  | ||||||
|                         for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |                         for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|                             { |                             { | ||||||
|                                 for (unsigned int i = 0; i < d_fft_size; i++) |                                 for (uint32_t i = 0; i < d_fft_size; i++) | ||||||
|                                     { |                                     { | ||||||
|                                         d_grid_data[doppler_index][i] = 0; |                                         d_grid_data[doppler_index][i] = 0; | ||||||
|                                     } |                                     } | ||||||
| @@ -279,10 +288,10 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|         case 1: |         case 1: | ||||||
|             { |             { | ||||||
|                 // initialize acquisition algorithm |                 // initialize acquisition algorithm | ||||||
|                 int doppler; |                 int32_t doppler; | ||||||
|                 uint32_t indext = 0; |                 uint32_t indext = 0; | ||||||
|                 float magt = 0.0; |                 float magt = 0.0; | ||||||
|                 const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer |                 const auto *in = reinterpret_cast<const gr_complex *>(input_items[0]);  //Get the input samples pointer | ||||||
|                 float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); |                 float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); | ||||||
|                 d_input_power = 0.0; |                 d_input_power = 0.0; | ||||||
|                 d_mag = 0.0; |                 d_mag = 0.0; | ||||||
| @@ -303,11 +312,11 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|                 d_input_power /= static_cast<float>(d_fft_size); |                 d_input_power /= static_cast<float>(d_fft_size); | ||||||
|  |  | ||||||
|                 // 2- Doppler frequency search loop |                 // 2- Doppler frequency search loop | ||||||
|                 for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) |                 for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||||
|                     { |                     { | ||||||
|                         // doppler search steps |                         // doppler search steps | ||||||
|  |  | ||||||
|                         doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; |                         doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; | ||||||
|  |  | ||||||
|                         volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, |                         volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, | ||||||
|                             d_grid_doppler_wipeoffs[doppler_index], d_fft_size); |                             d_grid_doppler_wipeoffs[doppler_index], d_fft_size); | ||||||
|   | |||||||
| @@ -64,11 +64,17 @@ class pcps_tong_acquisition_cc; | |||||||
| typedef boost::shared_ptr<pcps_tong_acquisition_cc> pcps_tong_acquisition_cc_sptr; | typedef boost::shared_ptr<pcps_tong_acquisition_cc> pcps_tong_acquisition_cc_sptr; | ||||||
|  |  | ||||||
| pcps_tong_acquisition_cc_sptr | pcps_tong_acquisition_cc_sptr | ||||||
| pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, | pcps_tong_make_acquisition_cc( | ||||||
|     long fs_in, int samples_per_ms, |     uint32_t sampled_ms, | ||||||
|     int samples_per_code, unsigned int tong_init_val, |     uint32_t doppler_max, | ||||||
|     unsigned int tong_max_val, unsigned int tong_max_dwells, |     int64_t fs_in, | ||||||
|     bool dump, std::string dump_filename); |     int32_t samples_per_ms, | ||||||
|  |     int32_t samples_per_code, | ||||||
|  |     uint32_t tong_init_val, | ||||||
|  |     uint32_t tong_max_val, | ||||||
|  |     uint32_t tong_max_dwells, | ||||||
|  |     bool dump, | ||||||
|  |     std::string dump_filename); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
|  * \brief This class implements a Parallel Code Phase Search Acquisition with |  * \brief This class implements a Parallel Code Phase Search Acquisition with | ||||||
| @@ -78,45 +84,45 @@ class pcps_tong_acquisition_cc : public gr::block | |||||||
| { | { | ||||||
| private: | private: | ||||||
|     friend pcps_tong_acquisition_cc_sptr |     friend pcps_tong_acquisition_cc_sptr | ||||||
|     pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, |     pcps_tong_make_acquisition_cc(uint32_t sampled_ms, uint32_t doppler_max, | ||||||
|         long fs_in, int samples_per_ms, |         int64_t fs_in, int32_t samples_per_ms, | ||||||
|         int samples_per_code, unsigned int tong_init_val, |         int32_t samples_per_code, uint32_t tong_init_val, | ||||||
|         unsigned int tong_max_val, unsigned int tong_max_dwells, |         uint32_t tong_max_val, uint32_t tong_max_dwells, | ||||||
|         bool dump, std::string dump_filename); |         bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
|     pcps_tong_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, |     pcps_tong_acquisition_cc(uint32_t sampled_ms, uint32_t doppler_max, | ||||||
|         long fs_in, int samples_per_ms, |         int64_t fs_in, int32_t samples_per_ms, | ||||||
|         int samples_per_code, unsigned int tong_init_val, |         int32_t samples_per_code, uint32_t tong_init_val, | ||||||
|         unsigned int tong_max_val, unsigned int tong_max_dwells, |         uint32_t tong_max_val, uint32_t tong_max_dwells, | ||||||
|         bool dump, std::string dump_filename); |         bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
|     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, |     void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift, | ||||||
|         int doppler_offset); |         int32_t doppler_offset); | ||||||
|  |  | ||||||
|     long d_fs_in; |     int64_t d_fs_in; | ||||||
|     int d_samples_per_ms; |     int32_t d_samples_per_ms; | ||||||
|     int d_samples_per_code; |     int32_t d_samples_per_code; | ||||||
|     unsigned int d_doppler_resolution; |     uint32_t d_doppler_resolution; | ||||||
|     float d_threshold; |     float d_threshold; | ||||||
|     std::string d_satellite_str; |     std::string d_satellite_str; | ||||||
|     unsigned int d_doppler_max; |     uint32_t d_doppler_max; | ||||||
|     unsigned int d_doppler_step; |     uint32_t d_doppler_step; | ||||||
|     unsigned int d_sampled_ms; |     uint32_t d_sampled_ms; | ||||||
|     unsigned int d_dwell_count; |     uint32_t d_dwell_count; | ||||||
|     unsigned int d_tong_count; |     uint32_t d_tong_count; | ||||||
|     unsigned int d_tong_init_val; |     uint32_t d_tong_init_val; | ||||||
|     unsigned int d_tong_max_val; |     uint32_t d_tong_max_val; | ||||||
|     unsigned int d_tong_max_dwells; |     uint32_t d_tong_max_dwells; | ||||||
|     unsigned int d_fft_size; |     uint32_t d_fft_size; | ||||||
|     uint64_t d_sample_counter; |     uint64_t d_sample_counter; | ||||||
|     gr_complex** d_grid_doppler_wipeoffs; |     gr_complex** d_grid_doppler_wipeoffs; | ||||||
|     unsigned int d_num_doppler_bins; |     uint32_t d_num_doppler_bins; | ||||||
|     gr_complex* d_fft_codes; |     gr_complex* d_fft_codes; | ||||||
|     float** d_grid_data; |     float** d_grid_data; | ||||||
|     gr::fft::fft_complex* d_fft_if; |     gr::fft::fft_complex* d_fft_if; | ||||||
|     gr::fft::fft_complex* d_ifft; |     gr::fft::fft_complex* d_ifft; | ||||||
|     Gnss_Synchro* d_gnss_synchro; |     Gnss_Synchro* d_gnss_synchro; | ||||||
|     unsigned int d_code_phase; |     uint32_t d_code_phase; | ||||||
|     float d_doppler_freq; |     float d_doppler_freq; | ||||||
|     float d_mag; |     float d_mag; | ||||||
|     float* d_magnitude; |     float* d_magnitude; | ||||||
| @@ -124,9 +130,9 @@ private: | |||||||
|     float d_test_statistics; |     float d_test_statistics; | ||||||
|     std::ofstream d_dump_file; |     std::ofstream d_dump_file; | ||||||
|     bool d_active; |     bool d_active; | ||||||
|     int d_state; |     int32_t d_state; | ||||||
|     bool d_dump; |     bool d_dump; | ||||||
|     unsigned int d_channel; |     uint32_t d_channel; | ||||||
|     std::string d_dump_filename; |     std::string d_dump_filename; | ||||||
|  |  | ||||||
| public: | public: | ||||||
| @@ -148,7 +154,7 @@ public: | |||||||
|     /*! |     /*! | ||||||
|       * \brief Returns the maximum peak of grid search. |       * \brief Returns the maximum peak of grid search. | ||||||
|       */ |       */ | ||||||
|     inline unsigned int mag() const |     inline uint32_t mag() const | ||||||
|     { |     { | ||||||
|         return d_mag; |         return d_mag; | ||||||
|     } |     } | ||||||
| @@ -179,13 +185,13 @@ public: | |||||||
|       * first available sample. |       * first available sample. | ||||||
|       * \param state - int=1 forces start of acquisition |       * \param state - int=1 forces start of acquisition | ||||||
|       */ |       */ | ||||||
|     void set_state(int state); |     void set_state(int32_t state); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|       * \brief Set acquisition channel unique ID |       * \brief Set acquisition channel unique ID | ||||||
|       * \param channel - receiver channel. |       * \param channel - receiver channel. | ||||||
|       */ |       */ | ||||||
|     inline void set_channel(unsigned int channel) |     inline void set_channel(uint32_t channel) | ||||||
|     { |     { | ||||||
|         d_channel = channel; |         d_channel = channel; | ||||||
|     } |     } | ||||||
| @@ -204,7 +210,7 @@ public: | |||||||
|       * \brief Set maximum Doppler grid search |       * \brief Set maximum Doppler grid search | ||||||
|       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. |       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. | ||||||
|       */ |       */ | ||||||
|     inline void set_doppler_max(unsigned int doppler_max) |     inline void set_doppler_max(uint32_t doppler_max) | ||||||
|     { |     { | ||||||
|         d_doppler_max = doppler_max; |         d_doppler_max = doppler_max; | ||||||
|     } |     } | ||||||
| @@ -213,7 +219,7 @@ public: | |||||||
|       * \brief Set Doppler steps for the grid search |       * \brief Set Doppler steps for the grid search | ||||||
|       * \param doppler_step - Frequency bin of the search grid [Hz]. |       * \param doppler_step - Frequency bin of the search grid [Hz]. | ||||||
|       */ |       */ | ||||||
|     inline void set_doppler_step(unsigned int doppler_step) |     inline void set_doppler_step(uint32_t doppler_step) | ||||||
|     { |     { | ||||||
|         d_doppler_step = doppler_step; |         d_doppler_step = doppler_step; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -32,7 +32,6 @@ | |||||||
| #include "channel.h" | #include "channel.h" | ||||||
| #include "configuration_interface.h" | #include "configuration_interface.h" | ||||||
| #include "gnss_sdr_flags.h" | #include "gnss_sdr_flags.h" | ||||||
| #include <boost/lexical_cast.hpp> |  | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <cstdint> | #include <cstdint> | ||||||
|  |  | ||||||
| @@ -44,14 +43,14 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, | |||||||
|     std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav, |     std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav, | ||||||
|     std::string role, std::string implementation, gr::msg_queue::sptr queue) |     std::string role, std::string implementation, gr::msg_queue::sptr queue) | ||||||
| { | { | ||||||
|     pass_through_ = pass_through; |     pass_through_ = std::move(pass_through); | ||||||
|     acq_ = acq; |     acq_ = std::move(acq); | ||||||
|     trk_ = trk; |     trk_ = std::move(trk); | ||||||
|     nav_ = nav; |     nav_ = std::move(nav); | ||||||
|     role_ = role; |     role_ = std::move(role); | ||||||
|     implementation_ = implementation; |     implementation_ = std::move(implementation); | ||||||
|     channel_ = channel; |     channel_ = channel; | ||||||
|     queue_ = queue; |     queue_ = std::move(queue); | ||||||
|     channel_fsm_ = std::make_shared<ChannelFsm>(); |     channel_fsm_ = std::make_shared<ChannelFsm>(); | ||||||
|  |  | ||||||
|     flag_enable_fpga = configuration->property("Channel.enable_FPGA", false); |     flag_enable_fpga = configuration->property("Channel.enable_FPGA", false); | ||||||
| @@ -59,6 +58,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, | |||||||
|     trk_->set_channel(channel_); |     trk_->set_channel(channel_); | ||||||
|     nav_->set_channel(channel_); |     nav_->set_channel(channel_); | ||||||
|  |  | ||||||
|  |     gnss_synchro_ = Gnss_Synchro(); | ||||||
|     gnss_synchro_.Channel_ID = channel_; |     gnss_synchro_.Channel_ID = channel_; | ||||||
|     acq_->set_gnss_synchro(&gnss_synchro_); |     acq_->set_gnss_synchro(&gnss_synchro_); | ||||||
|     trk_->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 |     // IMPORTANT: Do not change the order between set_doppler_step and set_threshold | ||||||
|  |  | ||||||
|     uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(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 (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); | ||||||
|     if (FLAGS_doppler_step != 0) doppler_step = static_cast<uint32_t>(FLAGS_doppler_step); |     if (FLAGS_doppler_step != 0) doppler_step = static_cast<uint32_t>(FLAGS_doppler_step); | ||||||
|     DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; |     DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; | ||||||
|  |  | ||||||
|     acq_->set_doppler_step(doppler_step); |     acq_->set_doppler_step(doppler_step); | ||||||
|  |  | ||||||
|     float threshold = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(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); |     if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); | ||||||
|  |  | ||||||
|     acq_->set_threshold(threshold); |     acq_->set_threshold(threshold); | ||||||
|  |  | ||||||
|     acq_->init(); |     acq_->init(); | ||||||
|  |  | ||||||
|     repeat_ = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".repeat_satellite", false); |     repeat_ = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".repeat_satellite", false); | ||||||
|     DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_; |     DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_; | ||||||
|  |  | ||||||
|     channel_fsm_->set_acquisition(acq_); |     channel_fsm_->set_acquisition(acq_); | ||||||
| @@ -107,7 +107,9 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, | |||||||
|  |  | ||||||
|  |  | ||||||
| // Destructor | // Destructor | ||||||
| Channel::~Channel() {} | Channel::~Channel() = default; | ||||||
|  |  | ||||||
|  |  | ||||||
| void Channel::connect(gr::top_block_sptr top_block) | void Channel::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (connected_) |     if (connected_) | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ ChannelFsm::ChannelFsm() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) : acq_(acquisition) | ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) : acq_(std::move(acquisition)) | ||||||
| { | { | ||||||
|     trk_ = nullptr; |     trk_ = nullptr; | ||||||
|     channel_ = 0U; |     channel_ = 0U; | ||||||
| @@ -81,13 +81,10 @@ bool ChannelFsm::Event_start_acquisition() | |||||||
|         { |         { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     else |     d_state = 1; | ||||||
|         { |     start_acquisition(); | ||||||
|             d_state = 1; |     DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition"; | ||||||
|             start_acquisition(); |     return true; | ||||||
|             DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition"; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -98,13 +95,10 @@ bool ChannelFsm::Event_valid_acquisition() | |||||||
|         { |         { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     else |     d_state = 2; | ||||||
|         { |     start_tracking(); | ||||||
|             d_state = 2; |     DLOG(INFO) << "CH = " << channel_ << ". Ev valid acquisition"; | ||||||
|             start_tracking(); |     return true; | ||||||
|             DLOG(INFO) << "CH = " << channel_ << ". Ev valid acquisition"; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -115,13 +109,10 @@ bool ChannelFsm::Event_failed_acquisition_repeat() | |||||||
|         { |         { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     else |     d_state = 1; | ||||||
|         { |     start_acquisition(); | ||||||
|             d_state = 1; |     DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition repeat"; | ||||||
|             start_acquisition(); |     return true; | ||||||
|             DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition repeat"; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -132,13 +123,10 @@ bool ChannelFsm::Event_failed_acquisition_no_repeat() | |||||||
|         { |         { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     else |     d_state = 3; | ||||||
|         { |     request_satellite(); | ||||||
|             d_state = 3; |     DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition no repeat"; | ||||||
|             request_satellite(); |     return true; | ||||||
|             DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition no repeat"; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -149,34 +137,31 @@ bool ChannelFsm::Event_failed_tracking_standby() | |||||||
|         { |         { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     else |     d_state = 0U; | ||||||
|         { |     notify_stop_tracking(); | ||||||
|             d_state = 0U; |     DLOG(INFO) << "CH = " << channel_ << ". Ev failed tracking standby"; | ||||||
|             notify_stop_tracking(); |     return true; | ||||||
|             DLOG(INFO) << "CH = " << channel_ << ". Ev failed tracking standby"; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition) | void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition) | ||||||
| { | { | ||||||
|     std::lock_guard<std::mutex> lk(mx); |     std::lock_guard<std::mutex> lk(mx); | ||||||
|     acq_ = acquisition; |     acq_ = std::move(acquisition); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void ChannelFsm::set_tracking(std::shared_ptr<TrackingInterface> tracking) | void ChannelFsm::set_tracking(std::shared_ptr<TrackingInterface> tracking) | ||||||
| { | { | ||||||
|     std::lock_guard<std::mutex> lk(mx); |     std::lock_guard<std::mutex> lk(mx); | ||||||
|     trk_ = tracking; |     trk_ = std::move(tracking); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void ChannelFsm::set_queue(gr::msg_queue::sptr queue) | void ChannelFsm::set_queue(gr::msg_queue::sptr queue) | ||||||
| { | { | ||||||
|     std::lock_guard<std::mutex> lk(mx); |     std::lock_guard<std::mutex> lk(mx); | ||||||
|     queue_ = queue; |     queue_ = std::move(queue); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ using google::LogMessage; | |||||||
|  |  | ||||||
| channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat) | channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> 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; |     bool result = false; | ||||||
|     try |     try | ||||||
|         { |         { | ||||||
|             int64_t message = pmt::to_long(msg); |             int64_t message = pmt::to_long(std::move(msg)); | ||||||
|             switch (message) |             switch (message) | ||||||
|                 { |                 { | ||||||
|                 case 1:  // positive acquisition |                 case 1:  // positive acquisition | ||||||
| @@ -89,9 +89,9 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> cha | |||||||
|     this->message_port_register_in(pmt::mp("events")); |     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)); |     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; |     d_repeat = repeat; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| channel_msg_receiver_cc::~channel_msg_receiver_cc() {} | channel_msg_receiver_cc::~channel_msg_receiver_cc() = default; | ||||||
|   | |||||||
| @@ -32,6 +32,8 @@ | |||||||
| #include "array_signal_conditioner.h" | #include "array_signal_conditioner.h" | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  |  | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| @@ -41,11 +43,11 @@ ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configura | |||||||
|     std::shared_ptr<GNSSBlockInterface> in_filt, |     std::shared_ptr<GNSSBlockInterface> in_filt, | ||||||
|     std::shared_ptr<GNSSBlockInterface> res, |     std::shared_ptr<GNSSBlockInterface> res, | ||||||
|     std::string role, |     std::string role, | ||||||
|     std::string implementation) : data_type_adapt_(data_type_adapt), |     std::string implementation) : data_type_adapt_(std::move(data_type_adapt)), | ||||||
|                                   in_filt_(in_filt), |                                   in_filt_(std::move(in_filt)), | ||||||
|                                   res_(res), |                                   res_(std::move(res)), | ||||||
|                                   role_(role), |                                   role_(std::move(role)), | ||||||
|                                   implementation_(implementation) |                                   implementation_(std::move(implementation)) | ||||||
| { | { | ||||||
|     connected_ = false; |     connected_ = false; | ||||||
|     if (configuration) |     if (configuration) | ||||||
| @@ -55,7 +57,7 @@ ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configura | |||||||
|  |  | ||||||
|  |  | ||||||
| // Destructor | // Destructor | ||||||
| ArraySignalConditioner::~ArraySignalConditioner() {} | ArraySignalConditioner::~ArraySignalConditioner() = default; | ||||||
|  |  | ||||||
|  |  | ||||||
| void ArraySignalConditioner::connect(gr::top_block_sptr top_block) | void ArraySignalConditioner::connect(gr::top_block_sptr top_block) | ||||||
|   | |||||||
| @@ -32,6 +32,8 @@ | |||||||
| #include "signal_conditioner.h" | #include "signal_conditioner.h" | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  |  | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| @@ -41,11 +43,11 @@ SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, | |||||||
|     std::shared_ptr<GNSSBlockInterface> in_filt, |     std::shared_ptr<GNSSBlockInterface> in_filt, | ||||||
|     std::shared_ptr<GNSSBlockInterface> res, |     std::shared_ptr<GNSSBlockInterface> res, | ||||||
|     std::string role, |     std::string role, | ||||||
|     std::string implementation) : data_type_adapt_(data_type_adapt), |     std::string implementation) : data_type_adapt_(std::move(data_type_adapt)), | ||||||
|                                   in_filt_(in_filt), |                                   in_filt_(std::move(in_filt)), | ||||||
|                                   res_(res), |                                   res_(std::move(res)), | ||||||
|                                   role_(role), |                                   role_(std::move(role)), | ||||||
|                                   implementation_(implementation) |                                   implementation_(std::move(implementation)) | ||||||
| { | { | ||||||
|     connected_ = false; |     connected_ = false; | ||||||
|     if (configuration) |     if (configuration) | ||||||
| @@ -55,7 +57,7 @@ SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, | |||||||
|  |  | ||||||
|  |  | ||||||
| // Destructor | // Destructor | ||||||
| SignalConditioner::~SignalConditioner() {} | SignalConditioner::~SignalConditioner() = default; | ||||||
|  |  | ||||||
|  |  | ||||||
| void SignalConditioner::connect(gr::top_block_sptr top_block) | void SignalConditioner::connect(gr::top_block_sptr top_block) | ||||||
|   | |||||||
| @@ -31,12 +31,14 @@ | |||||||
| #include "byte_to_short.h" | #include "byte_to_short.h" | ||||||
| #include "configuration_interface.h" | #include "configuration_interface.h" | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  | #include <cstdint> | ||||||
|  | #include <utility> | ||||||
|  |  | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role, | ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role, | ||||||
|     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) |     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) | ||||||
| { | { | ||||||
|     std::string default_input_item_type = "byte"; |     std::string default_input_item_type = "byte"; | ||||||
|     std::string default_output_item_type = "short"; |     std::string default_output_item_type = "short"; | ||||||
| @@ -49,7 +51,7 @@ ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role | |||||||
|     dump_ = config_->property(role_ + ".dump", false); |     dump_ = config_->property(role_ + ".dump", false); | ||||||
|     dump_filename_ = config_->property(role_ + ".dump_filename", default_dump_filename); |     dump_filename_ = config_->property(role_ + ".dump_filename", default_dump_filename); | ||||||
|  |  | ||||||
|     size_t item_size = sizeof(short); |     size_t item_size = sizeof(int16_t); | ||||||
|  |  | ||||||
|     gr_char_to_short_ = gr::blocks::char_to_short::make(); |     gr_char_to_short_ = gr::blocks::char_to_short::make(); | ||||||
|  |  | ||||||
| @@ -71,9 +73,7 @@ ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| ByteToShort::~ByteToShort() | ByteToShort::~ByteToShort() = default; | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void ByteToShort::connect(gr::top_block_sptr top_block) | void ByteToShort::connect(gr::top_block_sptr top_block) | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string role, | IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, const std::string& role, | ||||||
|     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) |     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||||
| { | { | ||||||
|     std::string default_input_item_type = "byte"; |     std::string default_input_item_type = "byte"; | ||||||
| @@ -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) | void IbyteToCbyte::connect(gr::top_block_sptr top_block) | ||||||
| @@ -146,8 +144,5 @@ gr::basic_block_sptr IbyteToCbyte::get_right_block() | |||||||
|         { |         { | ||||||
|             return conjugate_ic_; |             return conjugate_ic_; | ||||||
|         } |         } | ||||||
|     else |     return ibyte_to_cbyte_; | ||||||
|         { |  | ||||||
|             return ibyte_to_cbyte_; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ class IbyteToCbyte : public GNSSBlockInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     IbyteToCbyte(ConfigurationInterface* configuration, |     IbyteToCbyte(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~IbyteToCbyte(); |     virtual ~IbyteToCbyte(); | ||||||
|   | |||||||
| @@ -34,7 +34,7 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::string role, | IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, const std::string& role, | ||||||
|     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) |     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||||
| { | { | ||||||
|     std::string default_input_item_type = "byte"; |     std::string default_input_item_type = "byte"; | ||||||
| @@ -75,9 +75,7 @@ IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::strin | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| IbyteToComplex::~IbyteToComplex() | IbyteToComplex::~IbyteToComplex() = default; | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void IbyteToComplex::connect(gr::top_block_sptr top_block) | void IbyteToComplex::connect(gr::top_block_sptr top_block) | ||||||
| @@ -144,8 +142,5 @@ gr::basic_block_sptr IbyteToComplex::get_right_block() | |||||||
|         { |         { | ||||||
|             return conjugate_cc_; |             return conjugate_cc_; | ||||||
|         } |         } | ||||||
|     else |     return gr_interleaved_char_to_complex_; | ||||||
|         { |  | ||||||
|             return gr_interleaved_char_to_complex_; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ class IbyteToComplex : public GNSSBlockInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     IbyteToComplex(ConfigurationInterface* configuration, |     IbyteToComplex(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~IbyteToComplex(); |     virtual ~IbyteToComplex(); | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string role, | IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, const std::string& role, | ||||||
|     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) |     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||||
| { | { | ||||||
|     std::string default_input_item_type = "byte"; |     std::string default_input_item_type = "byte"; | ||||||
| @@ -78,9 +78,7 @@ IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| IbyteToCshort::~IbyteToCshort() | IbyteToCshort::~IbyteToCshort() = default; | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void IbyteToCshort::connect(gr::top_block_sptr top_block) | void IbyteToCshort::connect(gr::top_block_sptr top_block) | ||||||
| @@ -143,8 +141,5 @@ gr::basic_block_sptr IbyteToCshort::get_right_block() | |||||||
|         { |         { | ||||||
|             return conjugate_sc_; |             return conjugate_sc_; | ||||||
|         } |         } | ||||||
|     else |     return interleaved_byte_to_complex_short_; | ||||||
|         { |  | ||||||
|             return interleaved_byte_to_complex_short_; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ class IbyteToCshort : public GNSSBlockInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     IbyteToCshort(ConfigurationInterface* configuration, |     IbyteToCshort(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~IbyteToCshort(); |     virtual ~IbyteToCshort(); | ||||||
|   | |||||||
| @@ -34,7 +34,7 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::string role, | IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, const std::string& role, | ||||||
|     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) |     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||||
| { | { | ||||||
|     std::string default_input_item_type = "short"; |     std::string default_input_item_type = "short"; | ||||||
| @@ -75,9 +75,7 @@ IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::str | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| IshortToComplex::~IshortToComplex() | IshortToComplex::~IshortToComplex() = default; | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void IshortToComplex::connect(gr::top_block_sptr top_block) | void IshortToComplex::connect(gr::top_block_sptr top_block) | ||||||
| @@ -144,8 +142,5 @@ gr::basic_block_sptr IshortToComplex::get_right_block() | |||||||
|         { |         { | ||||||
|             return conjugate_cc_; |             return conjugate_cc_; | ||||||
|         } |         } | ||||||
|     else |     return gr_interleaved_short_to_complex_; | ||||||
|         { |  | ||||||
|             return gr_interleaved_short_to_complex_; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -47,7 +47,7 @@ class IshortToComplex : public GNSSBlockInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     IshortToComplex(ConfigurationInterface* configuration, |     IshortToComplex(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~IshortToComplex(); |     virtual ~IshortToComplex(); | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::string role, | IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, const std::string& role, | ||||||
|     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) |     unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||||
| { | { | ||||||
|     std::string default_input_item_type = "short"; |     std::string default_input_item_type = "short"; | ||||||
| @@ -77,9 +77,7 @@ IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::strin | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| IshortToCshort::~IshortToCshort() | IshortToCshort::~IshortToCshort() = default; | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void IshortToCshort::connect(gr::top_block_sptr top_block) | void IshortToCshort::connect(gr::top_block_sptr top_block) | ||||||
| @@ -146,8 +144,5 @@ gr::basic_block_sptr IshortToCshort::get_right_block() | |||||||
|         { |         { | ||||||
|             return conjugate_sc_; |             return conjugate_sc_; | ||||||
|         } |         } | ||||||
|     else |     return interleaved_short_to_complex_short_; | ||||||
|         { |  | ||||||
|             return interleaved_short_to_complex_short_; |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ class IshortToCshort : public GNSSBlockInterface | |||||||
| { | { | ||||||
| public: | public: | ||||||
|     IshortToCshort(ConfigurationInterface* configuration, |     IshortToCshort(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, |         const std::string& role, unsigned int in_streams, | ||||||
|         unsigned int out_streams); |         unsigned int out_streams); | ||||||
|  |  | ||||||
|     virtual ~IshortToCshort(); |     virtual ~IshortToCshort(); | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez