diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake index 76a832ca5..31739e216 100644 --- a/cmake/Modules/FindGFLAGS.cmake +++ b/cmake/Modules/FindGFLAGS.cmake @@ -17,8 +17,9 @@ # - Try to find GFlags # -# The following variables are optionally searched for defaults -# GFlags_ROOT_DIR: Base directory where all GFlags components are found +# The following CMake and environment variables are optionally searched +# for defaults: +# GFLAGS_ROOT: Base directory where all GFlags components are found # # The following are set after configuration is done: # GFlags_FOUND @@ -30,39 +31,45 @@ if(APPLE) find_path(GFlags_ROOT_DIR libgflags.dylib PATHS - /opt/local/lib - /usr/local/lib + /opt/local/lib + /usr/local/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib ) else() find_path(GFlags_ROOT_DIR libgflags.so HINTS - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/powerpc-linux-gnuspe - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/i386-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i386-kfreebsd-gnu - /usr/lib/m68k-linux-gnu - /usr/lib/sh4-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/alpha-linux-gnu - /usr/lib64 - /usr/lib + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ${GFLAGS_ROOT}/lib64 + $ENV{GFLAGS_ROOT}/lib64 ) endif() @@ -71,10 +78,12 @@ if(GFlags_ROOT_DIR) find_path(GFlags_INCLUDE_DIRS gflags/gflags.h HINTS - /opt/local/include - /usr/local/include - /usr/include - ${GFlags_ROOT_DIR}/src + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ${GFLAGS_ROOT}/include + $ENV{GFLAGS_ROOT}/include ) # Find the libraries diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index f3299fefb..f19ccd77a 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -142,6 +142,8 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/gcc/powerpc64le-linux-gnu/8 /usr/lib/gcc/s390x-linux-gnu/8 /usr/lib/gcc/alpha-linux-gnu/8 + ${GFORTRAN_ROOT}/lib + $ENV{GFORTRAN_ROOT}/lib ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 50231f585..2d8f154f3 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -68,6 +68,10 @@ macro(_FIND_GLOG_LIBRARIES _var) /usr/lib/alpha-linux-gnu /usr/lib64 /usr/lib + ${GLOG_ROOT}/lib + $ENV{GLOG_ROOT}/lib + ${GLOG_ROOT}/lib64 + $ENV{GLOG_ROOT}/lib64 PATH_SUFFIXES lib ) mark_as_advanced(${_var}) diff --git a/cmake/Modules/FindGNSSSIMULATOR.cmake b/cmake/Modules/FindGNSSSIMULATOR.cmake index 5d4294548..66aa9176a 100644 --- a/cmake/Modules/FindGNSSSIMULATOR.cmake +++ b/cmake/Modules/FindGNSSSIMULATOR.cmake @@ -17,11 +17,14 @@ find_program(SW_GENERATOR_BIN gnss_sim PATHS /usr/bin - /usr/local/bin - /opt/local/bin - ${CMAKE_INSTALL_PREFIX}/bin - PATH_SUFFIXES bin) + /usr/local/bin + /opt/local/bin + ${CMAKE_INSTALL_PREFIX}/bin + ${GNSSSIMULATOR_ROOT}/bin + $ENV{GNSSSIMULATOR_ROOT}/bin + PATH_SUFFIXES bin +) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) +find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) mark_as_advanced(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index c6811ba7f..7f5deb3ab 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -65,29 +65,29 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) # look for include files - find_path( - ${INCVAR_NAME} + find_path(${INCVAR_NAME} NAMES ${INCFILE} HINTS $ENV{GNURADIO_RUNTIME_DIR}/include - ${PC_INCDIR} - ${CMAKE_INSTALL_PREFIX}/include - ${GNURADIO_INSTALL_PREFIX}/include + ${PC_INCDIR} + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) # look for libs foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) - find_library( - ${LIBVAR_NAME}_${libname} + find_library(${LIBVAR_NAME}_${libname} NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib - ${PC_LIBDIR} - ${CMAKE_INSTALL_PREFIX}/lib/ - ${CMAKE_INSTALL_PREFIX}/lib64/ - ${GNURADIO_INSTALL_PREFIX}/lib/ - ${GNURADIO_INSTALL_PREFIX}/lib64 + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_INSTALL_PREFIX}/lib64 PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -115,6 +115,10 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_ROOT}/lib + $ENV{GNURADIO_ROOT}/lib + ${GNURADIO_ROOT}/lib64 + $ENV{GNURADIO_ROOT}/lib64 ) list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) endforeach() @@ -174,6 +178,8 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) if(GNURADIO_VERSION_GREATER_THAN_373) set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") @@ -187,6 +193,8 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) if(GNURADIO_VERSION_GREATER_THAN_38) set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake index 3278caf92..67dfff8af 100644 --- a/cmake/Modules/FindGPERFTOOLS.cmake +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -24,7 +24,7 @@ # Variables used by this module, they can change the default behaviour and need # to be set before calling find_package: # -# Gperftools_ROOT_DIR Set this variable to the root installation of +# GPERFTOOLS_ROOT Set this variable to the root installation of # Gperftools if the module has problems finding # the proper installation path. # @@ -36,19 +36,37 @@ find_library(GPERFTOOLS_TCMALLOC NAMES tcmalloc - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_library(GPERFTOOLS_PROFILER NAMES profiler - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER NAMES tcmalloc_and_profiler - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h - HINTS ${Gperftools_ROOT_DIR}/include) + HINTS ${Gperftools_ROOT_DIR}/include + ${GPERFTOOLS_ROOT}/include + $ENV{GPERFTOOLS_ROOT}/include +) set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index c3270a6eb..f5ecb667e 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -24,14 +24,23 @@ find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp HINTS /usr/include - /usr/local/include - /opt/local/include) + /usr/local/include + /opt/local/include + ${GPSTK_ROOT}/include + $ENV{GPSTK_ROOT}/include +) set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) + find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} HINTS /usr/lib - /usr/local/lib - /opt/local/lib) + /usr/local/lib + /opt/local/lib + ${GPSTK_ROOT}/lib + $ENV{GPSTK_ROOT}/lib + ${GPSTK_ROOT}/lib64 + $ENV{GPSTK_ROOT}/lib64 +) # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake index 4b99f3702..e0689aeaf 100644 --- a/cmake/Modules/FindGRDBFCTTC.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -30,6 +30,8 @@ find_path( PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/include /usr/local/include + ${GRDBFCTTC_ROOT}/include + $ENV{GRDBFCTTC_ROOT}/include ) find_library( @@ -43,6 +45,10 @@ find_library( /usr/lib64 /usr/local/lib /usr/local/lib64 + ${GRDBFCTTC_ROOT}/lib + $ENV{GRDBFCTTC_ROOT}/lib + ${GRDBFCTTC_ROOT}/lib64 + $ENV{GRDBFCTTC_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake index 119a75eed..93f7bda89 100644 --- a/cmake/Modules/FindGRGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -30,6 +30,8 @@ find_path( PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${GRGN3S_ROOT}/include + $ENV{GRGN3S_ROOT}/include ) find_library( @@ -43,6 +45,10 @@ find_library( /usr/local/lib64 /usr/lib /usr/lib64 + ${GRGN3S_ROOT}/lib + $ENV{GRGN3S_ROOT}/lib + ${GRGN3S_ROOT}/lib64 + $ENV{GRGN3S_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 5575e3122..6d341e7fd 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -18,21 +18,21 @@ include(FindPkgConfig) pkg_check_modules(PC_IIO gnuradio-iio) -find_path( - IIO_INCLUDE_DIRS +find_path(IIO_INCLUDE_DIRS NAMES gnuradio/iio/api.h HINTS $ENV{IIO_DIR}/include - ${PC_IIO_INCLUDEDIR} + ${PC_IIO_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${GRIIO_ROOT}/include + $ENV{GRIIO_ROOT}/include ) -find_library( - IIO_LIBRARIES +find_library(IIO_LIBRARIES NAMES gnuradio-iio HINTS $ENV{IIO_DIR}/lib - ${PC_IIO_LIBDIR} + ${PC_IIO_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 /usr/local/lib @@ -61,6 +61,10 @@ find_library( /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/sh4-linux-gnu + ${GRIIO_ROOT}/lib + $ENV{GRIIO_ROOT}/lib + ${GRIIO_ROOT}/lib64 + $ENV{GRIIO_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index e78541806..48379ed76 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -34,14 +34,20 @@ # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers +include(FindPkgConfig) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) + find_path(GROSMOSDR_INCLUDE_DIR - NAMES osmosdr/source.h + NAMES + osmosdr/source.h osmosdr/api.h PATHS - ${GROSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include + ${GROSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + /opt/local/include + ${GROSMOSDR_ROOT}/include + $ENV{GROSMOSDR_ROOT}/include ) find_library(GROSMOSDR_LIBRARIES @@ -50,6 +56,7 @@ find_library(GROSMOSDR_LIBRARIES ${GROSMOSDR_PKG_LIBRARY_DIRS} /usr/lib /usr/local/lib + /opt/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabihf @@ -74,6 +81,10 @@ find_library(GROSMOSDR_LIBRARIES /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 + ${GROSMOSDR_ROOT}/lib + $ENV{GROSMOSDR_ROOT}/lib + ${GROSMOSDR_ROOT}/lib64 + $ENV{GROSMOSDR_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake index f8b6d10b9..a76180ca2 100644 --- a/cmake/Modules/FindLIBIIO.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -27,6 +27,8 @@ find_path( /usr/local/include /usr/include /opt/local/include + ${LIBIIO_ROOT}/include + $ENV{LIBIIO_ROOT}/include ) find_library( @@ -63,6 +65,10 @@ find_library( /usr/lib/x86_64-linux-gnux32 /usr/lib/sh4-linux-gnu /Library/Frameworks/iio.framework/ + ${LIBIIO_ROOT}/lib + $ENV{LIBIIO_ROOT}/lib + ${LIBIIO_ROOT}/lib64 + $ENV{LIBIIO_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 72f459e72..1e3aaf5e0 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -28,12 +28,16 @@ # LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers +include(FindPkgConfig) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) + find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h PATHS - ${LIBOSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + ${LIBOSMOSDR_ROOT}/include + $ENV{LIBOSMOSDR_ROOT}/include ) find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr @@ -65,7 +69,11 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 - ) + ${LIBOSMOSDR_ROOT}/lib + $ENV{LIBOSMOSDR_ROOT}/lib + ${LIBOSMOSDR_ROOT}/lib64 + $ENV{LIBOSMOSDR_ROOT}/lib64 +) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake index b14ac009a..283c3ddf9 100644 --- a/cmake/Modules/FindLOG4CPP.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -32,6 +32,8 @@ find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh /opt/local/include /usr/local/include /usr/include + ${LOG4CPP_ROOT}/include + $ENV{LOG4CPP_ROOT}/include ) set(LOG4CPP_NAMES log4cpp) @@ -68,6 +70,10 @@ find_library(LOG4CPP_LIBRARY /usr/lib /usr/local/lib /opt/local/lib + ${LOG4CPP_ROOT}/lib + $ENV{LOG4CPP_ROOT}/lib + ${LOG4CPP_ROOT}/lib64 + $ENV{LOG4CPP_ROOT}/lib64 ) if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index e9d66c65b..08facf069 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -60,10 +60,24 @@ # # Look for the header file. -find_path(MATIO_INCLUDE_DIR NAMES matio.h DOC "The MATIO include directory") +find_path(MATIO_INCLUDE_DIR + NAMES matio.h + HINTS + ${MATIO_ROOT}/include + $ENV{MATIO_ROOT}/include + DOC "The MATIO include directory" +) # Look for the library. -find_library(MATIO_LIBRARY NAMES matio DOC "The MATIO library") +find_library(MATIO_LIBRARY + NAMES matio + HINTS + ${MATIO_ROOT}/lib + $ENV{MATIO_ROOT}/lib + ${MATIO_ROOT}/lib64 + $ENV{MATIO_ROOT}/lib64 + DOC "The MATIO library" +) if(MATIO_INCLUDE_DIR) # --------------------------------------------------- diff --git a/cmake/Modules/FindOPENBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake index 0704a9681..8ff70d65f 100644 --- a/cmake/Modules/FindOPENBLAS.cmake +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -20,17 +20,22 @@ # The following environment variable is optionally searched # OPENBLAS_HOME: Base directory where all OpenBlas components are found -set(OPEN_BLAS_SEARCH_PATHS /lib/ - /lib64/ - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/OpenBLAS/lib - /opt/local/lib - /usr/lib/openblas-base - $ENV{OPENBLAS_HOME}/lib - ) +set(OPEN_BLAS_SEARCH_PATHS + /lib + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib + ${OPENBLAS_ROOT}/lib + $ENV{OPENBLAS_ROOT}/lib + ${OPENBLAS_ROOT}/lib64 + $ENV{OPENBLAS_ROOT}/lib64 +) find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 7bd013e67..fea12b98f 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -20,41 +20,50 @@ pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") find_program(ORCC_EXECUTABLE orcc HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) + PATHS ${ORC_ROOT}/bin + ${CMAKE_INSTALL_PREFIX}/bin +) -find_path(ORC_INCLUDE_DIR NAMES orc/orc.h +find_path(ORC_INCLUDE_DIR + NAMES orc/orc.h HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) + PATHS ${ORC_ROOT}/include/orc-0.4 + ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 +) - -find_path(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + ${ORC_ROOT}/lib + $ENV{ORC_ROOT}/lib + PATHS + ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) find_library(ORC_LIB orc-0.4 HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -list(APPEND ORC_LIBRARY - ${ORC_LIB} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} ) +list(APPEND ORC_LIBRARY ${ORC_LIB}) set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) set(ORC_LIBRARIES ${ORC_LIBRARY}) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index d91524ff4..af746c852 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -48,10 +48,12 @@ if(EXISTS $ENV{PCAPDIR}) find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include NO_DEFAULT_PATH ) find_library(PCAP_LIBRARY @@ -59,18 +61,25 @@ if(EXISTS $ENV{PCAPDIR}) pcap PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib NO_DEFAULT_PATH ) else() find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h + HINTS + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include ) - find_library(PCAP_LIBRARY NAMES pcap + HINTS + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib ) endif() diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index da7de4188..236a4c95a 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -26,28 +26,36 @@ find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp PATHS ${PUGIXML_HOME}/include - /usr/include - /usr/local/include - /opt/local/include) + /usr/include + /usr/local/include + /opt/local/include + ${PUGIXML_ROOT}/include + $ENV{PUGIXML_ROOT}/include +) find_library(PUGIXML_LIBRARY NAMES pugixml PATHS ${PUGIXML_HOME}/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/aarch64-linux-gnu - /usr/lib/arm-linux-gnueabi - /usr/lib/arm-linux-gnueabihf - /usr/lib/i386-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/local/lib - /opt/local/lib - /usr/lib - /usr/lib64 - /usr/local/lib64) + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib + /usr/lib64 + /usr/local/lib64 + ${PUGIXML_ROOT}/lib + $ENV{PUGIXML_ROOT}/lib + ${PUGIXML_ROOT}/lib64 + $ENV{PUGIXML_ROOT}/lib64 +) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index 0f78ed339..eb2420687 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -18,27 +18,31 @@ include(FindPkgConfig) pkg_check_modules(PC_TELEORBIT teleorbit) -find_path( - TELEORBIT_INCLUDE_DIRS +find_path(TELEORBIT_INCLUDE_DIRS NAMES teleorbit/api.h HINTS $ENV{TELEORBIT_DIR}/include - ${PC_TELEORBIT_INCLUDEDIR} + ${PC_TELEORBIT_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${TELEORBIT_ROOT}/include + $ENV{TELEORBIT_ROOT}/include ) -find_library( - TELEORBIT_LIBRARIES +find_library(TELEORBIT_LIBRARIES NAMES gnuradio-teleorbit HINTS $ENV{TELEORBIT_DIR}/lib - ${PC_TELEORBIT_LIBDIR} + ${PC_TELEORBIT_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 + ${TELEORBIT_ROOT}/lib + $ENV{TELEORBIT_ROOT}/lib + ${TELEORBIT_ROOT}/lib64 + $ENV{TELEORBIT_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index fc12a9cdd..31d299937 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -22,21 +22,21 @@ include(FindPkgConfig) pkg_check_modules(PC_UHD uhd) -find_path( - UHD_INCLUDE_DIRS +find_path(UHD_INCLUDE_DIRS NAMES uhd/config.hpp HINTS $ENV{UHD_DIR}/include - ${PC_UHD_INCLUDEDIR} + ${PC_UHD_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${UHD_ROOT}/include + $ENV{UHD_ROOT}/include ) -find_library( - UHD_LIBRARIES +find_library(UHD_LIBRARIES NAMES uhd HINTS $ENV{UHD_DIR}/lib - ${PC_UHD_LIBDIR} + ${PC_UHD_LIBDIR} PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -64,6 +64,10 @@ find_library( /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${UHD_ROOT}/lib + $ENV{UHD_ROOT}/lib + ${UHD_ROOT}/lib64 + $ENV{UHD_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index d491c08b0..97191179c 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -22,18 +22,18 @@ include(FindPkgConfig) pkg_check_modules(PC_VOLK volk) -find_path( - VOLK_INCLUDE_DIRS +find_path(VOLK_INCLUDE_DIRS NAMES volk/volk.h HINTS $ENV{VOLK_DIR}/include ${PC_VOLK_INCLUDEDIR} PATHS /usr/local/include /usr/include ${CMAKE_INSTALL_PREFIX}/include + ${VOLK_ROOT}/include + $ENV{VOLK_ROOT}/include ) -find_library( - VOLK_LIBRARIES +find_library(VOLK_LIBRARIES NAMES volk HINTS $ENV{VOLK_DIR}/lib ${PC_VOLK_LIBDIR} @@ -65,6 +65,10 @@ find_library( /usr/lib/alpha-linux-gnu /usr/lib64 ${CMAKE_INSTALL_PREFIX}/lib + ${VOLK_ROOT}/lib + $ENV{VOLK_ROOT}/lib + ${VOLK_ROOT}/lib64 + $ENV{VOLK_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake index cd5cac918..5cdc4e61d 100644 --- a/cmake/Modules/FindVOLKGNSSSDR.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -22,26 +22,30 @@ include(FindPkgConfig) pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) -find_path( - VOLK_GNSSSDR_INCLUDE_DIRS +find_path(VOLK_GNSSSDR_INCLUDE_DIRS NAMES volk_gnsssdr/volk_gnsssdr.h HINTS $ENV{VOLK_GNSSSDR_DIR}/include - ${PC_VOLK_GNSSSDR_INCLUDEDIR} + ${PC_VOLK_GNSSSDR_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${VOLKGNSSSDR_ROOT}/include + $ENV{VOLKGNSSSDR_ROOT}/include ) -find_library( - VOLK_GNSSSDR_LIBRARIES +find_library(VOLK_GNSSSDR_LIBRARIES NAMES volk_gnsssdr HINTS $ENV{VOLK_GNSSSDR_DIR}/lib - ${PC_VOLK_GNSSSDR_LIBDIR} + ${PC_VOLK_GNSSSDR_LIBDIR} PATHS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 ${GNURADIO_INSTALL_PREFIX}/lib + ${VOLKGNSSSDR_ROOT}/lib + $ENV{VOLKGNSSSDR_ROOT}/lib + ${VOLKGNSSSDR_ROOT}/lib64 + $ENV{VOLKGNSSSDR_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Toolchains/oe-sdk_cross.cmake b/cmake/Toolchains/oe-sdk_cross.cmake index aac39094e..dd7aedf5f 100644 --- a/cmake/Toolchains/oe-sdk_cross.cmake +++ b/cmake/Toolchains/oe-sdk_cross.cmake @@ -18,20 +18,20 @@ ########################################################## # Toolchain file for Open Embedded ########################################################## -set( CMAKE_SYSTEM_NAME Linux ) +set(CMAKE_SYSTEM_NAME Linux) string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT}) string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) -set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) -set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) #same flags for C sources -set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) #same flags for C sources -set( CMAKE_LIBRARY_PATH $ENV{OECORE_TARGET_SYSROOT}/usr/lib ) +set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE) # same flags for C sources +set(CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) # same flags for C sources +set(CMAKE_LIBRARY_PATH $ENV{OECORE_TARGET_SYSROOT}/usr/lib) -set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} ) -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) -set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) -set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) +set(CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set ( ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4 ) -set ( ORC_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib ) +set(ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4) +set(ORC_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 9b3887185..a0004acc5 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -17,7 +17,7 @@ if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif() file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") @@ -28,11 +28,11 @@ foreach(file ${files}) COMMAND @CMAKE_COMMAND@ -E remove \"$ENV{DESTDIR}${file}\" OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval - ) + ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + endif() + else() message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) + endif() +endforeach() diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 05ea52e5f..5bc2b473f 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -49,30 +49,10 @@ namespace bc = boost::integer; using google::LogMessage; -bool RtklibPvt::get_latest_PVT(double* longitude_deg, - double* latitude_deg, - double* height_m, - double* ground_speed_kmh, - double* course_over_ground_deg, - time_t* UTC_time) -{ - return pvt_->get_latest_PVT(longitude_deg, - latitude_deg, - height_m, - ground_speed_kmh, - course_over_ground_deg, - UTC_time); -} - -void RtklibPvt::clear_ephemeris() -{ - pvt_->clear_ephemeris(); -} - RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, - unsigned int out_streams) : role_(role), + unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { @@ -100,27 +80,27 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, // RINEX version pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3); - if (FLAGS_RINEX_version.compare("3.01") == 0) + if (FLAGS_RINEX_version == "3.01") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version.compare("3.02") == 0) + else if (FLAGS_RINEX_version == "3.02") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version.compare("3") == 0) + else if (FLAGS_RINEX_version == "3") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version.compare("2.11") == 0) + else if (FLAGS_RINEX_version == "2.11") { pvt_output_parameters.rinex_version = 2; } - else if (FLAGS_RINEX_version.compare("2.10") == 0) + else if (FLAGS_RINEX_version == "2.10") { pvt_output_parameters.rinex_version = 2; } - else if (FLAGS_RINEX_version.compare("2") == 0) + else if (FLAGS_RINEX_version == "2") { pvt_output_parameters.rinex_version = 2; } @@ -240,11 +220,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int positioning_mode = -1; std::string default_pos_mode("Single"); std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h - if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; - if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; - if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; - if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; - if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; + if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE; + if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC; + if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA; + if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC; + if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA; if (positioning_mode == -1) { @@ -289,12 +269,12 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_iono_model("OFF"); std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ int iono_model = -1; - if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; - if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; - if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; - if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; - if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; - if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; + if (iono_model_str == "OFF") iono_model = IONOOPT_OFF; + if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC; + if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS; + if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC; + if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST; + if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC; if (iono_model == -1) { //warn user and set the default @@ -308,11 +288,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_trop_model("OFF"); int trop_model = -1; std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF; - if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; - if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; - if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; - if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; + if (trop_model_str == "OFF") trop_model = TROPOPT_OFF; + if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS; + if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS; + if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST; + if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG; if (trop_model == -1) { //warn user and set the default @@ -357,11 +337,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_gps_ar("Continuous"); std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ int integer_ambiguity_resolution_gps = -1; - if (integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF; - if (integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT; - if (integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST; - if (integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; - if (integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR; + if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF; + if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT; + if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST; + if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; + if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR; if (integer_ambiguity_resolution_gps == -1) { //warn user and set the default @@ -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, which uses the ratio of squared residuals of the best integer vector to the second‐best vector. */ - int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity. + int min_lock_to_fix_ambiguity = configuration->property(role + ".min_lock_to_fix_ambiguity", 0); /* Set the minimum lock count to fix integer ambiguity.FLAGS_RINEX_version. If the lock count is less than the value, the ambiguity is excluded from the fixed integer vector. */ double min_elevation_to_fix_ambiguity = configuration->property(role + ".min_elevation_to_fix_ambiguity", 0.0); /* Set the minimum elevation (deg) to fix integer ambiguity. @@ -537,6 +517,28 @@ RtklibPvt::~RtklibPvt() } +bool RtklibPvt::get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time) +{ + return pvt_->get_latest_PVT(longitude_deg, + latitude_deg, + height_m, + ground_speed_kmh, + course_over_ground_deg, + UTC_time); +} + + +void RtklibPvt::clear_ephemeris() +{ + pvt_->clear_ephemeris(); +} + + std::map RtklibPvt::get_gps_ephemeris() const { return pvt_->get_gps_ephemeris_map(); diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index ed2bf7da4..d222ce565 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -46,7 +46,7 @@ class RtklibPvt : public PvtInterface { public: RtklibPvt(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 7e6753b48..b3e3b2b51 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -29,11 +29,11 @@ */ #include "rtklib_pvt_cc.h" +#include "display.h" #include "galileo_almanac.h" #include "galileo_almanac_helper.h" -#include "pvt_conf.h" -#include "display.h" #include "gnss_sdr_create_directory.h" +#include "pvt_conf.h" #include #include #include @@ -59,7 +59,7 @@ using google::LogMessage; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk) + const rtk_t& rtk) { return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, conf_, @@ -268,9 +268,9 @@ void rtklib_pvt_cc::clear_ephemeris() rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", - gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), - gr::io_signature::make(0, 0, 0)) + const rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", + gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), + gr::io_signature::make(0, 0, 0)) { d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; @@ -492,7 +492,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, { xml_base_path = p.string(); } - if (xml_base_path.compare(".") != 0) + if (xml_base_path != ".") { std::cout << "XML files will be stored at " << xml_base_path << std::endl; } @@ -858,7 +858,7 @@ bool rtklib_pvt_cc::send_sys_v_ttff_msg(ttff_msgbuf ttff) } -bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string file_name) +bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) { if (gnss_observables_map.empty() == false) { @@ -885,7 +885,7 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string file_name) } -bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string file_name) +bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name) { // load from xml (boost serialize) std::ifstream ifs; @@ -959,7 +959,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator tmp_eph_iter_gal = d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); std::map::const_iterator tmp_eph_iter_cnav = d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); std::map::const_iterator tmp_eph_iter_glo_gnav = d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); - if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1C") == 0)) or ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("2S") == 0)) or ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1B") == 0)) or ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("5X") == 0)) or ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1G") == 0)) or ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("2G") == 0)) or ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("L5") == 0))) + if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1C")) or + ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "2S")) or + ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1B")) or + ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "5X")) or + ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1G")) or + ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "2G")) or + ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "L5"))) { // store valid observables in a map. gnss_observables_map.insert(std::pair(i, in[i][epoch])); @@ -1893,7 +1899,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -1905,7 +1911,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2013,7 +2019,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2025,7 +2031,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2073,7 +2079,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2085,7 +2091,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2132,7 +2138,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2144,7 +2150,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2191,7 +2197,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2203,7 +2209,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2250,7 +2256,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2262,7 +2268,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) @@ -2395,7 +2401,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2407,7 +2413,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2513,7 +2519,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2525,7 +2531,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2573,7 +2579,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2585,7 +2591,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2633,7 +2639,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2645,7 +2651,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2694,7 +2700,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { // This is a channel with valid GPS signal gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2706,7 +2712,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glo_channel == 0) { - if (system.compare("R") == 0) + if (system == "R") { glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -2754,7 +2760,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2766,7 +2772,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 2f6bd32f0..558bc74f0 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -59,7 +59,7 @@ typedef boost::shared_ptr rtklib_pvt_cc_sptr; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, const Pvt_Conf& conf_, - rtk_t& rtk); + const rtk_t& rtk); /*! * \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library @@ -69,7 +69,7 @@ class rtklib_pvt_cc : public gr::sync_block private: friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk); + const rtk_t& rtk); void msg_handler_telemetry(pmt::pmt_t msg); @@ -131,9 +131,9 @@ private: bool send_sys_v_ttff_msg(ttff_msgbuf ttff); std::chrono::time_point start, end; - bool save_gnss_synchro_map_xml(const std::string file_name); //debug helper function + bool save_gnss_synchro_map_xml(const std::string& file_name); //debug helper function - bool load_gnss_synchro_map_xml(const std::string file_name); //debug helper function + bool load_gnss_synchro_map_xml(const std::string& file_name); //debug helper function bool d_xml_storage; std::string xml_base_path; @@ -147,7 +147,7 @@ private: public: rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, - rtk_t& rtk); + const rtk_t& rtk); /*! * \brief Get latest set of ephemeris from PVT block diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index b79a4edae..5a6561880 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -68,7 +68,7 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) { geojson_base_path = p.string(); } - if (geojson_base_path.compare(".") != 0) + if (geojson_base_path != ".") { std::cout << "GeoJSON files will be stored at " << geojson_base_path << std::endl; } @@ -83,7 +83,7 @@ GeoJSON_Printer::~GeoJSON_Printer() } -bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) +bool GeoJSON_Printer::set_headers(const std::string& filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -140,7 +140,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) DLOG(INFO) << "GeoJSON printer writing on " << filename.c_str(); // Set iostream numeric format and precision - geojson_file.setf(geojson_file.fixed, geojson_file.floatfield); + geojson_file.setf(geojson_file.std::ofstream::fixed, geojson_file.std::ofstream::floatfield); geojson_file << std::setprecision(14); // Writing the header @@ -171,7 +171,7 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr& positi double longitude; double height; - std::shared_ptr position_ = position; + const std::shared_ptr& position_ = position; if (print_average_values == false) { diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h index 63630552c..b9bdcdb28 100644 --- a/src/algorithms/PVT/libs/geojson_printer.h +++ b/src/algorithms/PVT/libs/geojson_printer.h @@ -55,7 +55,7 @@ private: public: GeoJSON_Printer(const std::string& base_path = "."); ~GeoJSON_Printer(); - bool set_headers(std::string filename, bool time_tag_name = true); + bool set_headers(const std::string& filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 1861139be..95495c6c2 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -70,7 +70,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) { gpx_base_path = p.string(); } - if (gpx_base_path.compare(".") != 0) + if (gpx_base_path != ".") { std::cout << "GPX files will be stored at " << gpx_base_path << std::endl; } @@ -79,7 +79,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) } -bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) +bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -134,7 +134,7 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) { DLOG(INFO) << "GPX printer writing on " << filename.c_str(); // Set iostream numeric format and precision - gpx_file.setf(gpx_file.fixed, gpx_file.floatfield); + gpx_file.setf(gpx_file.std::ofstream::fixed, gpx_file.std::ofstream::floatfield); gpx_file << std::setprecision(14); gpx_file << "" << std::endl << "& position, double height; positions_printed = true; - std::shared_ptr position_ = position; + const std::shared_ptr& position_ = position; double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double course_over_ground = position_->get_course_over_ground(); // expressed in deg diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index d4efcf81d..27e9fe4ff 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -57,7 +57,7 @@ private: public: Gpx_Printer(const std::string& base_path = "."); ~Gpx_Printer(); - bool set_headers(std::string filename, bool time_tag_name = true); + bool set_headers(const std::string& filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 2bded706f..5ca6ef597 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -173,7 +173,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do { // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_ephemeris_iter != gps_ephemeris_map.end()) @@ -228,7 +228,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first; } } - if (sig_.compare("2S") == 0) + if (sig_ == "2S") { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index fb742b385..797f45ebb 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -70,7 +70,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) { kml_base_path = p.string(); } - if (kml_base_path.compare(".") != 0) + if (kml_base_path != ".") { std::cout << "KML files will be stored at " << kml_base_path << std::endl; } @@ -87,7 +87,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) } -bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) +bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); @@ -143,10 +143,10 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) { DLOG(INFO) << "KML printer writing on " << filename.c_str(); // Set iostream numeric format and precision - kml_file.setf(kml_file.fixed, kml_file.floatfield); + kml_file.setf(kml_file.std::ofstream::fixed, kml_file.std::ofstream::floatfield); kml_file << std::setprecision(14); - tmp_file.setf(tmp_file.fixed, tmp_file.floatfield); + tmp_file.setf(tmp_file.std::ofstream::fixed, tmp_file.std::ofstream::floatfield); tmp_file << std::setprecision(14); kml_file << "" << std::endl @@ -222,7 +222,7 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, positions_printed = true; - std::shared_ptr position_ = position; + const std::shared_ptr& position_ = position; double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double course_over_ground = position_->get_course_over_ground(); // expressed in deg diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 27225df7a..7909ad619 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -60,7 +60,7 @@ private: public: Kml_Printer(const std::string& base_path = std::string(".")); ~Kml_Printer(); - bool set_headers(std::string filename, bool time_tag_name = true); + bool set_headers(const std::string& filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index 77e2c69a9..9077dcd68 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -44,6 +44,7 @@ Ls_Pvt::Ls_Pvt() : Pvt_Solution() { } + arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) { // BANCROFT Calculation of preliminary coordinates for a GPS receiver based on pseudoranges @@ -233,9 +234,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo //--- Find DOA and range of satellites - double* azim = 0; - double* elev = 0; - double* dist = 0; + double* azim = nullptr; + double* elev = nullptr; + double* dist = nullptr; topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); if (traveltime < 0.1 && nmbOfSatellites > 3) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 7253b9f79..b1e7079f3 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -48,7 +48,7 @@ using google::LogMessage; -Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path) +Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path) { nmea_base_path = base_path; d_flag_nmea_output_file = flag_nmea_output_file; @@ -79,7 +79,7 @@ Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, boo nmea_base_path = p.string(); } - if ((nmea_base_path.compare(".") != 0) and (d_flag_nmea_output_file == true)) + if ((nmea_base_path != ".") and (d_flag_nmea_output_file == true)) { std::cout << "NMEA files will be stored at " << nmea_base_path << std::endl; } @@ -99,7 +99,7 @@ Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, boo } } - nmea_devname = nmea_dump_devname; + nmea_devname = std::move(nmea_dump_devname); if (flag_nmea_tty_port == true) { nmea_dev_descriptor = init_serial(nmea_devname.c_str()); @@ -126,20 +126,20 @@ Nmea_Printer::~Nmea_Printer() } -int Nmea_Printer::init_serial(std::string serial_device) +int Nmea_Printer::init_serial(const std::string& serial_device) { /*! * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) */ int fd = 0; - struct termios options; + struct termios options = {}; int64_t BAUD; int64_t DATABITS; int64_t STOPBITS; int64_t PARITYON; int64_t PARITY; - fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY); + fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC); if (fd == -1) return fd; // failed to open TTY port if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index b2f961756..c73ef91ff 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -53,12 +53,12 @@ public: /*! * \brief Default constructor. */ - Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_filename, const std::string& base_path = "."); + Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path = "."); /*! * \brief Print NMEA PVT and satellite info to the initialized device */ - bool Print_Nmea_Line(const std::shared_ptr& position, bool print_average_values); + bool Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values); /*! * \brief Default destructor. @@ -72,7 +72,7 @@ private: std::string nmea_devname; int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) std::shared_ptr d_PVT_data; - int init_serial(std::string serial_device); //serial port control + int init_serial(const std::string& serial_device); //serial port control void close_serial(); std::string get_GPGGA(); // fix data std::string get_GPGSV(); // satellite data diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 6071f38b0..b1366a751 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -188,7 +188,7 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb double b; double rtop; - while (1) + while (true) { rtop = pow((a_e + htop), 2) - pow((a_e + hsta_km), 2) * (1 - pow(sinel, 2)); diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 88c001e2b..73d8af555 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -78,7 +78,7 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) { base_rinex_path = p.string(); } - if (base_rinex_path.compare(".") != 0) + if (base_rinex_path != ".") { std::cout << "RINEX files will be stored at " << base_rinex_path << std::endl; } @@ -366,7 +366,7 @@ std::string Rinex_Printer::getLocalTime() if (version == 2) { int32_t day = pt_tm.tm_mday; - line += Rinex_Printer::rightJustify(boost::lexical_cast(day), 2); + line += Rinex_Printer::rightJustify(std::to_string(day), 2); line += std::string("-"); std::map months; @@ -385,7 +385,7 @@ std::string Rinex_Printer::getLocalTime() line += months[pt_tm.tm_mon]; line += std::string("-"); - line += boost::lexical_cast(pt_tm.tm_year - 100); + line += std::to_string(pt_tm.tm_year - 100); line += std::string(1, ' '); line += strmHour.str(); line += std::string(":"); @@ -468,8 +468,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -481,8 +481,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -589,8 +589,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -602,8 +602,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -614,8 +614,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -624,10 +624,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -713,8 +713,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -726,8 +726,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -738,8 +738,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -748,10 +748,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -839,8 +839,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -852,8 +852,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(1, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 17); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -862,10 +862,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLS_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_LSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.DN_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLS_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_LSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.DN_6), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -946,8 +946,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -958,8 +958,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string("GPGA"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_0G_10, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t_0G_10), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_0G_10), 5); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.t_0G_10), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -968,10 +968,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLS_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_LSF_6), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.DN_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLS_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_LSF_6), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.DN_6), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1064,8 +1064,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 /* if ( SBAS ) { line += string(1, ' '); @@ -1084,10 +1084,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1194,8 +1194,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1206,8 +1206,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1216,10 +1216,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1354,8 +1354,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string(3, ' '); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019 line += std::string(1, ' '); line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); } @@ -1365,8 +1365,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 /* if ( SBAS ) { line += string(1, ' '); @@ -1386,16 +1386,16 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); if (version == 2) { line += std::string(54, ' '); } if (version == 3) { - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); } line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); @@ -1490,8 +1490,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GAUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1502,8 +1502,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GPGA"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t_0G_10), 7); + line += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1514,8 +1514,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("GPUT"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1524,10 +1524,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); @@ -1678,8 +1678,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1689,8 +1689,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ line_aux += std::string("GLGP"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1763,8 +1763,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1774,18 +1774,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GPGA"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_0G_10, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLS_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_LSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.DN_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLS_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.Delta_tLSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.WN_LSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.DN_6), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -1869,15 +1869,15 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut line_aux += std::string(3, ' '); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 9); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 9); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019 line_aux += std::string(1, ' '); line_aux += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line_aux += std::string(54, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -1924,18 +1924,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2020,18 +2020,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2128,8 +2128,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2139,8 +2139,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GPGA"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2150,18 +2150,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2257,8 +2257,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2268,8 +2268,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2279,18 +2279,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GPGA"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2365,8 +2365,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2376,8 +2376,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2387,18 +2387,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion line_aux += std::string("GLGP"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2473,8 +2473,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp line_aux += std::string("GPUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_t_OT), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + 1024), 5); // valid until 2019 line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2484,8 +2484,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2495,18 +2495,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp line_aux += std::string("GLGP"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_gps, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(gps_utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2586,8 +2586,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GAUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WNot_6), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2597,18 +2597,18 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal line_aux += std::string("GLUT"); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(glonass_gnav_utc_model.d_tau_c, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(0.0, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(0.0), 5); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 7); + line_aux += Rinex_Printer::rightJustify(std::to_string(0.0), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLS_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_LSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.DN_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLS_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_LSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.DN_6), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -2662,7 +2662,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(gps_ephemeris_iter->second.i_satellite_PRN), 2); + line += Rinex_Printer::rightJustify(std::to_string(gps_ephemeris_iter->second.i_satellite_PRN), 2); line += std::string(1, ' '); std::string year(timestring, 2, 2); line += year; @@ -2735,7 +2735,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(gps_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -2928,7 +2928,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIA")) + if (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIA") { // Block II/IIA (Table 20-XI IS-GPS-200E ) if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; @@ -2939,10 +2939,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_IODC == 757) curve_fit_interval = 98; } - if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR-M") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIF") == 0) || - (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIIA") == 0)) + if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIR") || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIR-M") || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIF") || + (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIIA")) { // Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200E ) if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; @@ -2984,7 +2984,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(gps_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(gps_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -3141,7 +3141,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(galileo_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(galileo_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -3259,11 +3259,11 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(galileo_ephemeris_iter->second.E1B_DVS_5); + std::string E1B_DVS = std::to_string(galileo_ephemeris_iter->second.E1B_DVS_5); if (E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee"; E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID - std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + std::string SVhealth_str = E5B_HS + std::to_string(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + std::to_string(galileo_ephemeris_iter->second.E1B_DVS_5); SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID int32_t SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); @@ -3310,7 +3310,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(glonass_gnav_ephemeris_iter->second.i_satellite_PRN), 2); + line += Rinex_Printer::rightJustify(std::to_string(glonass_gnav_ephemeris_iter->second.i_satellite_PRN), 2); line += std::string(1, ' '); std::string year(timestring, 2, 2); line += year; @@ -3383,7 +3383,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); - line += boost::lexical_cast(glonass_gnav_ephemeris_iter->second.i_satellite_PRN); + line += std::to_string(glonass_gnav_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); line += year; @@ -3809,12 +3809,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(std::to_string(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Frequency Number line += std::string(1, ' '); line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); @@ -4162,12 +4162,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(std::to_string(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Frequency Number line += std::string(1, ' '); line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); @@ -4480,12 +4480,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- GLONASS SLOT / FRQ # // TODO Need to provide system with list of all satellites and update this accordingly line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 3); // Number of satellites in list + line += Rinex_Printer::rightJustify(std::to_string(0), 3); // Number of satellites in list line += std::string(1, ' '); line += satelliteSystem["GLONASS"]; - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Slot Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Slot Number line += std::string(1, ' '); - line += Rinex_Printer::rightJustify(boost::lexical_cast(0), 2); // Frequency Number + line += Rinex_Printer::rightJustify(std::to_string(0), 2); // Frequency Number line += std::string(1, ' '); line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("GLONASS SLOT / FRQ #", 20); @@ -6874,7 +6874,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) // TIME OF FIRST OBS last header annotation might change in the future { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line_aux += std::string(54, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -6895,10 +6895,10 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -6954,10 +6954,10 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -7013,10 +7013,10 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLS_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.Delta_tLSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_LSF_6), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.DN_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLS_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.Delta_tLSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.WN_LSF_6), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(galileo_utc_model.DN_6), 6); line_aux += std::string(36, ' '); line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); data.push_back(line_aux); @@ -7120,14 +7120,14 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); observables_iter++) { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -7224,7 +7224,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -7241,7 +7241,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -7396,15 +7396,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_ == "R") && (sig_ == "1G")) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_ == "R") && (sig_ == "2G")) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7442,7 +7442,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int32_t numGloSatellitesObserved = available_glo_prns.size(); int32_t numGpsSatellitesObserved = observablesG1C.size(); int32_t numSatellitesObserved = numGloSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); if (version == 2) { // Add list of GPS satellites @@ -7452,7 +7452,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { line += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L1 satellites for (observables_iter = observablesR1C.cbegin(); @@ -7461,7 +7461,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L2 satellites for (observables_iter = observablesR2C.cbegin(); @@ -7470,7 +7470,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { line += satelliteSystem["GLONASS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } } line += std::string(80 - line.size(), ' '); @@ -7490,10 +7490,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep if (version == 3) { // Specify system only if in version 3 - if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s == "G") lineObs += satelliteSystem["GPS"]; + if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); } // Pseudorange Measurements @@ -7555,7 +7555,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += satelliteSystem["GLONASS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); } ret = total_glo_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) @@ -7670,15 +7670,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_ == "R") && (sig_ == "1G")) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_ == "R") && (sig_ == "2G")) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7716,7 +7716,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g int32_t numGloSatellitesObserved = available_glo_prns.size(); int32_t numGpsSatellitesObserved = observablesG2S.size(); int32_t numSatellitesObserved = numGloSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -7733,10 +7733,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g s.assign(1, observables_iter->second.System); // Specify system only if in version 3 - if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s == "G") lineObs += satelliteSystem["GPS"]; + if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); // Pseudorange Measurements lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -7795,7 +7795,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_glo_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) @@ -7910,15 +7910,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1G") == 0)) + if ((system_ == "R") && (sig_ == "1G")) { observablesR1C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2G") == 0)) + if ((system_ == "R") && (sig_ == "2G")) { observablesR2C.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -7955,7 +7955,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga int32_t numGloSatellitesObserved = available_glo_prns.size(); int32_t numGalSatellitesObserved = observablesE1B.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGloSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -7973,10 +7973,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs.clear(); s.assign(1, observables_iter->second.System); - if (s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; - if (s.compare("R") == 0) lineObs += satelliteSystem["GLONASS"]; // should not happen + if (s == "E") lineObs += satelliteSystem["Galileo"]; + if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) @@ -8033,7 +8033,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_glo_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -8153,14 +8153,14 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); observables_iter++) { line += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); - line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -8258,7 +8258,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -8275,7 +8275,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -8379,7 +8379,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { numSatellitesObserved++; } - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -8396,7 +8396,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); //GPS L2 PSEUDORANGE lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -8510,12 +8510,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); mmap_iter = total_mmap.find(observables_iter->second.PRN); @@ -8527,7 +8527,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + if ((system_ == "G") && (sig_ == "L5")) { observablesL5.insert(std::pair(observables_iter->first, observables_iter->second)); mmap_iter = total_mmap.find(observables_iter->second.PRN); @@ -8598,7 +8598,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c } int32_t numSatellitesObserved = available_prns.size(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); @@ -8614,7 +8614,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_mmap.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -8725,15 +8725,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -8838,7 +8838,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep } } int32_t numSatellitesObserved = available_prns.size(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); @@ -8854,7 +8854,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -8967,19 +8967,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -9030,7 +9030,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int32_t numGalSatellitesObserved = available_gal_prns.size(); int32_t numGpsSatellitesObserved = observablesG1C.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -9048,10 +9048,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); s.assign(1, observables_iter->second.System); - if (s.compare("G") == 0) lineObs += satelliteSystem["GPS"]; - if (s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; // should not happen + if (s == "G") lineObs += satelliteSystem["GPS"]; + if (s == "E") lineObs += satelliteSystem["Galileo"]; // should not happen if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(observables_iter->second.PRN)); + lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); //Loss of lock indicator (LLI) @@ -9108,7 +9108,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9222,23 +9222,23 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + if ((system_ == "G") && (sig_ == "L5")) { observablesGL5.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -9317,7 +9317,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e int32_t numGalSatellitesObserved = available_gal_prns.size(); int32_t numGpsSatellitesObserved = available_gps_prns.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -9337,7 +9337,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gps_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9396,7 +9396,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9514,27 +9514,27 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + if ((system_ == "E") && (sig_ == "1B")) { observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + if ((system_ == "E") && (sig_ == "5X")) { observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + if ((system_ == "E") && (sig_ == "7X")) { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + if ((system_ == "G") && (sig_ == "L5")) { observablesGL5.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -9626,7 +9626,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep int32_t numGalSatellitesObserved = available_gal_prns.size(); int32_t numGpsSatellitesObserved = available_gps_prns.size(); int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; - line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) //line += rightJustify(asString(clockOffset, 12), 15); @@ -9646,7 +9646,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); lineObs += satelliteSystem["GPS"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gps_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { @@ -9705,7 +9705,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); lineObs += satelliteSystem["Galileo"]; if (static_cast(*it) < 10) lineObs += std::string(1, '0'); - lineObs += boost::lexical_cast(static_cast(*it)); + lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) { diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 400132e0c..40934e833 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -77,7 +77,7 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool { rtcm_base_path = p.string(); } - if (rtcm_base_path.compare(".") != 0) + if (rtcm_base_path != ".") { std::cout << "RTCM binary file will be stored at " << rtcm_base_path << std::endl; } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 1481dea0e..76b8d7ada 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -63,7 +63,7 @@ using google::LogMessage; -rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t &rtk) +rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk) { // init empty ephemeris for all the available GNSS channels d_nchannels = nchannels; @@ -473,11 +473,11 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ case 'G': { std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { band1 = true; } - if (sig_.compare("2S") == 0) + if (sig_ == "2S") { band2 = true; } @@ -500,7 +500,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ { std::string sig_(gnss_observables_iter->second.Signal); // Galileo E1 - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -523,7 +523,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } // Galileo E5 - if (sig_.compare("5X") == 0) + if (sig_ == "5X") { // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -571,7 +571,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ // GPS L1 // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_ephemeris_iter != gps_ephemeris_map.cend()) @@ -592,7 +592,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } // GPS L2 (todo: solve NAV/CNAV clash) - if ((sig_.compare("2S") == 0) and (gps_dual_band == false)) + if ((sig_ == "2S") and (gps_dual_band == false)) { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) @@ -641,7 +641,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } // GPS L5 - if (sig_.compare("L5") == 0) + if (sig_ == "L5") { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) @@ -693,7 +693,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ { std::string sig_(gnss_observables_iter->second.Signal); // GLONASS GNAV L1 - if (sig_.compare("1G") == 0) + if (sig_ == "1G") { // 1 Glo - find the ephemeris for the current GLONASS SV observation. The SV Slot Number (PRN ID) is the map key glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -715,7 +715,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } // GLONASS GNAV L2 - if (sig_.compare("2G") == 0) + if (sig_ == "2G") { // 1 GLONASS - find the ephemeris for the current GLONASS SV observation. The SV PRN ID is the map key glonass_gnav_ephemeris_iter = glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 293c0e06d..8651432ca 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -87,7 +87,7 @@ private: public: sol_t pvt_sol; ssat_t pvt_ssat[MAXSAT]; - rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); + rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk); ~rtklib_solver(); bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 0c451be34..442f1f85c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,12 +39,14 @@ using google::LogMessage; -void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() -{ -} + GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +57,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -86,7 +87,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_, @@ -107,7 +108,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -125,10 +126,15 @@ GalileoE1Pcps8msAmbiguousAcquisition::~GalileoE1Pcps8msAmbiguousAcquisition() } +void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -137,7 +143,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -152,7 +158,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -163,7 +169,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -173,7 +179,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -184,7 +190,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -193,7 +199,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1Pcps8msAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -213,10 +219,10 @@ void GalileoE1Pcps8msAmbiguousAcquisition::init() void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -238,7 +244,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() void GalileoE1Pcps8msAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -267,7 +273,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -276,7 +282,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block) void GalileoE1Pcps8msAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index d64c0f28b..59cd5c649 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -48,7 +48,8 @@ class GalileoE1Pcps8msAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1Pcps8msAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1Pcps8msAmbiguousAcquisition(); @@ -144,7 +145,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 7efab9681..a9cf7d51a 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -35,20 +35,20 @@ #include "Galileo_E1.h" #include "gnss_sdr_flags.h" #include "acq_conf.h" -#include #include #include using google::LogMessage; -void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters; configuration_ = configuration; @@ -59,7 +59,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -128,7 +128,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -146,6 +146,11 @@ GalileoE1PcpsAmbiguousAcquisition::~GalileoE1PcpsAmbiguousAcquisition() } +void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -155,7 +160,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -214,7 +219,7 @@ void GalileoE1PcpsAmbiguousAcquisition::init() void GalileoE1PcpsAmbiguousAcquisition::set_local_code() { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -277,15 +282,15 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -302,15 +307,15 @@ void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -325,15 +330,15 @@ void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index 657f03064..4f4a3c657 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -51,7 +51,8 @@ class GalileoE1PcpsAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsAmbiguousAcquisition(); @@ -154,7 +155,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 041039147..90fd0f911 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -41,13 +41,14 @@ using google::LogMessage; -void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() -{ -} GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //printf("top acq constructor start\n"); pcpsconf_fpga_t acq_parameters; @@ -59,8 +60,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in; //if_ = configuration_->property(role + ".if", 0); //acq_parameters.freq = if_; @@ -296,7 +297,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( channel_ = 0; //threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; //printf("top acq constructor end\n"); } @@ -310,6 +311,11 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::~GalileoE1PcpsAmbiguousAcquisitionFpga() } +void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() +{ +} + + void GalileoE1PcpsAmbiguousAcquisitionFpga::set_channel(unsigned int channel) { //printf("top acq set channel start\n"); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h index ebb326337..8ea13f0e4 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h @@ -52,7 +52,8 @@ class GalileoE1PcpsAmbiguousAcquisitionFpga : public AcquisitionInterface { public: GalileoE1PcpsAmbiguousAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsAmbiguousAcquisitionFpga(); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 46a3b1974..809924e89 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,13 +39,14 @@ using google::LogMessage; -void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +56,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -88,7 +88,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition code_data_ = new gr_complex[vector_length_]; code_pilot_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_, @@ -109,7 +109,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -128,10 +128,15 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::~GalileoE1PcpsCccwsrAmbiguousAcquisitio } +void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -140,7 +145,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) { - // float pfa = configuration_->property(role_+ boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_+ std::to_string(channel_) + ".pfa", 0.0); // if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0); @@ -157,7 +162,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -168,7 +173,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppl { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -178,7 +183,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppl void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -188,7 +193,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -197,7 +202,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -217,10 +222,10 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::init() void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); char signal[3]; @@ -241,7 +246,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code() void GalileoE1PcpsCccwsrAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -264,7 +269,7 @@ float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -273,7 +278,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_blo void GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index 47c19becb..9fde5d723 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -48,7 +48,8 @@ class GalileoE1PcpsCccwsrAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsCccwsrAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition(); @@ -145,7 +146,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_data_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index 36ed925df..574f86b21 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,13 +39,14 @@ using google::LogMessage; -void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,7 +57,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -119,7 +119,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui << ", Folding factor: " << folding_factor_ << ", Sampled ms: " << sampled_ms_ << ", Code Length: " << code_length_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, @@ -142,7 +142,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -160,10 +160,15 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::~GalileoE1PcpsQuickSyncAmbiguousAcqu } +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -172,7 +177,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channe void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -187,7 +192,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -198,7 +203,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int do { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -208,7 +213,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int do void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -218,7 +223,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -228,7 +233,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1PcpsQuickSyncAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -248,10 +253,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::init() void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -269,14 +274,14 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() acquisition_cc_->set_local_code(code_); delete[] code; - code = NULL; + code = nullptr; } } void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -284,7 +289,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset() void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_state(state); } @@ -314,7 +319,7 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -323,7 +328,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 1d7b25880..844856260 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -49,7 +49,8 @@ class GalileoE1PcpsQuickSyncAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsQuickSyncAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition(); @@ -150,7 +151,7 @@ private: unsigned int sampled_ms_; unsigned int max_dwells_; unsigned int folding_factor_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 4d7038364..06d606d50 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -30,7 +30,6 @@ */ #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" -#include #include #include #include "galileo_e1_signal_processing.h" @@ -40,13 +39,14 @@ using google::LogMessage; -void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() -{ -} GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,7 +57,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -90,7 +90,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, @@ -112,7 +112,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -130,10 +130,15 @@ GalileoE1PcpsTongAmbiguousAcquisition::~GalileoE1PcpsTongAmbiguousAcquisition() } +void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() +{ +} + + void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -142,7 +147,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -157,7 +162,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -168,7 +173,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -178,7 +183,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -189,7 +194,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -198,7 +203,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro( signed int GalileoE1PcpsTongAmbiguousAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -218,10 +223,10 @@ void GalileoE1PcpsTongAmbiguousAcquisition::init() void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { bool cboc = configuration_->property( - "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + "Acquisition" + std::to_string(channel_) + ".cboc", false); std::complex* code = new std::complex[code_length_]; @@ -243,7 +248,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() void GalileoE1PcpsTongAmbiguousAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -278,7 +283,7 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -287,7 +292,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block void GalileoE1PcpsTongAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index 8524fc8d1..8e56c4044 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -48,7 +48,8 @@ class GalileoE1PcpsTongAmbiguousAcquisition : public AcquisitionInterface { public: GalileoE1PcpsTongAmbiguousAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE1PcpsTongAmbiguousAcquisition(); @@ -149,7 +150,7 @@ private: unsigned int tong_init_val_; unsigned int tong_max_val_; unsigned int tong_max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index e24970d63..fd6f24e32 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -36,7 +36,6 @@ */ #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include #include #include #include "galileo_e5_signal_processing.h" @@ -46,13 +45,14 @@ using google::LogMessage; -void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() -{ -} GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -62,7 +62,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); @@ -101,7 +101,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( { both_signal_components = true; } - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_, @@ -117,7 +117,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,10 +136,15 @@ GalileoE5aNoncoherentIQAcquisitionCaf::~GalileoE5aNoncoherentIQAcquisitionCaf() } +void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() +{ +} + + void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -148,7 +153,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); @@ -163,7 +168,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -174,7 +179,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_max(unsigned int doppler { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -184,7 +189,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_max(unsigned int doppler void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -195,7 +200,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -204,7 +209,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro( signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -224,7 +229,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::init() void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* codeI = new std::complex[code_length_]; std::complex* codeQ = new std::complex[code_length_]; @@ -281,7 +286,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() void GalileoE5aNoncoherentIQAcquisitionCaf::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 6beed3472..4175a0741 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -49,7 +49,8 @@ class GalileoE5aNoncoherentIQAcquisitionCaf : public AcquisitionInterface { public: GalileoE5aNoncoherentIQAcquisitionCaf(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE5aNoncoherentIQAcquisitionCaf(); @@ -150,7 +151,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; int Zero_padding; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 2bd081e3e..3177705ae 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -34,7 +34,6 @@ #include "Galileo_E5a.h" #include "gnss_sdr_flags.h" #include "acq_conf.h" -#include #include #include #include @@ -42,12 +41,13 @@ using google::LogMessage; -void GalileoE5aPcpsAcquisition::stop_acquisition() -{ -} GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -58,7 +58,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -91,11 +91,11 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -118,7 +118,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,6 +136,11 @@ GalileoE5aPcpsAcquisition::~GalileoE5aPcpsAcquisition() } +void GalileoE5aPcpsAcquisition::stop_acquisition() +{ +} + + void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -145,7 +150,7 @@ void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) void GalileoE5aPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -264,11 +269,11 @@ void GalileoE5aPcpsAcquisition::set_state(int state) void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute__((unused))) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } @@ -281,11 +286,11 @@ void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute void GalileoE5aPcpsAcquisition::disconnect(gr::top_block_sptr top_block __attribute__((unused))) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 49099cd42..063c79ff2 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -43,7 +43,8 @@ class GalileoE5aPcpsAcquisition : public AcquisitionInterface { public: GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE5aPcpsAcquisition(); @@ -157,7 +158,7 @@ private: unsigned int in_streams_; unsigned int out_streams_; - long fs_in_; + int64_t fs_in_; float threshold_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 30f2195b9..ef99a0fe7 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -33,7 +33,6 @@ #include "galileo_e5_signal_processing.h" #include "Galileo_E5a.h" #include "gnss_sdr_flags.h" -#include #include #include #include @@ -41,12 +40,13 @@ using google::LogMessage; -void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() -{ -} GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //printf("creating the E5A acquisition"); pcpsconf_fpga_t acq_parameters; @@ -58,8 +58,8 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf //item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in; //acq_parameters.freq = 0; @@ -209,7 +209,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf channel_ = 0; //threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; //printf("creating the E5A acquisition end"); } @@ -221,6 +221,11 @@ GalileoE5aPcpsAcquisitionFpga::~GalileoE5aPcpsAcquisitionFpga() } +void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; @@ -231,7 +236,7 @@ void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold) { - // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); // // if (pfa == 0.0) // { diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h index 94b768438..91788c733 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -45,7 +45,8 @@ class GalileoE5aPcpsAcquisitionFpga : public AcquisitionInterface { public: GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GalileoE5aPcpsAcquisitionFpga(); @@ -160,7 +161,7 @@ private: unsigned int in_streams_; unsigned int out_streams_; - long fs_in_; + int64_t fs_in_; float threshold_; diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 5b3d1c531..a2448a81e 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GlonassL1CaPcpsAcquisition::stop_acquisition() -{ -} GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -60,7 +61,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GLONASS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -94,7 +95,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -114,7 +115,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -123,7 +124,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -141,6 +142,11 @@ GlonassL1CaPcpsAcquisition::~GlonassL1CaPcpsAcquisition() } +void GlonassL1CaPcpsAcquisition::stop_acquisition() +{ +} + + void GlonassL1CaPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -261,15 +267,15 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa) void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -284,15 +290,15 @@ void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -309,15 +315,15 @@ void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 1b519f91e..3c0c14ab1 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -51,7 +51,8 @@ class GlonassL1CaPcpsAcquisition : public AcquisitionInterface { public: GlonassL1CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GlonassL1CaPcpsAcquisition(); @@ -153,7 +154,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index 06ef7aae6..208989dee 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -42,13 +42,14 @@ using google::LogMessage; -void GlonassL2CaPcpsAcquisition::stop_acquisition() -{ -} GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -59,7 +60,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GLONASS_L2_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -93,7 +94,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -113,7 +114,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -122,7 +123,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -140,6 +141,11 @@ GlonassL2CaPcpsAcquisition::~GlonassL2CaPcpsAcquisition() } +void GlonassL2CaPcpsAcquisition::stop_acquisition() +{ +} + + void GlonassL2CaPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -260,15 +266,15 @@ float GlonassL2CaPcpsAcquisition::calculate_threshold(float pfa) void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -285,15 +291,15 @@ void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -308,15 +314,15 @@ void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index b679f4c26..3c093c5cd 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -50,7 +50,8 @@ class GlonassL2CaPcpsAcquisition : public AcquisitionInterface { public: GlonassL2CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GlonassL2CaPcpsAcquisition(); @@ -152,7 +153,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 30d7aa42d..7787b34cb 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -45,13 +45,14 @@ using google::LogMessage; -void GpsL1CaPcpsAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -61,7 +62,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -95,7 +96,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -109,7 +110,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -118,7 +119,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,6 +137,11 @@ GpsL1CaPcpsAcquisition::~GpsL1CaPcpsAcquisition() } +void GpsL1CaPcpsAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -249,15 +255,15 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -274,15 +280,15 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -297,15 +303,15 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 011bb96bf..5aee6bc7a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -55,7 +55,8 @@ class GpsL1CaPcpsAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisition(); @@ -157,7 +158,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index dd69ed24f..eacd4b6a6 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -42,13 +42,14 @@ using google::LogMessage; -void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() -{ -} GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -57,7 +58,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( Acq_Conf acq_parameters = Acq_Conf(); item_type_ = configuration->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); @@ -80,7 +81,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( acq_parameters.samples_per_ms = vector_length_; code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters); @@ -94,7 +95,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -112,6 +113,11 @@ GpsL1CaPcpsAcquisitionFineDoppler::~GpsL1CaPcpsAcquisitionFineDoppler() } +void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() +{ +} + + void GpsL1CaPcpsAcquisitionFineDoppler::set_channel(unsigned int channel) { channel_ = channel; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index 338ea683a..4a4bb9a19 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -49,7 +49,8 @@ class GpsL1CaPcpsAcquisitionFineDoppler : public AcquisitionInterface { public: GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisitionFineDoppler(); @@ -142,7 +143,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index f9778bfb8..f46b7c305 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -48,13 +48,14 @@ using google::LogMessage; -void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() -{ -} GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { pcpsconf_fpga_t acq_parameters; configuration_ = configuration; @@ -62,8 +63,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( DLOG(INFO) << "role " << role; - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); //fs_in = fs_in/2.0; // downampling filter //printf("####### DEBUG Acq: fs_in = %d\n", fs_in); acq_parameters.fs_in = fs_in; @@ -173,7 +174,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; } @@ -183,6 +184,11 @@ GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga() } +void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 8f6d1f3ff..4d0d7339f 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -53,7 +53,8 @@ class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAcquisitionFpga(); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index da1377ac2..993c77e36 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -42,13 +42,14 @@ using google::LogMessage; -void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./data/acquisition.dat"; @@ -56,7 +57,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -71,7 +72,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_, @@ -87,7 +88,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -105,6 +106,11 @@ GpsL1CaPcpsAssistedAcquisition::~GpsL1CaPcpsAssistedAcquisition() } +void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsAssistedAcquisition::set_channel(unsigned int channel) { channel_ = channel; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index ca650bc77..1f6094b6d 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -49,7 +49,8 @@ class GpsL1CaPcpsAssistedAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsAssistedAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsAssistedAcquisition(); @@ -140,7 +141,7 @@ private: int doppler_min_; unsigned int sampled_ms_; int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 1037a1778..494f8d543 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -40,13 +40,14 @@ using google::LogMessage; -void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -57,7 +58,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -85,7 +86,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, @@ -106,7 +107,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -124,10 +125,15 @@ GpsL1CaPcpsOpenClAcquisition::~GpsL1CaPcpsOpenClAcquisition() } +void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -136,7 +142,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -153,7 +159,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -163,7 +169,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -173,7 +179,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -183,7 +189,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step) void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -192,7 +198,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) signed int GpsL1CaPcpsOpenClAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -212,7 +218,7 @@ void GpsL1CaPcpsOpenClAcquisition::init() void GpsL1CaPcpsOpenClAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* code = new std::complex[code_length_]; @@ -233,7 +239,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code() void GpsL1CaPcpsOpenClAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -265,7 +271,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -274,7 +280,7 @@ void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsOpenClAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 0c6c21f49..60c78b2e0 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -48,7 +48,8 @@ class GpsL1CaPcpsOpenClAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsOpenClAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsOpenClAcquisition(); @@ -144,7 +145,7 @@ private: unsigned int doppler_step_; unsigned int sampled_ms_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index 888d44586..2abe0c8ea 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -41,13 +41,14 @@ using google::LogMessage; -void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +57,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( DLOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -112,7 +113,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( << ", Sampled ms: " << sampled_ms_ << ", Code Length: " << code_length_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_, @@ -135,7 +136,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -153,10 +154,15 @@ GpsL1CaPcpsQuickSyncAcquisition::~GpsL1CaPcpsQuickSyncAcquisition() } +void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -165,9 +171,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + - boost::lexical_cast(channel_) + ".pfa", - 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -184,7 +188,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -194,7 +198,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -204,7 +208,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -214,7 +218,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -223,7 +227,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchr signed int GpsL1CaPcpsQuickSyncAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -243,13 +247,12 @@ void GpsL1CaPcpsQuickSyncAcquisition::init() void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* code = new std::complex[code_length_](); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - for (unsigned int i = 0; i < (sampled_ms_ / folding_factor_); i++) { memcpy(&(code_[i * code_length_]), code, @@ -266,7 +269,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() void GpsL1CaPcpsQuickSyncAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -275,7 +278,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::reset() void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_state(state); } @@ -304,7 +307,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -313,7 +316,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsQuickSyncAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index c35f97370..e18fb1704 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -50,7 +50,8 @@ class GpsL1CaPcpsQuickSyncAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsQuickSyncAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsQuickSyncAcquisition(); @@ -151,7 +152,7 @@ private: unsigned int sampled_ms_; unsigned int max_dwells_; unsigned int folding_factor_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 5c55d802a..5dc2f425b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -40,13 +40,14 @@ using google::LogMessage; -void GpsL1CaPcpsTongAcquisition::stop_acquisition() -{ -} GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -56,7 +57,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); @@ -76,7 +77,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_, @@ -97,7 +98,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -115,10 +116,15 @@ GpsL1CaPcpsTongAcquisition::~GpsL1CaPcpsTongAcquisition() } +void GpsL1CaPcpsTongAcquisition::stop_acquisition() +{ +} + + void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) { channel_ = channel; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_channel(channel_); } @@ -127,7 +133,7 @@ void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -144,7 +150,7 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_threshold(threshold_); } @@ -154,7 +160,7 @@ void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) void GpsL1CaPcpsTongAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_max(doppler_max_); } @@ -164,7 +170,7 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_doppler_step(doppler_step_); } @@ -174,7 +180,7 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step) void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_gnss_synchro(gnss_synchro_); } @@ -183,7 +189,7 @@ void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) signed int GpsL1CaPcpsTongAcquisition::mag() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_cc_->mag(); } @@ -202,7 +208,7 @@ void GpsL1CaPcpsTongAcquisition::init() void GpsL1CaPcpsTongAcquisition::set_local_code() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { std::complex* code = new std::complex[code_length_]; @@ -223,7 +229,7 @@ void GpsL1CaPcpsTongAcquisition::set_local_code() void GpsL1CaPcpsTongAcquisition::reset() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_active(true); } @@ -232,7 +238,7 @@ void GpsL1CaPcpsTongAcquisition::reset() void GpsL1CaPcpsTongAcquisition::set_state(int state) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { acquisition_cc_->set_state(state); } @@ -263,7 +269,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); } @@ -272,7 +278,7 @@ void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsTongAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index 562d63e39..76cf2b8e0 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -49,7 +49,8 @@ class GpsL1CaPcpsTongAcquisition : public AcquisitionInterface { public: GpsL1CaPcpsTongAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL1CaPcpsTongAcquisition(); @@ -150,7 +151,7 @@ private: unsigned int tong_init_val_; unsigned int tong_max_val_; unsigned int tong_max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; std::string dump_filename_; std::complex* code_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 32b426777..1e4560388 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL2MPcpsAcquisition::stop_acquisition() -{ -} GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -61,7 +62,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); //float pfa = configuration_->property(role + ".pfa", 0.0); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -97,7 +98,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -116,7 +117,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -125,7 +126,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; num_codes_ = acq_parameters.sampled_ms / acq_parameters.ms_per_code; if (in_streams_ > 1) { @@ -144,6 +145,11 @@ GpsL2MPcpsAcquisition::~GpsL2MPcpsAcquisition() } +void GpsL2MPcpsAcquisition::stop_acquisition() +{ +} + + void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -153,7 +159,7 @@ void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) void GpsL2MPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -263,15 +269,15 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -288,15 +294,15 @@ void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -311,15 +317,15 @@ void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 27c463cf3..4a0c96c60 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -53,7 +53,8 @@ class GpsL2MPcpsAcquisition : public AcquisitionInterface { public: GpsL2MPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL2MPcpsAcquisition(); @@ -154,7 +155,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index db53d3815..1b1315d2a 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL2MPcpsAcquisitionFpga::stop_acquisition() -{ -} GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //pcpsconf_t acq_parameters; pcpsconf_fpga_t acq_parameters; @@ -62,7 +63,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( item_type_ = configuration_->property(role + ".item_type", default_item_type); //float pfa = configuration_->property(role + ".pfa", 0.0); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; //if_ = configuration_->property(role + ".if", 0); @@ -153,7 +154,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; // vector_length_ = code_length_; @@ -206,6 +207,11 @@ GpsL2MPcpsAcquisitionFpga::~GpsL2MPcpsAcquisitionFpga() } +void GpsL2MPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; @@ -215,7 +221,7 @@ void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold) { - // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); // // if (pfa == 0.0) // { diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h index b9aba8787..7effb0cf6 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h @@ -54,7 +54,8 @@ class GpsL2MPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL2MPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL2MPcpsAcquisitionFpga(); @@ -157,7 +158,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; //long if_; bool dump_; bool blocking_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 36d6e4f7a..6e1de1582 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL5iPcpsAcquisition::stop_acquisition() -{ -} GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; @@ -60,7 +61,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); @@ -89,7 +90,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; - if (item_type_.compare("cshort") == 0) + if (item_type_ == "cshort") { item_size_ = sizeof(lv_16sc_t); } @@ -108,7 +109,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; - if (item_type_.compare("cbyte") == 0) + if (item_type_ == "cbyte") { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); @@ -116,7 +117,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -134,6 +135,11 @@ GpsL5iPcpsAcquisition::~GpsL5iPcpsAcquisition() } +void GpsL5iPcpsAcquisition::stop_acquisition() +{ +} + + void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -143,7 +149,7 @@ void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) void GpsL5iPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); if (pfa == 0.0) { @@ -251,15 +257,15 @@ float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to connect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to connect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { // Since a byte-based acq implementation is not available, // we just convert cshorts to gr_complex @@ -276,15 +282,15 @@ void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { // nothing to disconnect } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { // nothing to disconnect } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); @@ -299,15 +305,15 @@ void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() { - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { return acquisition_; } - else if (item_type_.compare("cshort") == 0) + else if (item_type_ == "cshort") { return acquisition_; } - else if (item_type_.compare("cbyte") == 0) + else if (item_type_ == "cbyte") { return cbyte_to_float_x2_; } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 3c4d2ad46..c9f1cd95d 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -53,7 +53,8 @@ class GpsL5iPcpsAcquisition : public AcquisitionInterface { public: GpsL5iPcpsAcquisition(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL5iPcpsAcquisition(); @@ -154,7 +155,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index 124999dc9..8e6930ebc 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -43,13 +43,14 @@ using google::LogMessage; -void GpsL5iPcpsAcquisitionFpga::stop_acquisition() -{ -} GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { //printf("L5 ACQ CLASS CREATED\n"); pcpsconf_fpga_t acq_parameters; @@ -61,8 +62,8 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( //item_type_ = configuration_->property(role + ".item_type", default_item_type); - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); - long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in; //if_ = configuration_->property(role + ".if", 0); //acq_parameters.freq = if_; @@ -207,7 +208,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( channel_ = 0; // threshold_ = 0.0; doppler_step_ = 0; - gnss_synchro_ = 0; + gnss_synchro_ = nullptr; //printf("L5 ACQ CLASS FINISHED\n"); } @@ -219,6 +220,11 @@ GpsL5iPcpsAcquisitionFpga::~GpsL5iPcpsAcquisitionFpga() } +void GpsL5iPcpsAcquisitionFpga::stop_acquisition() +{ +} + + void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; @@ -228,7 +234,7 @@ void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold) { - // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); // // if (pfa == 0.0) // { diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h index af916d3d5..571f01193 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -54,7 +54,8 @@ class GpsL5iPcpsAcquisitionFpga : public AcquisitionInterface { public: GpsL5iPcpsAcquisitionFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + const std::string& role, + unsigned int in_streams, unsigned int out_streams); virtual ~GpsL5iPcpsAcquisitionFpga(); @@ -157,7 +158,7 @@ private: unsigned int doppler_max_; unsigned int doppler_step_; unsigned int max_dwells_; - long fs_in_; + int64_t fs_in_; //long if_; bool dump_; bool blocking_; diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 8e4a3120d..a3d6c9bf3 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -32,7 +32,6 @@ #include "channel.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include #include #include @@ -44,14 +43,14 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr trk, std::shared_ptr nav, std::string role, std::string implementation, gr::msg_queue::sptr queue) { - pass_through_ = pass_through; - acq_ = acq; - trk_ = trk; - nav_ = nav; - role_ = role; - implementation_ = implementation; + pass_through_ = std::move(pass_through); + acq_ = std::move(acq); + trk_ = std::move(trk); + nav_ = std::move(nav); + role_ = std::move(role); + implementation_ = std::move(implementation); channel_ = channel; - queue_ = queue; + queue_ = std::move(queue); channel_fsm_ = std::make_shared(); flag_enable_fpga = configuration->property("Channel.enable_FPGA", false); @@ -59,6 +58,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, trk_->set_channel(channel_); nav_->set_channel(channel_); + gnss_synchro_ = Gnss_Synchro(); gnss_synchro_.Channel_ID = channel_; acq_->set_gnss_synchro(&gnss_synchro_); trk_->set_gnss_synchro(&gnss_synchro_); @@ -76,21 +76,21 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, // IMPORTANT: Do not change the order between set_doppler_step and set_threshold - uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step", 0); + uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0); if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); if (FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; acq_->set_doppler_step(doppler_step); - float threshold = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".threshold", 0.0); + float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0); if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); acq_->set_threshold(threshold); acq_->init(); - repeat_ = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".repeat_satellite", false); + repeat_ = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".repeat_satellite", false); DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_; channel_fsm_->set_acquisition(acq_); @@ -107,7 +107,9 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, // Destructor -Channel::~Channel() {} +Channel::~Channel() = default; + + void Channel::connect(gr::top_block_sptr top_block) { if (connected_) diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 14a4e6b12..ad6ed9e3a 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -44,7 +44,7 @@ ChannelFsm::ChannelFsm() } -ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_(acquisition) +ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_(std::move(acquisition)) { trk_ = nullptr; channel_ = 0U; @@ -162,21 +162,21 @@ bool ChannelFsm::Event_failed_tracking_standby() void ChannelFsm::set_acquisition(std::shared_ptr acquisition) { std::lock_guard lk(mx); - acq_ = acquisition; + acq_ = std::move(acquisition); } void ChannelFsm::set_tracking(std::shared_ptr tracking) { std::lock_guard lk(mx); - trk_ = tracking; + trk_ = std::move(tracking); } void ChannelFsm::set_queue(gr::msg_queue::sptr queue) { std::lock_guard lk(mx); - queue_ = queue; + queue_ = std::move(queue); } diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index f77f8c883..d1f967445 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -40,7 +40,7 @@ using google::LogMessage; channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) { - return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat)); + return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(std::move(channel_fsm), repeat)); } @@ -49,7 +49,7 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg) bool result = false; try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); switch (message) { case 1: // positive acquisition @@ -89,9 +89,9 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr cha this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1)); - d_channel_fsm = channel_fsm; + d_channel_fsm = std::move(channel_fsm); d_repeat = repeat; } -channel_msg_receiver_cc::~channel_msg_receiver_cc() {} +channel_msg_receiver_cc::~channel_msg_receiver_cc() = default; diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index 78a08500c..256e73952 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -44,8 +44,13 @@ using google::LogMessage; TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, + unsigned int in_streams, + unsigned int out_streams, + boost::shared_ptr queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams), + queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -56,8 +61,8 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; + if (FLAGS_s != "-") filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); @@ -65,7 +70,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); - if (item_type_.compare("byte") == 0) + if (item_type_ == "byte") { item_size_ = sizeof(char); } @@ -177,9 +182,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con } -TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource() -{ -} +TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource() = default; void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index c0f58687e..0088e1287 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -54,8 +55,10 @@ class ConfigurationInterface; class TwoBitCpxFileSignalSource : public GNSSBlockInterface { public: - TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, + TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, + unsigned int out_streams, boost::shared_ptr queue); virtual ~TwoBitCpxFileSignalSource(); @@ -97,19 +100,19 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } private: - unsigned long long samples_; - long sampling_frequency_; + uint64_t samples_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index cdde62a3b..dc46291c5 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -46,8 +46,13 @@ using google::LogMessage; TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, + unsigned int in_streams, + unsigned int out_streams, + boost::shared_ptr queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams), + queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -55,13 +60,13 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac std::string default_sample_type = "real"; double default_seconds_to_skip = 0.0; - samples_ = configuration->property(role + ".samples", 0L); + samples_ = configuration->property(role + ".samples", 0); sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source.compare("-") != 0) filename_ = FLAGS_signal_source; - if (FLAGS_s.compare("-") != 0) filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; + if (FLAGS_s != "-") filename_ = FLAGS_s; item_type_ = configuration->property(role + ".item_type", default_item_type); big_endian_items_ = configuration->property(role + ".big_endian_items", true); @@ -72,13 +77,13 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip); - long bytes_to_skip = 0; + int64_t bytes_to_skip = 0; - if (item_type_.compare("byte") == 0) + if (item_type_ == "byte") { item_size_ = sizeof(char); } - else if (item_type_.compare("short") == 0) + else if (item_type_ == "short") { // If we have shorts stored in little endian format, might as // well read them in as bytes. @@ -97,16 +102,16 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac item_size_ = sizeof(char); } - if (sample_type_.compare("real") == 0) + if (sample_type_ == "real") { is_complex_ = false; } - else if (sample_type_.compare("iq") == 0) + else if (sample_type_ == "iq") { is_complex_ = true; reverse_interleaving_ = false; } - else if (sample_type_.compare("qi") == 0) + else if (sample_type_ == "qi") { is_complex_ = true; reverse_interleaving_ = true; @@ -122,7 +127,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac if (seconds_to_skip > 0) { - bytes_to_skip = static_cast( + bytes_to_skip = static_cast( seconds_to_skip * sampling_frequency_ / 4); if (is_complex_) { diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 2a1db00bc..00019ce4c 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -98,12 +99,12 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } @@ -129,8 +130,8 @@ public: } private: - unsigned long long samples_; - long sampling_frequency_; + uint64_t samples_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; diff --git a/src/core/interfaces/configuration_interface.h b/src/core/interfaces/configuration_interface.h index 48e6eefa1..9e1947b79 100644 --- a/src/core/interfaces/configuration_interface.h +++ b/src/core/interfaces/configuration_interface.h @@ -35,6 +35,7 @@ #ifndef GNSS_SDR_CONFIGURATION_INTERFACE_H_ #define GNSS_SDR_CONFIGURATION_INTERFACE_H_ +#include #include /*! @@ -54,10 +55,12 @@ public: virtual ~ConfigurationInterface() {} virtual std::string property(std::string property_name, std::string default_value) = 0; virtual bool property(std::string property_name, bool default_value) = 0; - virtual long property(std::string property_name, long default_value) = 0; - virtual int property(std::string property_name, int default_value) = 0; - virtual unsigned int property(std::string property_name, unsigned int default_value) = 0; - virtual unsigned short property(std::string property_name, unsigned short default_value) = 0; + virtual int64_t property(std::string property_name, int64_t default_value) = 0; + virtual uint64_t property(std::string property_name, uint64_t default_value) = 0; + virtual int32_t property(std::string property_name, int32_t default_value) = 0; + virtual uint32_t property(std::string property_name, uint32_t default_value) = 0; + virtual int16_t property(std::string property_name, int16_t default_value) = 0; + virtual uint16_t property(std::string property_name, uint16_t default_value) = 0; virtual float property(std::string property_name, float default_value) = 0; virtual double property(std::string property_name, double default_value) = 0; virtual void set_property(std::string property_name, std::string value) = 0; diff --git a/src/core/libs/INIReader.cc b/src/core/libs/INIReader.cc index 1a8a63815..1caaae967 100644 --- a/src/core/libs/INIReader.cc +++ b/src/core/libs/INIReader.cc @@ -70,13 +70,13 @@ std::string INIReader::Get(std::string section, std::string name, std::string de } -long INIReader::GetInteger(std::string section, std::string name, long default_value) +int64_t INIReader::GetInteger(std::string section, std::string name, int64_t default_value) { std::string valstr = Get(section, name, ""); const char* value = valstr.c_str(); char* end; // This parses "1234" (decimal) and also "0x4D2" (hex) - long n = strtol(value, &end, 0); + int64_t n = strtol(value, &end, 0); return end > value ? n : default_value; } diff --git a/src/core/libs/INIReader.h b/src/core/libs/INIReader.h index 3e70d819e..0680cb89e 100644 --- a/src/core/libs/INIReader.h +++ b/src/core/libs/INIReader.h @@ -48,6 +48,7 @@ #ifndef __INIREADER_H__ #define __INIREADER_H__ +#include #include #include @@ -69,7 +70,7 @@ public: std::string default_value); //! Get an integer (long) value from INI file, returning default_value if not found. - long GetInteger(std::string section, std::string name, long default_value); + int64_t GetInteger(std::string section, std::string name, int64_t default_value); private: int _error; diff --git a/src/core/libs/string_converter.cc b/src/core/libs/string_converter.cc index 15360400d..7420aad64 100644 --- a/src/core/libs/string_converter.cc +++ b/src/core/libs/string_converter.cc @@ -34,17 +34,19 @@ #include -StringConverter::StringConverter() {} +StringConverter::StringConverter() = default; + + +StringConverter::~StringConverter() = default; -StringConverter::~StringConverter() {} bool StringConverter::convert(const std::string& value, bool default_value) { - if (value.compare("true") == 0) + if (value == "true") { return true; } - else if (value.compare("false") == 0) + else if (value == "false") { return false; } @@ -55,11 +57,11 @@ bool StringConverter::convert(const std::string& value, bool default_value) } -long StringConverter::convert(const std::string& value, long default_value) +int64_t StringConverter::convert(const std::string& value, int64_t default_value) { std::stringstream stream(value); - long result; + int64_t result; stream >> result; if (stream.fail()) @@ -73,7 +75,25 @@ long StringConverter::convert(const std::string& value, long default_value) } -int StringConverter::convert(const std::string& value, int default_value) +uint64_t StringConverter::convert(const std::string& value, uint64_t default_value) +{ + std::stringstream stream(value); + + uint64_t result; + stream >> result; + + if (stream.fail()) + { + return default_value; + } + else + { + return result; + } +} + + +int32_t StringConverter::convert(const std::string& value, int32_t default_value) { std::stringstream stream(value); @@ -91,11 +111,11 @@ int StringConverter::convert(const std::string& value, int default_value) } -unsigned int StringConverter::convert(const std::string& value, unsigned int default_value) +uint32_t StringConverter::convert(const std::string& value, uint32_t default_value) { std::stringstream stream(value); - unsigned int result; + uint32_t result; stream >> result; if (stream.fail()) @@ -109,11 +129,29 @@ unsigned int StringConverter::convert(const std::string& value, unsigned int def } -unsigned short StringConverter::convert(const std::string& value, unsigned short default_value) +uint16_t StringConverter::convert(const std::string& value, uint16_t default_value) { std::stringstream stream(value); - unsigned short result; + uint16_t result; + stream >> result; + + if (stream.fail()) + { + return default_value; + } + else + { + return result; + } +} + + +int16_t StringConverter::convert(const std::string& value, int16_t default_value) +{ + std::stringstream stream(value); + + int16_t result; stream >> result; if (stream.fail()) diff --git a/src/core/libs/string_converter.h b/src/core/libs/string_converter.h index c1a480a78..1514db265 100644 --- a/src/core/libs/string_converter.h +++ b/src/core/libs/string_converter.h @@ -33,6 +33,7 @@ #ifndef GNSS_SDR_STRING_CONVERTER_H_ #define GNSS_SDR_STRING_CONVERTER_H_ +#include #include /*! @@ -46,10 +47,12 @@ public: virtual ~StringConverter(); bool convert(const std::string& value, bool default_value); - long convert(const std::string& value, long default_value); - int convert(const std::string& value, int default_value); - unsigned int convert(const std::string& value, unsigned int default_value); - unsigned short convert(const std::string& value, unsigned short default_value); + int64_t convert(const std::string& value, int64_t default_value); + uint64_t convert(const std::string& value, uint64_t default_value); + int32_t convert(const std::string& value, int32_t default_value); + uint32_t convert(const std::string& value, uint32_t default_value); + int16_t convert(const std::string& value, int16_t default_value); + uint16_t convert(const std::string& value, uint16_t default_value); float convert(const std::string& value, float default_value); double convert(const std::string& value, double default_value); }; diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index d788b52b0..4f3918d8a 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -69,9 +69,7 @@ gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, } -gnss_synchro_monitor::~gnss_synchro_monitor() -{ -} +gnss_synchro_monitor::~gnss_synchro_monitor() = default; int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& input_items, diff --git a/src/core/receiver/control_message_factory.cc b/src/core/receiver/control_message_factory.cc index 2210713c9..d2871d39e 100644 --- a/src/core/receiver/control_message_factory.cc +++ b/src/core/receiver/control_message_factory.cc @@ -35,11 +35,11 @@ using google::LogMessage; // Constructor -ControlMessageFactory::ControlMessageFactory() {} +ControlMessageFactory::ControlMessageFactory() = default; // Destructor -ControlMessageFactory::~ControlMessageFactory() {} +ControlMessageFactory::~ControlMessageFactory() = default; gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what) @@ -53,7 +53,7 @@ gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsig } -std::shared_ptr>> ControlMessageFactory::GetControlMessages(gr::message::sptr queue_message) +std::shared_ptr>> ControlMessageFactory::GetControlMessages(const gr::message::sptr& queue_message) { std::shared_ptr>> control_messages = std::make_shared>>(); unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); diff --git a/src/core/receiver/control_message_factory.h b/src/core/receiver/control_message_factory.h index 53339cea5..3aac015a9 100644 --- a/src/core/receiver/control_message_factory.h +++ b/src/core/receiver/control_message_factory.h @@ -58,7 +58,7 @@ public: virtual ~ControlMessageFactory(); gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what); - std::shared_ptr>> GetControlMessages(gr::message::sptr queue_message); + std::shared_ptr>> GetControlMessages(const gr::message::sptr& queue_message); }; #endif /*GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_*/ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index fa7001e97..c80c78de5 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -166,7 +166,7 @@ void ControlThread::init() else { // fill agnss_ref_time_ - struct tm tm; + struct tm tm = {}; if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) { agnss_ref_time_.d_tv_sec = timegm(&tm); @@ -190,8 +190,6 @@ void ControlThread::init() ControlThread::~ControlThread() { - // save navigation data to files - // if (save_assistance_to_XML() == true) {} if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); } @@ -878,7 +876,7 @@ std::vector> ControlThread::get_visible_sats(time std::vector visible_gps; std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); - struct tm tstruct; + struct tm tstruct = {}; char buf[80]; tstruct = *gmtime(&rx_utc_time); strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 43f177502..614d9268c 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -34,8 +34,8 @@ */ #include "file_configuration.h" -#include "in_memory_configuration.h" #include "INIReader.h" +#include "in_memory_configuration.h" #include "string_converter.h" #include #include @@ -45,7 +45,7 @@ using google::LogMessage; FileConfiguration::FileConfiguration(std::string filename) { - filename_ = filename; + filename_ = std::move(filename); init(); } @@ -84,13 +84,13 @@ bool FileConfiguration::property(std::string property_name, bool default_value) } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } -long FileConfiguration::property(std::string property_name, long default_value) +int64_t FileConfiguration::property(std::string property_name, int64_t default_value) { if (overrided_->is_present(property_name)) { @@ -98,7 +98,21 @@ long FileConfiguration::property(std::string property_name, long default_value) } else { - std::string empty = ""; + std::string empty; + return converter_->convert(property(property_name, empty), default_value); + } +} + + +uint64_t FileConfiguration::property(std::string property_name, uint64_t default_value) +{ + if (overrided_->is_present(property_name)) + { + return overrided_->property(property_name, default_value); + } + else + { + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -112,7 +126,7 @@ int FileConfiguration::property(std::string property_name, int default_value) } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -126,13 +140,13 @@ unsigned int FileConfiguration::property(std::string property_name, unsigned int } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } -unsigned short FileConfiguration::property(std::string property_name, unsigned short default_value) +uint16_t FileConfiguration::property(std::string property_name, uint16_t default_value) { if (overrided_->is_present(property_name)) { @@ -140,7 +154,21 @@ unsigned short FileConfiguration::property(std::string property_name, unsigned s } else { - std::string empty = ""; + std::string empty; + return converter_->convert(property(property_name, empty), default_value); + } +} + + +int16_t FileConfiguration::property(std::string property_name, int16_t default_value) +{ + if (overrided_->is_present(property_name)) + { + return overrided_->property(property_name, default_value); + } + else + { + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -154,7 +182,7 @@ float FileConfiguration::property(std::string property_name, float default_value } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } @@ -168,7 +196,7 @@ double FileConfiguration::property(std::string property_name, double default_val } else { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } } diff --git a/src/core/receiver/file_configuration.h b/src/core/receiver/file_configuration.h index 2484438d8..0e2ccb53e 100644 --- a/src/core/receiver/file_configuration.h +++ b/src/core/receiver/file_configuration.h @@ -37,6 +37,7 @@ #define GNSS_SDR_FILE_CONFIGURATION_H_ #include "configuration_interface.h" +#include #include #include @@ -62,10 +63,12 @@ public: ~FileConfiguration(); std::string property(std::string property_name, std::string default_value); bool property(std::string property_name, bool default_value); - long property(std::string property_name, long default_value); - int property(std::string property_name, int default_value); - unsigned int property(std::string property_name, unsigned int default_value); - unsigned short property(std::string property_name, unsigned short default_value); + int64_t property(std::string property_name, int64_t default_value); + uint64_t property(std::string property_name, uint64_t default_value); + int32_t property(std::string property_name, int32_t default_value); + uint32_t property(std::string property_name, uint32_t default_value); + int16_t property(std::string property_name, int16_t default_value); + uint16_t property(std::string property_name, uint16_t default_value); float property(std::string property_name, float default_value); double property(std::string property_name, double default_value); void set_property(std::string property_name, std::string value); diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 7ef051d26..55218ee8d 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -172,10 +172,10 @@ using google::LogMessage; -GNSSBlockFactory::GNSSBlockFactory() {} +GNSSBlockFactory::GNSSBlockFactory() = default; -GNSSBlockFactory::~GNSSBlockFactory() {} +GNSSBlockFactory::~GNSSBlockFactory() = default; std::unique_ptr GNSSBlockFactory::GetSignalSource( @@ -228,7 +228,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( std::string data_type_adapter; std::string input_filter; std::string resampler; - if (signal_conditioner.compare("Pass_Through") == 0) + if (signal_conditioner == "Pass_Through") { data_type_adapter = "Pass_Through"; input_filter = "Pass_Through"; @@ -246,7 +246,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( << input_filter << ", and Resampler implementation: " << resampler; - if (signal_conditioner.compare("Array_Signal_Conditioner") == 0) + if (signal_conditioner == "Array_Signal_Conditioner") { //instantiate the array version std::unique_ptr conditioner_(new ArraySignalConditioner(configuration.get(), @@ -321,7 +321,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::string aux = configuration->property("Acquisition_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -331,7 +331,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( } aux = configuration->property("Tracking_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -341,7 +341,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( } aux = configuration->property("TelemetryDecoder_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -355,7 +355,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1C" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1C" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -386,7 +386,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -396,7 +396,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( } aux = configuration->property("Tracking_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -406,7 +406,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( } aux = configuration->property("TelemetryDecoder_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -420,7 +420,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2S" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2S" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -454,7 +454,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -464,7 +464,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( } aux = configuration->property("Tracking_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -474,7 +474,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( } aux = configuration->property("TelemetryDecoder_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -488,7 +488,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1B" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1B" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -522,7 +522,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -532,7 +532,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( } aux = configuration->property("Tracking_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -542,7 +542,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( } aux = configuration->property("TelemetryDecoder_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -556,7 +556,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_5X" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_5X" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -591,7 +591,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::string aux = configuration->property("Acquisition_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -601,7 +601,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } aux = configuration->property("Tracking_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -611,7 +611,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } aux = configuration->property("TelemetryDecoder_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -625,7 +625,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1G" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -660,7 +660,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::string aux = configuration->property("Acquisition_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -670,7 +670,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } aux = configuration->property("Tracking_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -680,7 +680,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } aux = configuration->property("TelemetryDecoder_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -694,7 +694,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2G" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -728,7 +728,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; std::string aux = configuration->property("Acquisition_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; - if (aux.compare("W") != 0) + if (aux != "W") { appendix1 = std::to_string(channel); } @@ -738,7 +738,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( } aux = configuration->property("Tracking_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; - if (aux.compare("W") != 0) + if (aux != "W") { appendix2 = std::to_string(channel); } @@ -748,7 +748,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( } aux = configuration->property("TelemetryDecoder_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; - if (aux.compare("W") != 0) + if (aux != "W") { appendix3 = std::to_string(channel); } @@ -762,7 +762,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_L5" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_L5" + appendix2 + ".item_type", default_item_type); - if (acq_item_type.compare(trk_item_type)) + if (acq_item_type != trk_item_type) { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } @@ -1045,14 +1045,14 @@ std::unique_ptr GNSSBlockFactory::GetBlock( std::unique_ptr block; //PASS THROUGH ---------------------------------------------------------------- - if (implementation.compare("Pass_Through") == 0) + if (implementation == "Pass_Through") { std::unique_ptr block_(new Pass_Through(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // SIGNAL SOURCES ------------------------------------------------------------- - else if (implementation.compare("File_Signal_Source") == 0) + else if (implementation == "File_Signal_Source") { try { @@ -1068,7 +1068,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #if RAW_UDP - else if (implementation.compare("Custom_UDP_Signal_Source") == 0) + else if (implementation == "Custom_UDP_Signal_Source") { try { @@ -1084,7 +1084,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #endif - else if (implementation.compare("Nsr_File_Signal_Source") == 0) + else if (implementation == "Nsr_File_Signal_Source") { try { @@ -1099,7 +1099,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #if MODERN_GNURADIO - else if (implementation.compare("Two_Bit_Cpx_File_Signal_Source") == 0) + else if (implementation == "Two_Bit_Cpx_File_Signal_Source") { try { @@ -1113,7 +1113,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("Two_Bit_Packed_File_Signal_Source") == 0) + else if (implementation == "Two_Bit_Packed_File_Signal_Source") { try { @@ -1128,7 +1128,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #endif - else if (implementation.compare("Spir_File_Signal_Source") == 0) + else if (implementation == "Spir_File_Signal_Source") { try { @@ -1142,7 +1142,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("Spir_GSS6450_File_Signal_Source") == 0) + else if (implementation == "Spir_GSS6450_File_Signal_Source") { try { @@ -1156,7 +1156,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("RtlTcp_Signal_Source") == 0) + else if (implementation == "RtlTcp_Signal_Source") { try { @@ -1170,7 +1170,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("Labsat_Signal_Source") == 0) + else if (implementation == "Labsat_Signal_Source") { try { @@ -1186,7 +1186,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } } #if UHD_DRIVER - else if (implementation.compare("UHD_Signal_Source") == 0) + else if (implementation == "UHD_Signal_Source") { std::unique_ptr block_(new UhdSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1194,7 +1194,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif #if GN3S_DRIVER - else if (implementation.compare("GN3S_Signal_Source") == 0) + else if (implementation == "GN3S_Signal_Source") { std::unique_ptr block_(new Gn3sSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1203,7 +1203,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if RAW_ARRAY_DRIVER - else if (implementation.compare("Raw_Array_Signal_Source") == 0) + else if (implementation == "Raw_Array_Signal_Source") { std::unique_ptr block_(new RawArraySignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1212,7 +1212,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if OSMOSDR_DRIVER - else if (implementation.compare("Osmosdr_Signal_Source") == 0) + else if (implementation == "Osmosdr_Signal_Source") { std::unique_ptr block_(new OsmosdrSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1221,7 +1221,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if PLUTOSDR_DRIVER - else if (implementation.compare("Plutosdr_Signal_Source") == 0) + else if (implementation == "Plutosdr_Signal_Source") { std::unique_ptr block_(new PlutosdrSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1230,7 +1230,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if FMCOMMS2_DRIVER - else if (implementation.compare("Fmcomms2_Signal_Source") == 0) + else if (implementation == "Fmcomms2_Signal_Source") { std::unique_ptr block_(new Fmcomms2SignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1239,7 +1239,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if AD9361_DRIVER - else if (implementation.compare("Ad9361_Fpga_Signal_Source") == 0) + else if (implementation == "Ad9361_Fpga_Signal_Source") { std::unique_ptr block_(new Ad9361FpgaSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1248,7 +1248,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif #if FLEXIBAND_DRIVER - else if (implementation.compare("Flexiband_Signal_Source") == 0) + else if (implementation == "Flexiband_Signal_Source") { std::unique_ptr block_(new FlexibandSignalSource(configuration.get(), role, in_streams, out_streams, queue)); @@ -1257,37 +1257,37 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #endif // DATA TYPE ADAPTER ----------------------------------------------------------- - else if (implementation.compare("Byte_To_Short") == 0) + else if (implementation == "Byte_To_Short") { std::unique_ptr block_(new ByteToShort(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ibyte_To_Cbyte") == 0) + else if (implementation == "Ibyte_To_Cbyte") { std::unique_ptr block_(new IbyteToCbyte(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ibyte_To_Cshort") == 0) + else if (implementation == "Ibyte_To_Cshort") { std::unique_ptr block_(new IbyteToCshort(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ibyte_To_Complex") == 0) + else if (implementation == "Ibyte_To_Complex") { std::unique_ptr block_(new IbyteToComplex(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ishort_To_Cshort") == 0) + else if (implementation == "Ishort_To_Cshort") { std::unique_ptr block_(new IshortToCshort(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Ishort_To_Complex") == 0) + else if (implementation == "Ishort_To_Complex") { std::unique_ptr block_(new IshortToComplex(configuration.get(), role, in_streams, out_streams)); @@ -1295,37 +1295,37 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // INPUT FILTER ---------------------------------------------------------------- - else if (implementation.compare("Fir_Filter") == 0) + else if (implementation == "Fir_Filter") { std::unique_ptr block_(new FirFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Freq_Xlating_Fir_Filter") == 0) + else if (implementation == "Freq_Xlating_Fir_Filter") { std::unique_ptr block_(new FreqXlatingFirFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Beamformer_Filter") == 0) + else if (implementation == "Beamformer_Filter") { std::unique_ptr block_(new BeamformerFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Pulse_Blanking_Filter") == 0) + else if (implementation == "Pulse_Blanking_Filter") { std::unique_ptr block_(new PulseBlankingFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Notch_Filter") == 0) + else if (implementation == "Notch_Filter") { std::unique_ptr block_(new NotchFilter(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Notch_Filter_Lite") == 0) + else if (implementation == "Notch_Filter_Lite") { std::unique_ptr block_(new NotchFilterLite(configuration.get(), role, in_streams, out_streams)); @@ -1333,14 +1333,14 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // RESAMPLER ------------------------------------------------------------------- - else if (implementation.compare("Direct_Resampler") == 0) + else if (implementation == "Direct_Resampler") { std::unique_ptr block_(new DirectResamplerConditioner(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if ((implementation.compare("Fractional_Resampler") == 0) || (implementation.compare("Mmse_Resampler") == 0)) + else if ((implementation == "Fractional_Resampler") || (implementation == "Mmse_Resampler")) { std::unique_ptr block_(new MmseResamplerConditioner(configuration.get(), role, in_streams, out_streams)); @@ -1348,7 +1348,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // ACQUISITION BLOCKS --------------------------------------------------------- - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1356,20 +1356,20 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Assisted_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_Tong_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1377,7 +1377,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #if OPENCL_BLOCKS - else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1385,171 +1385,171 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_QuickSync_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsQuickSyncAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition") { std::unique_ptr block_(new GpsL2MPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL2MPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition") { std::unique_ptr block_(new GpsL5iPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L5i_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL5iPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") == 0) + else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") { std::unique_ptr block_(new GalileoE5aNoncoherentIQAcquisitionCaf(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition") { std::unique_ptr block_(new GalileoE5aPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE5aPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL2CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // TRACKING BLOCKS ------------------------------------------------------------- - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_KF_Tracking") == 0) + else if (implementation == "GPS_L1_CA_KF_Tracking") { std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, - out_streams)); + out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "GPS_L1_CA_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL2MDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking") or (implementation == "GPS_L5_DLL_PLL_Tracking")) { std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking_Fpga") or (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")) { std::unique_ptr block_(new GpsL5DllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); @@ -1557,123 +1557,123 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif #if CUDA_GPU_ACCEL - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_GPU") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_GPU") { std::unique_ptr block_(new GpsL1CaDllPllTrackingGPU(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { std::unique_ptr block_(new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") { std::unique_ptr block_(new GalileoE1DllPllVemlTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "Galileo_E1_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { std::unique_ptr block_(new GalileoE5aDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GalileoE5aDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // TELEMETRY DECODERS ---------------------------------------------------------- - else if (implementation.compare("GPS_L1_CA_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2C_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L2C_Telemetry_Decoder") { std::unique_ptr block_(new GpsL2CTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L5_Telemetry_Decoder") { std::unique_ptr block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1B_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E1B_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("SBAS_L1_Telemetry_Decoder") == 0) + else if (implementation == "SBAS_L1_Telemetry_Decoder") { std::unique_ptr block_(new SbasL1TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E5a_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE5aTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L2_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL2CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } // OBSERVABLES ----------------------------------------------------------------- - else if ((implementation.compare("Hybrid_Observables") == 0) || (implementation.compare("GPS_L1_CA_Observables") == 0) || (implementation.compare("GPS_L2C_Observables") == 0) || - (implementation.compare("Galileo_E5A_Observables") == 0)) + else if ((implementation == "Hybrid_Observables") || (implementation == "GPS_L1_CA_Observables") || (implementation == "GPS_L2C_Observables") || + (implementation == "Galileo_E5A_Observables")) { std::unique_ptr block_(new HybridObservables(configuration.get(), role, in_streams, out_streams)); @@ -1681,7 +1681,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } // PVT ------------------------------------------------------------------------- - else if ((implementation.compare("RTKLIB_PVT") == 0) || (implementation.compare("GPS_L1_CA_PVT") == 0) || (implementation.compare("Galileo_E1_PVT") == 0) || (implementation.compare("Hybrid_PVT") == 0)) + else if ((implementation == "RTKLIB_PVT") || (implementation == "GPS_L1_CA_PVT") || (implementation == "Galileo_E1_PVT") || (implementation == "Hybrid_PVT")) { std::unique_ptr block_(new RtklibPvt(configuration.get(), role, in_streams, out_streams)); @@ -1712,27 +1712,27 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( { std::unique_ptr block; // ACQUISITION BLOCKS --------------------------------------------------------- - if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) + if (implementation == "GPS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Assisted_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_Tong_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1740,7 +1740,7 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( } #if OPENCL_BLOCKS - else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1748,112 +1748,112 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( } #endif - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_PCPS_QuickSync_Acquisition") == 0) + else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition") { std::unique_ptr block_(new GpsL1CaPcpsQuickSyncAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition") { std::unique_ptr block_(new GpsL2MPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL2MPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition") { std::unique_ptr block_(new GpsL5iPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L5i_PCPS_Acquisition_Fpga") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition_Fpga") { std::unique_ptr block_(new GpsL5iPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") { std::unique_ptr block_(new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") == 0) + else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") { std::unique_ptr block_(new GalileoE5aNoncoherentIQAcquisitionCaf(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition") { std::unique_ptr block_(new GalileoE5aPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition_Fpga") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition_Fpga") { std::unique_ptr block_(new GalileoE5aPcpsAcquisitionFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL1CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { std::unique_ptr block_(new GlonassL2CaPcpsAcquisition(configuration.get(), role, in_streams, out_streams)); @@ -1877,94 +1877,94 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( std::unique_ptr block; // TRACKING BLOCKS ------------------------------------------------------------- - if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_KF_Tracking") == 0) + else if (implementation == "GPS_L1_CA_KF_Tracking") { std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, - out_streams)); + out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GpsL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L1_CA_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "GPS_L1_CA_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { std::unique_ptr block_(new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") { std::unique_ptr block_(new GalileoE1DllPllVemlTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("Galileo_E1_TCP_CONNECTOR_Tracking") == 0) + else if (implementation == "Galileo_E1_TCP_CONNECTOR_Tracking") { std::unique_ptr block_(new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { std::unique_ptr block_(new GalileoE5aDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GalileoE5aDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { std::unique_ptr block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking_Fpga") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking_Fpga") { std::unique_ptr block_(new GpsL2MDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking") or (implementation == "GPS_L5_DLL_PLL_Tracking")) { std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #if ENABLE_FPGA - else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)) + else if ((implementation == "GPS_L5i_DLL_PLL_Tracking_Fpga") or (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")) { std::unique_ptr block_(new GpsL5DllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); @@ -1972,32 +1972,32 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( } #endif #if CUDA_GPU_ACCEL - else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_GPU") == 0) + else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_GPU") { std::unique_ptr block_(new GpsL1CaDllPllTrackingGPU(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } #endif - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL1CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") == 0) + else if (implementation == "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") { std::unique_ptr block_(new GlonassL2CaDllPllCAidTracking(configuration.get(), role, in_streams, out_streams)); @@ -2021,49 +2021,49 @@ std::unique_ptr GNSSBlockFactory::GetTlmBlock( std::unique_ptr block; // TELEMETRY DECODERS ---------------------------------------------------------- - if (implementation.compare("GPS_L1_CA_Telemetry_Decoder") == 0) + if (implementation == "GPS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E1B_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E1B_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("SBAS_L1_Telemetry_Decoder") == 0) + else if (implementation == "SBAS_L1_Telemetry_Decoder") { std::unique_ptr block_(new SbasL1TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("Galileo_E5a_Telemetry_Decoder") == 0) + else if (implementation == "Galileo_E5a_Telemetry_Decoder") { std::unique_ptr block_(new GalileoE5aTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L2C_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L2C_Telemetry_Decoder") { std::unique_ptr block_(new GpsL2CTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L1_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L1_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL1CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GLONASS_L2_CA_Telemetry_Decoder") == 0) + else if (implementation == "GLONASS_L2_CA_Telemetry_Decoder") { std::unique_ptr block_(new GlonassL2CaTelemetryDecoder(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5_Telemetry_Decoder") == 0) + else if (implementation == "GPS_L5_Telemetry_Decoder") { std::unique_ptr block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams, out_streams)); diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index e00fe7847..bb27826bb 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -204,7 +204,7 @@ void GNSSFlowgraph::connect() { //TODO: Remove this array implementation and create generic multistream connector //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) - if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source") { //Multichannel Array std::cout << "ARRAY MODE" << std::endl; @@ -566,7 +566,7 @@ void GNSSFlowgraph::disconnect() { // TODO: Remove this array implementation and create generic multistream connector // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) - if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source") { //Multichannel Array for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) @@ -1334,8 +1334,8 @@ void GNSSFlowgraph::init() // Mark old implementations as deprecated std::string default_str("Default"); std::string obs_implementation = configuration_->property("Observables.implementation", default_str); - if ((obs_implementation.compare("GPS_L1_CA_Observables") == 0) || (obs_implementation.compare("GPS_L2C_Observables") == 0) || - (obs_implementation.compare("Galileo_E1B_Observables") == 0) || (obs_implementation.compare("Galileo_E5A_Observables") == 0)) + if ((obs_implementation == "GPS_L1_CA_Observables") || (obs_implementation == "GPS_L2C_Observables") || + (obs_implementation == "Galileo_E1B_Observables") || (obs_implementation == "Galileo_E5A_Observables")) { std::cout << "WARNING: Implementation '" << obs_implementation << "' of the Observables block has been replaced by 'Hybrid_Observables'." << std::endl; std::cout << "Please update your configuration file." << std::endl; @@ -1344,7 +1344,7 @@ void GNSSFlowgraph::init() pvt_ = block_factory_->GetPVT(configuration_); // Mark old implementations as deprecated std::string pvt_implementation = configuration_->property("PVT.implementation", default_str); - if ((pvt_implementation.compare("GPS_L1_CA_PVT") == 0) || (pvt_implementation.compare("Galileo_E1_PVT") == 0) || (pvt_implementation.compare("Hybrid_PVT") == 0)) + if ((pvt_implementation == "GPS_L1_CA_PVT") || (pvt_implementation == "Galileo_E1_PVT") || (pvt_implementation == "Hybrid_PVT")) { std::cout << "WARNING: Implementation '" << pvt_implementation << "' of the PVT block has been replaced by 'RTKLIB_PVT'." << std::endl; std::cout << "Please update your configuration file." << std::endl; @@ -1611,7 +1611,7 @@ void GNSSFlowgraph::set_channels_state() } -Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool pop, bool tracked) +Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal, bool pop, bool tracked) { Gnss_Signal result; bool untracked_satellite = true; @@ -1630,7 +1630,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("1C") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1C")) untracked_satellite = false; } if (untracked_satellite and configuration_->property("Channels_2S.count", 0) > 0) { @@ -1661,7 +1661,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("2S") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2S")) untracked_satellite = false; } if (untracked_satellite and configuration_->property("Channels_1C.count", 0) > 0) { @@ -1692,7 +1692,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("L5") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "L5")) untracked_satellite = false; } if (untracked_satellite and configuration_->property("Channels_1C.count", 0) > 0) { @@ -1723,7 +1723,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("1B") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1B")) untracked_satellite = false; } if (untracked_satellite) { @@ -1748,7 +1748,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("5X") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "5X")) untracked_satellite = false; } if (untracked_satellite) { @@ -1773,7 +1773,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("1G") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1G")) untracked_satellite = false; } if (untracked_satellite) { @@ -1798,7 +1798,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str().compare("2G") != 0)) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2G")) untracked_satellite = false; } if (untracked_satellite) { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index d5e25543a..b279f6f67 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -148,7 +148,7 @@ private: void set_signals_list(); void set_channels_state(); // Initializes the channels state (start acquisition or keep standby) // using the configuration parameters (number of channels and max channels in acquisition) - Gnss_Signal search_next_signal(std::string searched_signal, bool pop, bool tracked = false); + Gnss_Signal search_next_signal(const std::string& searched_signal, bool pop, bool tracked = false); bool connected_; bool running_; int sources_count_; @@ -200,7 +200,7 @@ private: bool enable_monitor_; gr::basic_block_sptr GnssSynchroMonitor_; - std::vector split_string(const std::string &s, char delim); + std::vector split_string(const std::string& s, char delim); }; #endif /*GNSS_SDR_GNSS_FLOWGRAPH_H_*/ diff --git a/src/core/receiver/in_memory_configuration.cc b/src/core/receiver/in_memory_configuration.cc index 75b520362..ffca0eed1 100644 --- a/src/core/receiver/in_memory_configuration.cc +++ b/src/core/receiver/in_memory_configuration.cc @@ -64,49 +64,63 @@ std::string InMemoryConfiguration::property(std::string property_name, std::stri bool InMemoryConfiguration::property(std::string property_name, bool default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -long InMemoryConfiguration::property(std::string property_name, long default_value) +int64_t InMemoryConfiguration::property(std::string property_name, int64_t default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -int InMemoryConfiguration::property(std::string property_name, int default_value) +uint64_t InMemoryConfiguration::property(std::string property_name, uint64_t default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -unsigned int InMemoryConfiguration::property(std::string property_name, unsigned int default_value) +int32_t InMemoryConfiguration::property(std::string property_name, int32_t default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } -unsigned short InMemoryConfiguration::property(std::string property_name, unsigned short default_value) +uint32_t InMemoryConfiguration::property(std::string property_name, uint32_t default_value) { - std::string empty = ""; + std::string empty; + return converter_->convert(property(property_name, empty), default_value); +} + + +uint16_t InMemoryConfiguration::property(std::string property_name, uint16_t default_value) +{ + std::string empty; + return converter_->convert(property(property_name, empty), default_value); +} + + +int16_t InMemoryConfiguration::property(std::string property_name, int16_t default_value) +{ + std::string empty; return converter_->convert(property(property_name, empty), default_value); } float InMemoryConfiguration::property(std::string property_name, float default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } double InMemoryConfiguration::property(std::string property_name, double default_value) { - std::string empty = ""; + std::string empty; return converter_->convert(property(property_name, empty), default_value); } @@ -124,7 +138,7 @@ void InMemoryConfiguration::supersede_property(std::string property_name, std::s } -bool InMemoryConfiguration::is_present(std::string property_name) +bool InMemoryConfiguration::is_present(const std::string& property_name) { return (properties_.find(property_name) != properties_.end()); } diff --git a/src/core/receiver/in_memory_configuration.h b/src/core/receiver/in_memory_configuration.h index 59c1f1baf..698071a36 100644 --- a/src/core/receiver/in_memory_configuration.h +++ b/src/core/receiver/in_memory_configuration.h @@ -36,6 +36,7 @@ #define GNSS_SDR_IN_MEMORY_CONFIGURATION_H_ #include "configuration_interface.h" +#include #include #include #include @@ -56,15 +57,17 @@ public: virtual ~InMemoryConfiguration(); std::string property(std::string property_name, std::string default_value); bool property(std::string property_name, bool default_value); - long property(std::string property_name, long default_value); - int property(std::string property_name, int default_value); - unsigned int property(std::string property_name, unsigned int default_value); - unsigned short property(std::string property_name, unsigned short default_value); + int64_t property(std::string property_name, int64_t default_value); + uint64_t property(std::string property_name, uint64_t default_value); + int32_t property(std::string property_name, int32_t default_value); + uint32_t property(std::string property_name, uint32_t default_value); + int16_t property(std::string property_name, int16_t default_value); + uint16_t property(std::string property_name, uint16_t default_value); float property(std::string property_name, float default_value); double property(std::string property_name, double default_value); void set_property(std::string property_name, std::string value); void supersede_property(std::string property_name, std::string value); - bool is_present(std::string property_name); + bool is_present(const std::string& property_name); private: std::map properties_; diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index ecb175e5f..220d4effb 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -142,7 +142,7 @@ std::string TcpCmdInterface::status(const std::vector &commandLine &course_over_ground_deg, &UTC_time) == true) { - struct tm tstruct; + struct tm tstruct = {}; char buf1[80]; tstruct = *gmtime(&UTC_time); strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct); @@ -173,7 +173,7 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin if (commandLine.size() > 5) { // Read commandline time parameter - struct tm tm; + struct tm tm = {}; if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { response = "ERROR: time parameter malformed\n"; @@ -219,7 +219,7 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi { std::string tmp_str; // Read commandline time parameter - struct tm tm; + struct tm tm = {}; tmp_str = commandLine.at(1) + commandLine.at(2); if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { @@ -336,7 +336,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) { try { - if (cmd_vector.at(0).compare("exit") == 0) + if (cmd_vector.at(0) == "exit") { error = boost::asio::error::eof; // send cmd response diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 2323e357d..841270668 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -28,23 +28,24 @@ * * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_TCPCMDINTERFACE_H_ -#define GNSS_SDR_TCPCMDINTERFACE_H_ +#ifndef GNSS_SDR_TCP_CMD_INTERFACE_H_ +#define GNSS_SDR_TCP_CMD_INTERFACE_H_ #include "pvt_interface.h" +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include + class TcpCmdInterface { @@ -53,10 +54,12 @@ public: virtual ~TcpCmdInterface(); void run_cmd_server(int tcp_port); void set_msg_queue(gr::msg_queue::sptr control_queue); + /*! * \brief gets the UTC time parsed from the last TC command issued */ time_t get_utc_time(); + /*! * \brief gets the Latitude, Longitude and Altitude vector from the last TC command issued */ @@ -89,4 +92,4 @@ private: std::shared_ptr PVT_sptr_; }; -#endif /* GNSS_SDR_TCPCMDINTERFACE_H_ */ +#endif /* GNSS_SDR_TCP_CMD_INTERFACE_H_ */ diff --git a/src/core/system_parameters/GPS_CNAV.h b/src/core/system_parameters/GPS_CNAV.h index 2fbad6e2d..5ab606bc4 100644 --- a/src/core/system_parameters/GPS_CNAV.h +++ b/src/core/system_parameters/GPS_CNAV.h @@ -171,11 +171,11 @@ const double CNAV_DELTA_TLS_LSB = 1; const std::vector > CNAV_TOT({{172, 16}}); const double CNAV_TOT_LSB = TWO_P4; const std::vector > CNAV_WN_OT({{188, 13}}); -const double CNAV_WN_OT_LSB = 1; +const int32_t CNAV_WN_OT_LSB = 1; const std::vector > CNAV_WN_LSF({{201, 13}}); -const double CNAV_WN_LSF_LSB = 1; +const int32_t CNAV_WN_LSF_LSB = 1; const std::vector > CNAV_DN({{214, 4}}); -const double CNAV_DN_LSB = 1; +const int32_t CNAV_DN_LSB = 1; const std::vector > CNAV_DELTA_TLSF({{218, 8}}); const double CNAV_DELTA_TLSF_LSB = 1; diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index e3a3871f7..9879716e4 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -221,7 +221,7 @@ const std::vector> HEALTH_SV32({{283, 6}}); // page 25 - Health (PRN 1 - 24) const std::vector> T_OA({{69, 8}}); -const double T_OA_LSB = TWO_P12; +const int32_t T_OA_LSB = TWO_P12; const std::vector> WN_A({{77, 8}}); const std::vector> HEALTH_SV1({{91, 6}}); const std::vector> HEALTH_SV2({{97, 6}}); diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index e25501e08..7cb1ac433 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -205,7 +205,7 @@ const std::vector> TOW_6_bit({{106, 20}}); const std::vector> IOD_a_7_bit({{7, 4}}); const std::vector> WN_a_7_bit({{11, 2}}); const std::vector> t0a_7_bit({{13, 10}}); -const double t0a_7_LSB = 600; +const int32_t t0a_7_LSB = 600; const std::vector> SVID1_7_bit({{23, 6}}); const std::vector> DELTA_A_7_bit({{29, 13}}); const double DELTA_A_7_LSB = TWO_N9; @@ -250,7 +250,7 @@ const double Omega_dot_8_LSB = TWO_N33; const std::vector> IOD_a_9_bit({{7, 4}}); const std::vector> WN_a_9_bit({{11, 2}}); const std::vector> t0a_9_bit({{13, 10}}); -const double t0a_9_LSB = 600; +const int32_t t0a_9_LSB = 600; const std::vector> M0_9_bit({{23, 16}}); const double M0_9_LSB = TWO_N15; const std::vector> af0_9_bit({{39, 16}}); diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index ea84ab3c9..b8540d32c 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -174,7 +174,7 @@ const std::vector> FNAV_TOW_4_bit({{190, 20}}); const std::vector> FNAV_IODa_5_bit({{7, 4}}); const std::vector> FNAV_WNa_5_bit({{11, 2}}); const std::vector> FNAV_t0a_5_bit({{13, 10}}); -const double FNAV_t0a_5_LSB = 600; +const int32_t FNAV_t0a_5_LSB = 600; const std::vector> FNAV_SVID1_5_bit({{23, 6}}); const std::vector> FNAV_Deltaa12_1_5_bit({{29, 13}}); const double FNAV_Deltaa12_5_LSB = TWO_N9; diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index 1b2e1b28e..960ccd09e 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -45,7 +45,7 @@ public: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; int32_t WN_a_7; - double t0a_7; + int32_t t0a_7; int32_t SVID1_7; double DELTA_A_7; double e_7; @@ -73,7 +73,7 @@ public: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) int32_t IOD_a_9; int32_t WN_a_9; - double t0a_9; + int32_t t0a_9; double M0_9; double af0_9; double af1_9; diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 33cd59056..03d74680b 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -41,7 +41,7 @@ #include -typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_Galileo_FNAV_type; +using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; void Galileo_Fnav_Message::reset() { @@ -84,7 +84,7 @@ void Galileo_Fnav_Message::reset() FNAV_region4_1 = false; FNAV_region5_1 = false; FNAV_BGD_1 = 0.0; - FNAV_E5ahs_1 = 0.0; + FNAV_E5ahs_1 = 0; FNAV_WN_1 = 0.0; FNAV_TOW_1 = 0.0; FNAV_E5advs_1 = false; @@ -134,8 +134,8 @@ void Galileo_Fnav_Message::reset() // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time FNAV_IODa_5 = 0; - FNAV_WNa_5 = 0.0; - FNAV_t0a_5 = 0.0; + FNAV_WNa_5 = 0; + FNAV_t0a_5 = 0; FNAV_SVID1_5 = 0; FNAV_Deltaa12_1_5 = 0.0; FNAV_e_1_5 = 0.0; @@ -160,7 +160,7 @@ void Galileo_Fnav_Message::reset() FNAV_M0_2_6 = 0.0; FNAV_af0_2_6 = 0.0; FNAV_af1_2_6 = 0.0; - FNAV_E5ahs_2_6 = 0.0; + FNAV_E5ahs_2_6 = 0; FNAV_SVID3_6 = 0; FNAV_Deltaa12_3_6 = 0.0; FNAV_e_3_6 = 0.0; @@ -171,7 +171,7 @@ void Galileo_Fnav_Message::reset() FNAV_M0_3_6 = 0.0; FNAV_af0_3_6 = 0.0; FNAV_af1_3_6 = 0.0; - FNAV_E5ahs_3_6 = 0.0; + FNAV_E5ahs_3_6 = 0; } @@ -181,7 +181,7 @@ Galileo_Fnav_Message::Galileo_Fnav_Message() } -void Galileo_Fnav_Message::split_page(std::string page_string) +void Galileo_Fnav_Message::split_page(const std::string& page_string) { std::string message_word = page_string.substr(0, 214); std::string CRC_data = page_string.substr(214, 24); @@ -231,7 +231,7 @@ bool Galileo_Fnav_Message::_CRC_test(std::bitset b } -void Galileo_Fnav_Message::decode_page(std::string data) +void Galileo_Fnav_Message::decode_page(const std::string& data) { std::bitset data_bits(data); page_type = read_navigation_unsigned(data_bits, FNAV_PAGE_TYPE_bit); @@ -346,8 +346,8 @@ void Galileo_Fnav_Message::decode_page(std::string data) break; case 5: // Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time FNAV_IODa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit)); - FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); - FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); + FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); + FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); FNAV_t0a_5 *= FNAV_t0a_5_LSB; FNAV_SVID1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit)); FNAV_Deltaa12_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_1_5_bit)); @@ -368,7 +368,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) FNAV_af0_1_5 *= FNAV_af0_5_LSB; FNAV_af1_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_5_bit)); FNAV_af1_1_5 *= FNAV_af1_5_LSB; - FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); + FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); FNAV_SVID2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit)); FNAV_Deltaa12_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_2_5_bit)); FNAV_Deltaa12_2_5 *= FNAV_Deltaa12_5_LSB; @@ -404,7 +404,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) FNAV_af0_2_6 *= FNAV_af0_5_LSB; FNAV_af1_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_2_6_bit)); FNAV_af1_2_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); + FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); FNAV_SVID3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit)); FNAV_Deltaa12_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_3_6_bit)); FNAV_Deltaa12_3_6 *= FNAV_Deltaa12_5_LSB; @@ -424,7 +424,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) FNAV_af0_3_6 *= FNAV_af0_5_LSB; FNAV_af1_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_3_6_bit)); FNAV_af1_3_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); + FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); flag_almanac_2 = true; break; @@ -432,7 +432,7 @@ void Galileo_Fnav_Message::decode_page(std::string data) } -uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { uint64_t value = 0ULL; int num_of_slices = parameter.size(); @@ -441,7 +441,7 @@ uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset(bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j]) == 1) { value += 1; // insert the bit } @@ -451,13 +451,13 @@ uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { int64_t value = 0LL; int num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[0].first] == 1) + if (static_cast(bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[0].first]) == 1) { value ^= 0x0FFFFFFFFFFFFFFF; // 64 bits variable } @@ -472,7 +472,7 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset(bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j]) == 1) { value += 1; // insert the bit } @@ -504,7 +504,9 @@ bool Galileo_Fnav_Message::have_new_ephemeris() // Check if we have a new ephem } } else - return false; + { + return false; + } } @@ -513,10 +515,12 @@ bool Galileo_Fnav_Message::have_new_iono_and_GST() // Check if we have a new io if ((flag_iono_and_GST == true) and (flag_utc_model == true)) // the condition on flag_utc_model is added to have a time stamp for iono { flag_iono_and_GST = false; // clear the flag - return true; } else - return false; + { + return false; + } + return true; } @@ -525,10 +529,12 @@ bool Galileo_Fnav_Message::have_new_utc_model() // Check if we have a new utc d if (flag_utc_model == true) { flag_utc_model = false; // clear the flag - return true; } else - return false; + { + return false; + } + return true; } @@ -540,10 +546,12 @@ bool Galileo_Fnav_Message::have_new_almanac() // Check if we have a new almanac flag_almanac_1 = false; flag_almanac_2 = false; flag_all_almanac = true; - return true; } else - return false; + { + return false; + } + return true; } diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index 2a16578be..c08c6d7c7 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -57,7 +57,7 @@ class Galileo_Fnav_Message { public: - void split_page(std::string page_string); + void split_page(const std::string& page_string); void reset(); bool have_new_ephemeris(); bool have_new_iono_and_GST(); @@ -109,7 +109,7 @@ public: bool FNAV_region4_1; bool FNAV_region5_1; double FNAV_BGD_1; - double FNAV_E5ahs_1; + int32_t FNAV_E5ahs_1; double FNAV_WN_1; double FNAV_TOW_1; bool FNAV_E5advs_1; @@ -159,8 +159,8 @@ public: // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time int32_t FNAV_IODa_5; - double FNAV_WNa_5; - double FNAV_t0a_5; + int32_t FNAV_WNa_5; + int32_t FNAV_t0a_5; int32_t FNAV_SVID1_5; double FNAV_Deltaa12_1_5; double FNAV_e_1_5; @@ -185,7 +185,7 @@ public: double FNAV_M0_2_6; double FNAV_af0_2_6; double FNAV_af1_2_6; - double FNAV_E5ahs_2_6; + int32_t FNAV_E5ahs_2_6; int32_t FNAV_SVID3_6; double FNAV_Deltaa12_3_6; double FNAV_e_3_6; @@ -196,13 +196,13 @@ public: double FNAV_M0_3_6; double FNAV_af0_3_6; double FNAV_af1_3_6; - double FNAV_E5ahs_3_6; + int32_t FNAV_E5ahs_3_6; private: bool _CRC_test(std::bitset bits, uint32_t checksum); - void decode_page(std::string data); - uint64_t read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - int64_t read_navigation_signed(std::bitset bits, const std::vector> parameter); + void decode_page(const std::string& data); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); std::string omega0_1; //std::string omega0_2; diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 4e72f62d3..ded7a075a 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -37,7 +37,7 @@ #include -typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_Galileo_INAV_type; +using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; void Galileo_Navigation_Message::reset() @@ -139,15 +139,15 @@ void Galileo_Navigation_Message::reset() Delta_tLS_6 = 0.0; t0t_6 = 0.0; WNot_6 = 0.0; - WN_LSF_6 = 0.0; - DN_6 = 0.0; + WN_LSF_6 = 0; + DN_6 = 0; Delta_tLSF_6 = 0.0; TOW_6 = 0.0; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; WN_a_7 = 0; - t0a_7 = 0.0; + t0a_7 = 0; SVID1_7 = 0; DELTA_A_7 = 0.0; e_7 = 0.0; @@ -174,7 +174,7 @@ void Galileo_Navigation_Message::reset() // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = 0; WN_a_9 = 0; - t0a_9 = 0.0; + t0a_9 = 0; M0_9 = 0.0; af0_9 = 0.0; af1_9 = 0.0; @@ -260,7 +260,7 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset b } -uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector > parameter) +uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector >& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -269,7 +269,7 @@ uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset(bits[GALILEO_DATA_JK_BITS - parameter[i].first - j]) == 1) { value += 1; // insert the bit } @@ -279,7 +279,7 @@ uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector > parameter) +uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset bits, const std::vector >& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -288,7 +288,7 @@ uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset(bits[GALILEO_PAGE_TYPE_BITS - parameter[i].first - j]) == 1) { value += 1ULL; // insert the bit } @@ -298,13 +298,13 @@ uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset bits, const std::vector > parameter) +int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector >& parameter) { int64_t value = 0LL; int32_t num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1) + if (static_cast(bits[GALILEO_DATA_JK_BITS - parameter[0].first]) == 1) { value ^= 0xFFFFFFFFFFFFFFFFLL; // 64 bits variable } @@ -319,7 +319,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset(bits[GALILEO_DATA_JK_BITS - parameter[i].first - j]) == 1) { value += 1LL; // insert the bit } @@ -329,10 +329,10 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector > parameter) +bool Galileo_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector >& parameter) { bool value; - if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1) + if (static_cast(static_cast(bits[GALILEO_DATA_JK_BITS - parameter[0].first])) == 1) { value = true; } @@ -356,7 +356,7 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int32_t fla if (page_string.at(0) == '1') // if page is odd { // std::cout<< "page_string.at(0) split page="< 32) { @@ -170,7 +168,7 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) PRN = PRN_; } } - else if (system.compare("Glonass") == 0) + else if (system == "Glonass") { if (PRN_ < 1 or PRN_ > 24) { @@ -182,7 +180,7 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) PRN = PRN_; } } - else if (system.compare("SBAS") == 0) + else if (system == "SBAS") { if (PRN_ == 120) { @@ -214,7 +212,7 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) PRN = 0; } } - else if (system.compare("Galileo") == 0) + else if (system == "Galileo") { if (PRN_ < 1 or PRN_ > 36) { @@ -280,7 +278,7 @@ std::string Gnss_Satellite::get_block() const std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_) { std::string block_ = "Unknown"; - if (system_.compare("GPS") == 0) + if (system_ == "GPS") { // info from https://www.navcen.uscg.gov/?Do=constellationStatus switch (PRN_) @@ -386,7 +384,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ } } - if (system_.compare("Glonass") == 0) + if (system_ == "Glonass") { // Info from http://www.sdcm.ru/smglo/grupglo?version=eng&site=extern // See also http://www.glonass-center.ru/en/GLONASS/ @@ -492,7 +490,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ block_ = std::string("Unknown"); } } - if (system_.compare("SBAS") == 0) + if (system_ == "SBAS") { switch (PRN_) { @@ -518,7 +516,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ block_ = std::string("Unknown"); } } - if (system_.compare("Galileo") == 0) + if (system_ == "Galileo") { // Check http://en.wikipedia.org/wiki/List_of_Galileo_satellites and https://www.gsc-europa.eu/system-status/Constellation-Information switch (PRN_) diff --git a/src/core/system_parameters/gnss_signal.cc b/src/core/system_parameters/gnss_signal.cc index cc2e8effd..0c25a7841 100644 --- a/src/core/system_parameters/gnss_signal.cc +++ b/src/core/system_parameters/gnss_signal.cc @@ -50,9 +50,7 @@ Gnss_Signal::Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& si } -Gnss_Signal::~Gnss_Signal() -{ -} +Gnss_Signal::~Gnss_Signal() = default; std::string Gnss_Signal::get_signal_str() const @@ -80,7 +78,7 @@ bool operator==(const Gnss_Signal& sig1, const Gnss_Signal& sig2) if (sig1.get_satellite() == sig2.get_satellite()) { - if (sig1.get_signal_str().compare(sig1.get_signal_str()) == 0) + if (sig1.get_signal_str() == sig1.get_signal_str()) { equal = true; } diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc index 987032668..ec0bd828a 100644 --- a/src/core/system_parameters/gps_almanac.cc +++ b/src/core/system_parameters/gps_almanac.cc @@ -36,7 +36,7 @@ Gps_Almanac::Gps_Almanac() { i_satellite_PRN = 0U; d_Delta_i = 0.0; - i_Toa = 0.0; + i_Toa = 0; i_WNa = 0; d_M_0 = 0.0; d_e_eccentricity = 0.0; diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 642695469..b0605bae9 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -72,11 +72,11 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() } -bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) { bool value; - if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first]) == 1) { value = true; } @@ -88,7 +88,7 @@ bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -97,7 +97,7 @@ uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j]) == 1) { value += 1ULL; // insert the bit } @@ -107,13 +107,13 @@ uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { int64_t value = 0LL; int32_t num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first]) == 1) { value ^= 0xFFFFFFFFFFFFFFFFLL; // 64 bits variable } @@ -128,7 +128,7 @@ int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset(bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j]) == 1) { value += 1LL; // insert the bit } @@ -306,13 +306,13 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset(read_navigation_signed(data_bits, CNAV_TOT)); utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB; - utc_model_record.i_WN_T = static_cast(read_navigation_signed(data_bits, CNAV_WN_OT)); + utc_model_record.i_WN_T = static_cast(read_navigation_signed(data_bits, CNAV_WN_OT)); utc_model_record.i_WN_T = utc_model_record.i_WN_T * CNAV_WN_OT_LSB; - utc_model_record.i_WN_LSF = static_cast(read_navigation_signed(data_bits, CNAV_WN_LSF)); + utc_model_record.i_WN_LSF = static_cast(read_navigation_signed(data_bits, CNAV_WN_LSF)); utc_model_record.i_WN_LSF = utc_model_record.i_WN_LSF * CNAV_WN_LSF_LSB; - utc_model_record.i_DN = static_cast(read_navigation_signed(data_bits, CNAV_DN)); + utc_model_record.i_DN = static_cast(read_navigation_signed(data_bits, CNAV_DN)); utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB; utc_model_record.d_DeltaT_LSF = static_cast(read_navigation_signed(data_bits, CNAV_DELTA_TLSF)); diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index cdd6447b0..f34e33e91 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -56,9 +56,9 @@ class Gps_CNAV_Navigation_Message { private: - uint64_t read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - int64_t read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); + bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); Gps_CNAV_Ephemeris ephemeris_record; Gps_CNAV_Iono iono_record; diff --git a/src/core/system_parameters/gps_cnav_utc_model.cc b/src/core/system_parameters/gps_cnav_utc_model.cc index 90e1a4af2..565993f06 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.cc +++ b/src/core/system_parameters/gps_cnav_utc_model.cc @@ -84,7 +84,7 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week * proper accommodation of the leap second event with a possible week number * transition is provided by the following expression for UTC: */ - int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = static_cast(fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400)) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); // implement something to handle a leap second event! } diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index c7f394efc..abec83103 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -31,8 +31,8 @@ */ #include "gps_ephemeris.h" -#include "gnss_satellite.h" #include "GPS_L1_CA.h" +#include "gnss_satellite.h" #include Gps_Ephemeris::Gps_Ephemeris() diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index e4a7f1db1..01e8ce430 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -160,11 +160,11 @@ void Gps_Navigation_Message::print_gps_word_bytes(uint32_t GPS_word) } -bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector> parameter) +bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) { bool value; - if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_SUBFRAME_BITS - parameter[0].first]) == 1) { value = true; } @@ -176,7 +176,7 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset } -uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector>& parameter) { uint64_t value = 0ULL; int32_t num_of_slices = parameter.size(); @@ -185,7 +185,7 @@ uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset(bits[GPS_SUBFRAME_BITS - parameter[i].first - j]) == 1) { value += 1ULL; // insert the bit } @@ -195,13 +195,13 @@ uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const std::vector> parameter) +int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) { int64_t value = 0LL; int32_t num_of_slices = parameter.size(); // read the MSB and perform the sign extension - if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1) + if (static_cast(bits[GPS_SUBFRAME_BITS - parameter[0].first]) == 1) { value ^= 0xFFFFFFFFFFFFFFFFLL; // 64 bits variable } @@ -216,7 +216,7 @@ int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset(bits[GPS_SUBFRAME_BITS - parameter[i].first - j]) == 1) { value += 1LL; // insert the bit } @@ -226,7 +226,7 @@ int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) { //! \TODO read almanac - if (SV_data_ID) + if (SV_data_ID != 0) { } } @@ -428,7 +428,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char *subframe) if (SV_page_5 < 25) { //! \TODO read almanac - if (SV_data_ID_5) + if (SV_data_ID_5 != 0) { } } @@ -510,7 +510,7 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const * proper accommodation of the leap second event with a possible week number * transition is provided by the following expression for UTC: */ - int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = static_cast(fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400)) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); //implement something to handle a leap second event! } diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 595d74d30..7c70e25c9 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -54,9 +54,9 @@ class Gps_Navigation_Message { private: - uint64_t read_navigation_unsigned(std::bitset bits, const std::vector> parameter); - int64_t read_navigation_signed(std::bitset bits, const std::vector> parameter); - bool read_navigation_bool(std::bitset bits, const std::vector> parameter); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); + bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); void print_gps_word_bytes(uint32_t GPS_word); public: @@ -198,7 +198,7 @@ public: /*! * \brief Decodes the GPS NAV message */ - int32_t subframe_decoder(char *subframe); + int32_t subframe_decoder(char* subframe); /*! * \brief Computes the Coordinated Universal Time (UTC) and diff --git a/src/core/system_parameters/gps_utc_model.cc b/src/core/system_parameters/gps_utc_model.cc index 0f9a5744e..c29a61e5d 100644 --- a/src/core/system_parameters/gps_utc_model.cc +++ b/src/core/system_parameters/gps_utc_model.cc @@ -84,7 +84,7 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week) * proper accommodation of the leap second event with a possible week number * transition is provided by the following expression for UTC: */ - int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = static_cast(fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400)) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); // implement something to handle a leap second event! }