1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-15 19:55:47 +00:00
This commit is contained in:
Carles Fernandez 2019-08-13 01:52:15 +02:00
commit 4b62f9bc65
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
102 changed files with 2521 additions and 665 deletions

View File

@ -7,15 +7,19 @@ Checks: '-*,
cert-err52-cpp, cert-err52-cpp,
cert-err60-cpp, cert-err60-cpp,
cert-flp30-c, cert-flp30-c,
clang-analyzer-cplusplus*, cert-msc50-cpp,
cert-msc51-cpp,
clang-analyzer-cplusplus.*,
cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-pro-type-static-cast-downcast, cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing, cppcoreguidelines-slicing,
cppcoreguidelines-special-member-functions, cppcoreguidelines-special-member-functions,
google-build-namespaces, google-build-namespaces,
google-global-names-in-headers,
google-runtime-int, google-runtime-int,
hicpp-exception-baseclass, hicpp-exception-baseclass,
hicpp-explicit-conversions, hicpp-explicit-conversions,
hicpp-noexcept-move,
misc-misplaced-const, misc-misplaced-const,
misc-new-delete-overloads, misc-new-delete-overloads,
misc-non-copyable-objects, misc-non-copyable-objects,
@ -23,6 +27,8 @@ Checks: '-*,
misc-throw-by-value-catch-by-reference, misc-throw-by-value-catch-by-reference,
misc-uniqueptr-reset-release, misc-uniqueptr-reset-release,
misc-unused-using-decls, misc-unused-using-decls,
modernize-avoid-bind,
modernize-deprecated-headers,
modernize-loop-convert, modernize-loop-convert,
modernize-pass-by-value, modernize-pass-by-value,
modernize-raw-string-literal, modernize-raw-string-literal,
@ -33,6 +39,7 @@ Checks: '-*,
modernize-use-equals-delete, modernize-use-equals-delete,
modernize-use-noexcept, modernize-use-noexcept,
modernize-use-nullptr, modernize-use-nullptr,
modernize-use-override,
performance-faster-string-find, performance-faster-string-find,
performance-for-range-copy, performance-for-range-copy,
performance-implicit-conversion-in-loop, performance-implicit-conversion-in-loop,
@ -45,19 +52,35 @@ Checks: '-*,
performance-type-promotion-in-math-fn, performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization, performance-unnecessary-copy-initialization,
performance-unnecessary-value-param, performance-unnecessary-value-param,
readability-avoid-const-params-in-decls,
readability-container-size-empty, readability-container-size-empty,
readability-identifier-naming, readability-identifier-naming,
readability-inconsistent-declaration-parameter-name, readability-inconsistent-declaration-parameter-name,
readability-isolate-declaration,
readability-named-parameter, readability-named-parameter,
readability-non-const-parameter, readability-non-const-parameter,
readability-string-compare' readability-redundant-control-flow,
readability-string-compare,
readability-uppercase-literal-suffix'
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: '' HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false AnalyzeTemporaryDtors: false
FormatStyle: 'file' FormatStyle: 'file'
CheckOptions: CheckOptions:
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-msc51-cpp.DisallowedSeedTypes
value: 'time_t,std::time_t'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
value: '0'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: '0'
- key: google-build-namespaces.HeaderFileExtensions - key: google-build-namespaces.HeaderFileExtensions
value: ',h' value: ',h'
- key: google-global-names-in-headers.HeaderFileExtensions
value: ',h,hh,hpp,hxx'
- key: google-readability-braces-around-statements.ShortStatementLines - key: google-readability-braces-around-statements.ShortStatementLines
value: '1' value: '1'
- key: google-readability-function-size.StatementThreshold - key: google-readability-function-size.StatementThreshold
@ -92,8 +115,18 @@ CheckOptions:
value: '5' value: '5'
- key: modernize-use-auto.RemoveStars - key: modernize-use-auto.RemoveStars
value: '0' value: '0'
- key: modernize-use-emplace.ContainersWithPushBack
value: '::std::vector;::std::list;::std::deque'
- key: modernize-use-emplace.SmartPointers
value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr'
- key: modernize-use-emplace.TupleMakeFunctions
value: '::std::make_pair;::std::make_tuple'
- key: modernize-use-emplace.TupleTypes
value: '::std::pair;::std::tuple'
- key: modernize-use-equals-default.IgnoreMacros - key: modernize-use-equals-default.IgnoreMacros
value: '1' value: '1'
- key: modernize-use-equals-delete.IgnoreMacros
value: '1'
- key: modernize-use-noexcept.ReplacementString - key: modernize-use-noexcept.ReplacementString
value: '' value: ''
- key: modernize-use-noexcept.UseNoexceptFalse - key: modernize-use-noexcept.UseNoexceptFalse
@ -102,10 +135,24 @@ CheckOptions:
value: 'NULL' value: 'NULL'
- key: performance-faster-string-find.StringLikeClasses - key: performance-faster-string-find.StringLikeClasses
value: 'std::basic_string' value: 'std::basic_string'
- key: performance-for-range-copy.AllowedTypes
value: ''
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: '0'
- key: performance-inefficient-string-concatenation.StrictMode
value: '0'
- key: performance-inefficient-vector-operation.VectorLikeClasses
value: '::std::vector'
- key: performance-move-const-arg.CheckTriviallyCopyableMove - key: performance-move-const-arg.CheckTriviallyCopyableMove
value: '1' value: '1'
- key: performance-move-constructor-init.IncludeStyle
value: llvm
- key: performance-type-promotion-in-math-fn.IncludeStyle - key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm value: llvm
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: ''
- key: performance-unnecessary-value-param.AllowedTypes
value: ''
- key: performance-unnecessary-value-param.IncludeStyle - key: performance-unnecessary-value-param.IncludeStyle
value: llvm value: llvm
- key: readability-identifier-naming.AbstractClassCase - key: readability-identifier-naming.AbstractClassCase
@ -138,4 +185,8 @@ CheckOptions:
value: '1' value: '1'
- key: readability-inconsistent-declaration-parameter-name.Strict - key: readability-inconsistent-declaration-parameter-name.Strict
value: '0' value: '0'
- key: readability-uppercase-literal-suffix.IgnoreMacros
value: '1'
- key: readability-uppercase-literal-suffix.NewSuffixes
value: ''
... ...

View File

@ -69,7 +69,7 @@ option(ENABLE_OPENCL "Enable building of processing blocks implemented with Open
option(ENABLE_CUDA "Enable building of processing blocks implemented with CUDA (experimental, requires CUDA SDK)" OFF) option(ENABLE_CUDA "Enable building of processing blocks implemented with CUDA (experimental, requires CUDA SDK)" OFF)
option(ENABLE_FPGA "Enable building of processing blocks implemented with FPGA" OFF) option(ENABLE_FPGA "Enable building of processing blocks implementing FPGA offloading" OFF)
# Building and packaging options # Building and packaging options
option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF) option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF)
@ -82,8 +82,11 @@ option(ENABLE_OWN_ARMADILLO "Download and build Armadillo locally" OFF)
option(ENABLE_LOG "Enable logging" ON) option(ENABLE_LOG "Enable logging" ON)
option(ENABLE_ARMA_NO_DEBUG OFF)
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
set(ENABLE_GENERIC_ARCH ON) set(ENABLE_GENERIC_ARCH ON)
set(ENABLE_ARMA_NO_DEBUG ON)
endif() endif()
# Testing # Testing
@ -138,7 +141,7 @@ if(NOT ${THIS_IS_A_RELEASE})
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
endif(NOT GIT_BRANCH) endif()
# was this info set in the CMake commandline? # was this info set in the CMake commandline?
if(NOT GIT_COMMIT_HASH) if(NOT GIT_COMMIT_HASH)
# Get the latest abbreviated commit hash of the working branch # Get the latest abbreviated commit hash of the working branch
@ -148,7 +151,7 @@ if(NOT ${THIS_IS_A_RELEASE})
OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
endif(NOT GIT_COMMIT_HASH) endif()
endif() endif()
endif() endif()
@ -756,7 +759,7 @@ if(CMAKE_VERSION VERSION_LESS 3.5)
INTERFACE_LINK_LIBRARIES ${Boost_FILESYSTEM_LIBRARIES} INTERFACE_LINK_LIBRARIES ${Boost_FILESYSTEM_LIBRARIES}
IMPORTED_LOCATION ${Boost_FILESYSTEM_LIBRARIES} IMPORTED_LOCATION ${Boost_FILESYSTEM_LIBRARIES}
) )
endif() endif()
endif() endif()
endif() endif()
@ -1464,6 +1467,7 @@ find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27
/usr/lib/powerpc64-linux-gnu /usr/lib/powerpc64-linux-gnu
/usr/lib/powerpc64le-linux-gnu /usr/lib/powerpc64le-linux-gnu
/usr/lib/s390x-linux-gnu /usr/lib/s390x-linux-gnu
/usr/lib/riscv64-linux-gnu
/usr/lib/sparc64-linux-gnu /usr/lib/sparc64-linux-gnu
/usr/lib/x86_64-linux-gnux32 /usr/lib/x86_64-linux-gnux32
/usr/lib/sh4-linux-gnu /usr/lib/sh4-linux-gnu
@ -2148,11 +2152,11 @@ endif()
# FPGA (OPTIONAL) # FPGA (OPTIONAL)
################################################################################ ################################################################################
if(ENABLE_FPGA) if(ENABLE_FPGA)
message(STATUS "FPGA Acceleration will be enabled.") message(STATUS "FPGA offloading will be enabled.")
message(STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'") message(STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'")
else() else()
message(STATUS "Fpga Acceleration will be not enabled.") message(STATUS "FPGA offloading will be not enabled.")
message(STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for GPU-based acceleration using the FPGA.") message(STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for FPGA offloading.")
endif() endif()
@ -2459,7 +2463,8 @@ add_feature_info(ENABLE_CLANG_TIDY ENABLE_CLANG_TIDY "Runs clang-tidy along with
add_feature_info(ENABLE_PROFILING ENABLE_PROFILING "Runs volk_gnsssdr_profile at the end of the building.") add_feature_info(ENABLE_PROFILING ENABLE_PROFILING "Runs volk_gnsssdr_profile at the end of the building.")
add_feature_info(ENABLE_OPENCL ENABLE_OPENCL "Enables GPS_L1_CA_PCPS_OpenCl_Acquisition (experimental). Requires OpenCL.") add_feature_info(ENABLE_OPENCL ENABLE_OPENCL "Enables GPS_L1_CA_PCPS_OpenCl_Acquisition (experimental). Requires OpenCL.")
add_feature_info(ENABLE_CUDA ENABLE_CUDA "Enables GPS_L1_CA_DLL_PLL_Tracking_GPU (experimental). Requires CUDA.") add_feature_info(ENABLE_CUDA ENABLE_CUDA "Enables GPS_L1_CA_DLL_PLL_Tracking_GPU (experimental). Requires CUDA.")
add_feature_info(ENABLE_FPGA ENABLE_FPGA "Enables building of processing blocks for FPGA off-loading.") add_feature_info(ENABLE_FPGA ENABLE_FPGA "Enables building of processing blocks for FPGA offloading.")
add_feature_info(ENABLE_ARMA_NO_DEBUG ENABLE_ARMA_NO_DEBUG "Enables passing the ARMA_NO_DEBUG macro to Armadillo, hence disabling bound checking.")
add_feature_info(ENABLE_GENERIC_ARCH ENABLE_GENERIC_ARCH "When disabled, flags such as '-march=native' are passed to the compiler.") add_feature_info(ENABLE_GENERIC_ARCH ENABLE_GENERIC_ARCH "When disabled, flags such as '-march=native' are passed to the compiler.")
add_feature_info(ENABLE_PACKAGING ENABLE_PACKAGING "Enables software packaging.") add_feature_info(ENABLE_PACKAGING ENABLE_PACKAGING "Enables software packaging.")
add_feature_info(ENABLE_OWN_GLOG ENABLE_OWN_GLOG "Forces the downloading and building of Google glog.") add_feature_info(ENABLE_OWN_GLOG ENABLE_OWN_GLOG "Forces the downloading and building of Google glog.")

View File

@ -1,14 +1,34 @@
## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next)
### Improvements in Maintainability:
- New CMake option ENABLE_ARMA_NO_DEBUG defines the macro ARMA_NO_DEBUG, which disables all run-time checks, such as bounds checking, in the Armadillo library. This will result in faster code. This option is disabled by default during development, but automatically set to ON if the option ENABLE_PACKAGING is set to ON.
- Apply more clang-tidy checks related to readability: readability-avoid-const-params-in-decls, readability-isolate-declaration, readability-redundant-control-flow, readability-uppercase-literal-suffix.
- Add more check options to .clang-tidy file.
### Improvements in Portability:
- The CMake scripts now find dependencies in Debian's riscv64 architecture.
See the definitions of concepts and metrics at https://gnss-sdr.org/design-forces/
## [0.0.11](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.11) ## [0.0.11](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.11)
This release has several improvements in different dimensions, addition of new features and bug fixes: This release has several improvements in different dimensions, addition of new features and bug fixes:
### Improvements in Accuracy ### Improvements in Accuracy:
- Local clock correction based on PVT solution, allowing the delivery of continuous observables. - Local clock correction based on PVT solution, allowing the delivery of continuous observables.
- Fix a bug in broadcast ionospheric parameters usage. - Fix a bug in broadcast ionospheric parameters usage.
### Improvements in Availability ### Improvements in Availability:
- Improved mechanism for false lock detection in the Tracking loops. - Improved mechanism for false lock detection in the Tracking loops.
- Fixed bug in Galileo INAV/FNAV message decoding when PLL is locked at 180 degrees, which prevented from correct navigation message decoding in some situations. - Fixed bug in Galileo INAV/FNAV message decoding when PLL is locked at 180 degrees, which prevented from correct navigation message decoding in some situations.
@ -17,7 +37,7 @@ This release has several improvements in different dimensions, addition of new f
- Improved signal acquisition and tracking mechanisms in high dynamic scenarios. - Improved signal acquisition and tracking mechanisms in high dynamic scenarios.
### Improvements in Efficiency ### Improvements in Efficiency:
- Added mechanism for assisted acquisition of signals on a secondary band when the primary has already been acquired. This allows a great reduction of the computational load in multi-frequency configurations. - Added mechanism for assisted acquisition of signals on a secondary band when the primary has already been acquired. This allows a great reduction of the computational load in multi-frequency configurations.
- Tracking loops now perform bit synchronization, simplifying the decoding process in Telemetry blocks and FPGA-offloading. - Tracking loops now perform bit synchronization, simplifying the decoding process in Telemetry blocks and FPGA-offloading.
@ -69,14 +89,14 @@ This release has several improvements in different dimensions, addition of new f
- Drawback in portability: Protocol Buffers >= 3.0.0 is a new required dependency. - Drawback in portability: Protocol Buffers >= 3.0.0 is a new required dependency.
### Improvements in Reliability ### Improvements in Reliability:
- Included the Guidelines Support Library. General improvement of memory management, replacement of raw pointers by containers or smart pointers. - Included the Guidelines Support Library. General improvement of memory management, replacement of raw pointers by containers or smart pointers.
- Applied clang-tidy checks and fixes related to High Integrity C++: performance-move-const-arg, modernize-use-auto, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-noexcept, modernize-use-nullptr, cert-dcl21-cpp, misc-new-delete-overloads, cert-dcl58-cpp, cert-err52-cpp, cert-err60-cpp, hicpp-exception-baseclass, hicpp-explicit-conversions. - Applied clang-tidy checks and fixes related to High Integrity C++: performance-move-const-arg, modernize-use-auto, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-noexcept, modernize-use-nullptr, cert-dcl21-cpp, misc-new-delete-overloads, cert-dcl58-cpp, cert-err52-cpp, cert-err60-cpp, hicpp-exception-baseclass, hicpp-explicit-conversions.
- Fixed a number of defects detected by Coverity Scan (version June 2019). - Fixed a number of defects detected by Coverity Scan (version June 2019).
### Improvements in Usability ### Improvements in Usability:
- The receiver now admits FPGA off-loading, allowing for real time operation in embedded systems at high sampling rates and high number of signals and channels per signal in multiple bands. - The receiver now admits FPGA off-loading, allowing for real time operation in embedded systems at high sampling rates and high number of signals and channels per signal in multiple bands.
- Fixed program termination (avoiding hangs and segfaults in some platforms/configurations). - Fixed program termination (avoiding hangs and segfaults in some platforms/configurations).

View File

@ -95,7 +95,7 @@ target_include_directories(pvt_libs
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
if(CMAKE_BUILD_TYPE MATCHES Rel) if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(pvt_libs target_compile_definitions(pvt_libs
PUBLIC -DARMA_NO_BOUND_CHECKING=1 PUBLIC -DARMA_NO_BOUND_CHECKING=1
) )

View File

@ -245,7 +245,13 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path)
Rinex_Printer::~Rinex_Printer() Rinex_Printer::~Rinex_Printer()
{ {
// close RINEX files // close RINEX files
int64_t posn, poso, poss, posng, posmn, posnr, posnc; int64_t posn;
int64_t poso;
int64_t poss;
int64_t posng;
int64_t posmn;
int64_t posnr;
int64_t posnc;
posn = navFile.tellp(); posn = navFile.tellp();
poso = obsFile.tellp(); poso = obsFile.tellp();
poss = sbsFile.tellp(); poss = sbsFile.tellp();

View File

@ -105,7 +105,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data; int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
{ {

View File

@ -106,7 +106,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data; int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (uint32_t PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) for (uint32_t PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
{ {

View File

@ -98,7 +98,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; float max;
int32_t tmp, tmp2, local_code, fft_data; int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
// temporary maxima search // temporary maxima search
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{ {

View File

@ -101,7 +101,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data; int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
{ {

View File

@ -102,7 +102,10 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data; int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{ {

View File

@ -91,7 +91,7 @@ target_include_directories(acquisition_gr_blocks
${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/core/receiver
) )
if(CMAKE_BUILD_TYPE MATCHES Rel) if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(acquisition_gr_blocks target_compile_definitions(acquisition_gr_blocks
PUBLIC -DARMA_NO_BOUND_CHECKING=1 PUBLIC -DARMA_NO_BOUND_CHECKING=1
) )

View File

@ -118,7 +118,7 @@ if(ENABLE_OPENCL)
) )
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Rel) if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(algorithms_libs target_compile_definitions(algorithms_libs
PUBLIC -DARMA_NO_BOUND_CHECKING=1 PUBLIC -DARMA_NO_BOUND_CHECKING=1
) )

View File

@ -46,9 +46,11 @@ void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _c
std::bitset<11> G1_register(std::string("01010101010")); std::bitset<11> G1_register(std::string("01010101010"));
std::bitset<11> G2_register(std::string("01010101010")); std::bitset<11> G2_register(std::string("01010101010"));
bool feedback1, feedback2; bool feedback1;
bool feedback2;
bool aux; bool aux;
uint32_t lcv, lcv2; uint32_t lcv;
uint32_t lcv2;
uint32_t delay; uint32_t delay;
int32_t prn_idx; int32_t prn_idx;
@ -145,7 +147,8 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
{ {
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book // This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 2046> _code{}; std::array<std::complex<float>, 2046> _code{};
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
float aux; float aux;

View File

@ -48,8 +48,12 @@ void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_
G1_register_reset.reset(0); G1_register_reset.reset(0);
G1_register_reset.reset(1); // {false, false, true, true, true, true, true, true, true, true, true, true, true}; G1_register_reset.reset(1); // {false, false, true, true, true, true, true, true, true, true, true, true, true};
bool feedback1, feedback2, aux; bool feedback1;
uint32_t lcv, lcv2, delay; bool feedback2;
bool aux;
uint32_t lcv;
uint32_t lcv2;
uint32_t delay;
int32_t prn_idx = _prn - 1; int32_t prn_idx = _prn - 1;
const std::array<std::bitset<13>, 63> G2_register_shifted = const std::array<std::bitset<13>, 63> G2_register_shifted =
@ -207,7 +211,8 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
{ {
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book // This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 10230> _code{}; std::array<std::complex<float>, 10230> _code{};
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
float aux; float aux;

View File

@ -44,7 +44,8 @@ void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32
bool feedback1; bool feedback1;
bool aux; bool aux;
uint32_t delay; uint32_t delay;
uint32_t lcv, lcv2; uint32_t lcv;
uint32_t lcv2;
/* Generate G1 Register */ /* Generate G1 Register */
for (lcv = 0; lcv < _code_length; lcv++) for (lcv = 0; lcv < _code_length; lcv++)
@ -105,7 +106,8 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
{ {
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book // This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 511> _code{}; std::array<std::complex<float>, 511> _code{};
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
float aux; float aux;

View File

@ -44,7 +44,8 @@ void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32
bool feedback1; bool feedback1;
bool aux; bool aux;
uint32_t delay; uint32_t delay;
uint32_t lcv, lcv2; uint32_t lcv;
uint32_t lcv2;
/* Generate G1 Register */ /* Generate G1 Register */
for (lcv = 0; lcv < _code_length; lcv++) for (lcv = 0; lcv < _code_length; lcv++)
@ -105,7 +106,8 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
{ {
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book // This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 511> _code{}; std::array<std::complex<float>, 511> _code{};
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
float aux; float aux;

View File

@ -96,7 +96,8 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
gps_l2c_m_code(_code, _prn); gps_l2c_m_code(_code, _prn);
} }
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS; const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;

View File

@ -213,7 +213,8 @@ void gps_l5i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
make_l5i(_code, _prn - 1); make_l5i(_code, _prn - 1);
} }
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS; const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
@ -287,7 +288,8 @@ void gps_l5q_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
make_l5q(_code, _prn - 1); make_l5q(_code, _prn - 1);
} }
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS; const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;

View File

@ -43,9 +43,11 @@ void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _ch
std::bitset<_code_length> G2{}; std::bitset<_code_length> G2{};
std::bitset<10> G1_register{}; std::bitset<10> G1_register{};
std::bitset<10> G2_register{}; std::bitset<10> G2_register{};
bool feedback1, feedback2; bool feedback1;
bool feedback2;
bool aux; bool aux;
uint32_t lcv, lcv2; uint32_t lcv;
uint32_t lcv2;
uint32_t delay; uint32_t delay;
int32_t prn_idx; int32_t prn_idx;
@ -155,7 +157,8 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
{ {
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book // This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 1023> _code{}; std::array<std::complex<float>, 1023> _code{};
int32_t _samplesPerCode, _codeValueIndex; int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
float aux; float aux;

View File

@ -132,7 +132,8 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro
geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model) geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model)
{ {
double week, sec; double week;
double sec;
int adj_week; int adj_week;
geph_t rtklib_sat = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0}; geph_t rtklib_sat = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0};
@ -206,7 +207,8 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph)
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gal_eph.TOW_5); rtklib_sat.ttr = gpst2time(rtklib_sat.week, gal_eph.TOW_5);
/* adjustment for week handover */ /* adjustment for week handover */
double tow, toc; double tow;
double toc;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr); toc = time2gpst(rtklib_sat.toc, nullptr);
if (rtklib_sat.toes < tow - 302400.0) if (rtklib_sat.toes < tow - 302400.0)
@ -263,7 +265,8 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph)
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_eph.d_TOW); rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_eph.d_TOW);
/* adjustment for week handover */ /* adjustment for week handover */
double tow, toc; double tow;
double toc;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr); toc = time2gpst(rtklib_sat.toc, nullptr);
if (rtklib_sat.toes < tow - 302400.0) if (rtklib_sat.toes < tow - 302400.0)
@ -328,7 +331,9 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
rtklib_sat.toc = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_Toc)); rtklib_sat.toc = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_Toc));
rtklib_sat.ttr = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_TOW)); rtklib_sat.ttr = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_TOW));
/* adjustment for week handover */ /* adjustment for week handover */
double tow, toc, toe; double tow;
double toc;
double toe;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr); toc = time2gpst(rtklib_sat.toc, nullptr);
toe = time2gpst(rtklib_sat.toe, nullptr); toe = time2gpst(rtklib_sat.toe, nullptr);
@ -395,7 +400,8 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph)
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_cnav_eph.d_TOW); rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_cnav_eph.d_TOW);
/* adjustment for week handover */ /* adjustment for week handover */
double tow, toc; double tow;
double toc;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr); toc = time2gpst(rtklib_sat.toc, nullptr);
if (rtklib_sat.toes < tow - 302400.0) if (rtklib_sat.toes < tow - 302400.0)

View File

@ -123,7 +123,22 @@ double var_urassr(int ura)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void alm2pos(gtime_t time, const alm_t *alm, double *rs, double *dts) void alm2pos(gtime_t time, const alm_t *alm, double *rs, double *dts)
{ {
double tk, M, E, Ek, sinE, cosE, u, r, i, O, x, y, sinO, cosO, cosi, mu; double tk;
double M;
double E;
double Ek;
double sinE;
double cosE;
double u;
double r;
double i;
double O;
double x;
double y;
double sinO;
double cosO;
double cosi;
double mu;
int n; int n;
trace(4, "alm2pos : time=%s sat=%2d\n", time_str(time, 3), alm->sat); trace(4, "alm2pos : time=%s sat=%2d\n", time_str(time, 3), alm->sat);
@ -207,9 +222,33 @@ double eph2clk(gtime_t time, const eph_t *eph)
void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts, void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts,
double *var) double *var)
{ {
double tk, M, E, Ek, sinE, cosE, u, r, i, O, sin2u, cos2u, x, y, sinO, cosO, cosi, mu, omge; double tk;
double xg, yg, zg, sino, coso; double M;
int n, sys, prn; double E;
double Ek;
double sinE;
double cosE;
double u;
double r;
double i;
double O;
double sin2u;
double cos2u;
double x;
double y;
double sinO;
double cosO;
double cosi;
double mu;
double omge;
double xg;
double yg;
double zg;
double sino;
double coso;
int n;
int sys;
int prn;
trace(4, "eph2pos : time=%s sat=%2d\n", time_str(time, 3), eph->sat); trace(4, "eph2pos : time=%s sat=%2d\n", time_str(time, 3), eph->sat);
@ -302,7 +341,12 @@ void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts,
/* glonass orbit differential equations --------------------------------------*/ /* glonass orbit differential equations --------------------------------------*/
void deq(const double *x, double *xdot, const double *acc) void deq(const double *x, double *xdot, const double *acc)
{ {
double a, b, c, r2 = dot(x, x, 3), r3 = r2 * sqrt(r2), omg2 = std::pow(OMGE_GLO, 2.0); double a;
double b;
double c;
double r2 = dot(x, x, 3);
double r3 = r2 * sqrt(r2);
double omg2 = std::pow(OMGE_GLO, 2.0);
if (r2 <= 0.0) if (r2 <= 0.0)
{ {
@ -325,7 +369,11 @@ void deq(const double *x, double *xdot, const double *acc)
/* glonass position and velocity by numerical integration --------------------*/ /* glonass position and velocity by numerical integration --------------------*/
void glorbit(double t, double *x, const double *acc) void glorbit(double t, double *x, const double *acc)
{ {
double k1[6], k2[6], k3[6], k4[6], w[6]; double k1[6];
double k2[6];
double k3[6];
double k4[6];
double w[6];
int i; int i;
deq(x, k1, acc); deq(x, k1, acc);
@ -388,7 +436,9 @@ double geph2clk(gtime_t time, const geph_t *geph)
void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts,
double *var) double *var)
{ {
double t, tt, x[6]; double t;
double tt;
double x[6];
int i; int i;
trace(4, "geph2pos: time=%s sat=%2d\n", time_str(time, 3), geph->sat); trace(4, "geph2pos: time=%s sat=%2d\n", time_str(time, 3), geph->sat);
@ -476,8 +526,11 @@ void seph2pos(gtime_t time, const seph_t *seph, double *rs, double *dts,
/* select ephemeris --------------------------------------------------------*/ /* select ephemeris --------------------------------------------------------*/
eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav) eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
{ {
double t, tmax, tmin; double t;
int i, j = -1; double tmax;
double tmin;
int i;
int j = -1;
trace(4, "seleph : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode); trace(4, "seleph : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode);
@ -535,8 +588,11 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
/* select glonass ephemeris ------------------------------------------------*/ /* select glonass ephemeris ------------------------------------------------*/
geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav) geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav)
{ {
double t, tmax = MAXDTOE_GLO, tmin = tmax + 1.0; double t;
int i, j = -1; double tmax = MAXDTOE_GLO;
double tmin = tmax + 1.0;
int i;
int j = -1;
trace(4, "selgeph : time=%s sat=%2d iode=%2d\n", time_str(time, 3), sat, iode); trace(4, "selgeph : time=%s sat=%2d iode=%2d\n", time_str(time, 3), sat, iode);
@ -577,8 +633,11 @@ geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav)
/* select sbas ephemeris ---------------------------------------------------*/ /* select sbas ephemeris ---------------------------------------------------*/
seph_t *selseph(gtime_t time, int sat, const nav_t *nav) seph_t *selseph(gtime_t time, int sat, const nav_t *nav)
{ {
double t, tmax = MAXDTOE_SBS, tmin = tmax + 1.0; double t;
int i, j = -1; double tmax = MAXDTOE_SBS;
double tmin = tmax + 1.0;
int i;
int j = -1;
trace(4, "selseph : time=%s sat=%2d\n", time_str(time, 3), sat); trace(4, "selseph : time=%s sat=%2d\n", time_str(time, 3), sat);
@ -660,8 +719,11 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav,
eph_t *eph; eph_t *eph;
geph_t *geph; geph_t *geph;
seph_t *seph; seph_t *seph;
double rst[3], dtst[1], tt = 1e-3; double rst[3];
int i, sys; double dtst[1];
double tt = 1e-3;
int i;
int sys;
trace(4, "ephpos : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode); trace(4, "ephpos : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode);
@ -767,8 +829,19 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav,
{ {
const ssr_t *ssr; const ssr_t *ssr;
eph_t *eph; eph_t *eph;
double t1, t2, t3, er[3], ea[3], ec[3], rc[3], deph[3], dclk, dant[3] = {0}, tk; double t1;
int i, sys; double t2;
double t3;
double er[3];
double ea[3];
double ec[3];
double rc[3];
double deph[3];
double dclk;
double dant[3] = {0};
double tk;
int i;
int sys;
trace(4, "satpos_ssr: time=%s sat=%2d\n", time_str(time, 3), sat); trace(4, "satpos_ssr: time=%s sat=%2d\n", time_str(time, 3), sat);
@ -969,8 +1042,10 @@ void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav,
int ephopt, double *rs, double *dts, double *var, int *svh) int ephopt, double *rs, double *dts, double *var, int *svh)
{ {
gtime_t time[MAXOBS] = {}; gtime_t time[MAXOBS] = {};
double dt, pr; double dt;
int i, j; double pr;
int i;
int j;
trace(3, "satposs : teph=%s n=%d ephopt=%d\n", time_str(teph, 3), n, ephopt); trace(3, "satposs : teph=%s n=%d ephopt=%d\n", time_str(teph, 3), n, ephopt);

View File

@ -102,9 +102,12 @@ int dataindex(int i, int j, int k, const int *ndata)
tec_t *addtec(const double *lats, const double *lons, const double *hgts, tec_t *addtec(const double *lats, const double *lons, const double *hgts,
double rb, nav_t *nav) double rb, nav_t *nav)
{ {
tec_t *p, *nav_tec; tec_t *p;
tec_t *nav_tec;
gtime_t time0 = {0, 0}; gtime_t time0 = {0, 0};
int i, n, ndata[3]; int i;
int n;
int ndata[3];
trace(3, "addtec :\n"); trace(3, "addtec :\n");
@ -159,8 +162,11 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts,
/* read ionex dcb aux data ----------------------------------------------------*/ /* read ionex dcb aux data ----------------------------------------------------*/
void readionexdcb(FILE *fp, double *dcb, double *rms) void readionexdcb(FILE *fp, double *dcb, double *rms)
{ {
int i, sat; int i;
char buff[1024], id[32], *label; int sat;
char buff[1024];
char id[32];
char *label;
trace(3, "readionexdcb:\n"); trace(3, "readionexdcb:\n");
@ -203,7 +209,8 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts,
double *rb, double *nexp, double *dcb, double *rms) double *rb, double *nexp, double *dcb, double *rms)
{ {
double ver = 0.0; double ver = 0.0;
char buff[1024], *label; char buff[1024];
char *label;
trace(3, "readionexh:\n"); trace(3, "readionexh:\n");
@ -268,9 +275,19 @@ int readionexb(FILE *fp, const double *lats, const double *lons,
{ {
tec_t *p = nullptr; tec_t *p = nullptr;
gtime_t time = {0, 0}; gtime_t time = {0, 0};
double lat, lon[3], hgt, x; double lat;
int i, j, k, n, m, index, type = 0; double lon[3];
char buff[1024], *label = buff + 60; double hgt;
double x;
int i;
int j;
int k;
int n;
int m;
int index;
int type = 0;
char buff[1024];
char *label = buff + 60;
trace(3, "readionexb:\n"); trace(3, "readionexb:\n");
@ -376,7 +393,9 @@ int readionexb(FILE *fp, const double *lats, const double *lons,
void combtec(nav_t *nav) void combtec(nav_t *nav)
{ {
tec_t tmp; tec_t tmp;
int i, j, n = 0; int i;
int j;
int n = 0;
trace(3, "combtec : nav->nt=%d\n", nav->nt); trace(3, "combtec : nav->nt=%d\n", nav->nt);
@ -422,9 +441,15 @@ void combtec(nav_t *nav)
void readtec(const char *file, nav_t *nav, int opt) void readtec(const char *file, nav_t *nav, int opt)
{ {
FILE *fp; FILE *fp;
double lats[3] = {0}, lons[3] = {0}, hgts[3] = {0}, rb = 0.0, nexp = -1.0; double lats[3] = {0};
double dcb[MAXSAT] = {0}, rms[MAXSAT] = {0}; double lons[3] = {0};
int i, n; double hgts[3] = {0};
double rb = 0.0;
double nexp = -1.0;
double dcb[MAXSAT] = {0};
double rms[MAXSAT] = {0};
int i;
int n;
char *efiles[MAXEXFILE]; char *efiles[MAXEXFILE];
trace(3, "readtec : file=%s\n", file); trace(3, "readtec : file=%s\n", file);
@ -493,8 +518,16 @@ void readtec(const char *file, nav_t *nav, int opt)
int interptec(const tec_t *tec, int k, const double *posp, double *value, int interptec(const tec_t *tec, int k, const double *posp, double *value,
double *rms) double *rms)
{ {
double dlat, dlon, a, b, d[4] = {0}, r[4] = {0}; double dlat;
int i, j, n, index; double dlon;
double a;
double b;
double d[4] = {0};
double r[4] = {0};
int i;
int j;
int n;
int index;
trace(3, "interptec: k=%d posp=%.2f %.2f\n", k, posp[0] * R2D, posp[1] * R2D); trace(3, "interptec: k=%d posp=%.2f %.2f\n", k, posp[0] * R2D, posp[1] * R2D);
*value = *rms = 0.0; *value = *rms = 0.0;
@ -587,7 +620,12 @@ int iondelay(gtime_t time, const tec_t *tec, const double *pos,
const double *azel, int opt, double *delay, double *var) const double *azel, int opt, double *delay, double *var)
{ {
const double fact = 40.30E16 / FREQ1 / FREQ1; /* tecu->L1 iono (m) */ const double fact = 40.30E16 / FREQ1 / FREQ1; /* tecu->L1 iono (m) */
double fs, posp[3] = {0}, vtec, rms, hion, rp; double fs;
double posp[3] = {0};
double vtec;
double rms;
double hion;
double rp;
int i; int i;
trace(3, "iondelay: time=%s pos=%.1f %.1f azel=%.1f %.1f\n", time_str(time, 0), trace(3, "iondelay: time=%s pos=%.1f %.1f azel=%.1f %.1f\n", time_str(time, 0),
@ -646,8 +684,12 @@ int iondelay(gtime_t time, const tec_t *tec, const double *pos,
int iontec(gtime_t time, const nav_t *nav, const double *pos, int iontec(gtime_t time, const nav_t *nav, const double *pos,
const double *azel, int opt, double *delay, double *var) const double *azel, int opt, double *delay, double *var)
{ {
double dels[2], vars[2], a, tt; double dels[2];
int i, stat[2]; double vars[2];
double a;
double tt;
int i;
int stat[2];
trace(3, "iontec : time=%s pos=%.1f %.1f azel=%.1f %.1f\n", time_str(time, 0), trace(3, "iontec : time=%s pos=%.1f %.1f azel=%.1f %.1f\n", time_str(time, 0),
pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, azel[1] * R2D); pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, azel[1] * R2D);

View File

@ -57,8 +57,12 @@
/* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/ /* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/
int LD(int n, const double *Q, double *L, double *D) int LD(int n, const double *Q, double *L, double *D)
{ {
int i, j, k, info = 0; int i;
double a, *A = mat(n, n); int j;
int k;
int info = 0;
double a;
double *A = mat(n, n);
memcpy(A, Q, sizeof(double) * n * n); memcpy(A, Q, sizeof(double) * n * n);
for (i = n - 1; i >= 0; i--) for (i = n - 1; i >= 0; i--)
@ -97,7 +101,8 @@ int LD(int n, const double *Q, double *L, double *D)
/* integer gauss transformation ----------------------------------------------*/ /* integer gauss transformation ----------------------------------------------*/
void gauss(int n, double *L, double *Z, int i, int j) void gauss(int n, double *L, double *Z, int i, int j)
{ {
int k, mu; int k;
int mu;
if ((mu = static_cast<int> ROUND_LAMBDA(L[i + j * n])) != 0) if ((mu = static_cast<int> ROUND_LAMBDA(L[i + j * n])) != 0)
{ {
@ -117,7 +122,10 @@ void gauss(int n, double *L, double *Z, int i, int j)
void perm(int n, double *L, double *D, int j, double del, double *Z) void perm(int n, double *L, double *D, int j, double del, double *Z)
{ {
int k; int k;
double eta, lam, a0, a1; double eta;
double lam;
double a0;
double a1;
eta = D[j] / del; eta = D[j] / del;
lam = D[j + 1] * L[j + 1 + j * n] / del; lam = D[j + 1] * L[j + 1 + j * n] / del;
@ -145,7 +153,9 @@ void perm(int n, double *L, double *D, int j, double del, double *Z)
/* lambda reduction (z=Z'*a, Qz=Z'*Q*Z=L'*diag(D)*L) (ref.[1]) ---------------*/ /* lambda reduction (z=Z'*a, Qz=Z'*Q*Z=L'*diag(D)*L) (ref.[1]) ---------------*/
void reduction(int n, double *L, double *D, double *Z) void reduction(int n, double *L, double *D, double *Z)
{ {
int i, j, k; int i;
int j;
int k;
double del; double del;
j = n - 2; j = n - 2;
@ -178,9 +188,20 @@ void reduction(int n, double *L, double *D, double *Z)
int search(int n, int m, const double *L, const double *D, int search(int n, int m, const double *L, const double *D,
const double *zs, double *zn, double *s) const double *zs, double *zn, double *s)
{ {
int i, j, k, c, nn = 0, imax = 0; int i;
double newdist, maxdist = 1E99, y; int j;
double *S = zeros(n, n), *dist = mat(n, 1), *zb = mat(n, 1), *z = mat(n, 1), *step = mat(n, 1); int k;
int c;
int nn = 0;
int imax = 0;
double newdist;
double maxdist = 1E99;
double y;
double *S = zeros(n, n);
double *dist = mat(n, 1);
double *zb = mat(n, 1);
double *z = mat(n, 1);
double *step = mat(n, 1);
k = n - 1; k = n - 1;
dist[k] = 0.0; dist[k] = 0.0;
@ -302,7 +323,11 @@ int lambda(int n, int m, const double *a, const double *Q, double *F,
double *s) double *s)
{ {
int info; int info;
double *L, *D, *Z, *z, *E; double *L;
double *D;
double *Z;
double *z;
double *E;
if (n <= 0 || m <= 0) if (n <= 0 || m <= 0)
{ {
@ -345,8 +370,11 @@ int lambda(int n, int m, const double *a, const double *Q, double *F,
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int lambda_reduction(int n, const double *Q, double *Z) int lambda_reduction(int n, const double *Q, double *Z)
{ {
double *L, *D; double *L;
int i, j, info; double *D;
int i;
int j;
int info;
if (n <= 0) if (n <= 0)
{ {
@ -392,7 +420,8 @@ int lambda_reduction(int n, const double *Q, double *Z)
int lambda_search(int n, int m, const double *a, const double *Q, int lambda_search(int n, int m, const double *a, const double *Q,
double *F, double *s) double *F, double *s)
{ {
double *L, *D; double *L;
double *D;
int info; int info;
if (n <= 0 || m <= 0) if (n <= 0 || m <= 0)

View File

@ -59,7 +59,8 @@
/* pseudorange measurement error variance ------------------------------------*/ /* pseudorange measurement error variance ------------------------------------*/
double varerr(const prcopt_t *opt, double el, int sys) double varerr(const prcopt_t *opt, double el, int sys)
{ {
double fact, varr; double fact;
double varr;
fact = sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS); fact = sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS);
varr = std::pow(opt->err[0], 2.0) * (std::pow(opt->err[1], 2.0) + std::pow(opt->err[2], 2.0) / sin(el)); varr = std::pow(opt->err[0], 2.0) * (std::pow(opt->err[1], 2.0) + std::pow(opt->err[2], 2.0) / sin(el));
if (opt->ionoopt == IONOOPT_IFLC) if (opt->ionoopt == IONOOPT_IFLC)
@ -424,8 +425,23 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs,
double *v, double *H, double *var, double *azel, int *vsat, double *v, double *H, double *var, double *azel, int *vsat,
double *resp, int *ns) double *resp, int *ns)
{ {
double r, dion, dtrp, vmeas, vion, vtrp, rr[3], pos[3], dtr, e[3], P, lam_L1; double r;
int i, j, nv = 0, sys, mask[4] = {0}; double dion;
double dtrp;
double vmeas;
double vion;
double vtrp;
double rr[3];
double pos[3];
double dtr;
double e[3];
double P;
double lam_L1;
int i;
int j;
int nv = 0;
int sys;
int mask[4] = {0};
trace(3, "resprng : n=%d\n", n); trace(3, "resprng : n=%d\n", n);
@ -568,8 +584,10 @@ int valsol(const double *azel, const int *vsat, int n,
char *msg) char *msg)
{ {
double azels[MAXOBS * 2] = {0}; double azels[MAXOBS * 2] = {0};
double dop[4], vv; double dop[4];
int i, ns; double vv;
int i;
int ns;
trace(3, "valsol : n=%d nv=%d\n", n, nv); trace(3, "valsol : n=%d nv=%d\n", n, nv);
@ -607,8 +625,20 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts,
const prcopt_t *opt, sol_t *sol, double *azel, int *vsat, const prcopt_t *opt, sol_t *sol, double *azel, int *vsat,
double *resp, char *msg) double *resp, char *msg)
{ {
double x[NX] = {0}, dx[NX], Q[NX * NX], *v, *H, *var, sig; double x[NX] = {0};
int i, j, k, info, stat, nv, ns; double dx[NX];
double Q[NX * NX];
double *v;
double *H;
double *var;
double sig;
int i;
int j;
int k;
int info;
int stat;
int nv;
int ns;
trace(3, "estpos : n=%d\n", n); trace(3, "estpos : n=%d\n", n);
@ -707,9 +737,24 @@ int raim_fde(const obsd_t *obs, int n, const double *rs,
{ {
obsd_t *obs_e; obsd_t *obs_e;
sol_t sol_e = {{0, 0}, {}, {}, {}, '0', '0', '0', 0.0, 0.0, 0.0}; sol_t sol_e = {{0, 0}, {}, {}, {}, '0', '0', '0', 0.0, 0.0, 0.0};
char tstr[32], name[16], msg_e[128]; char tstr[32];
double *rs_e, *dts_e, *vare_e, *azel_e, *resp_e, rms_e, rms = 100.0; char name[16];
int i, j, k, nvsat, stat = 0, *svh_e, *vsat_e, sat = 0; char msg_e[128];
double *rs_e;
double *dts_e;
double *vare_e;
double *azel_e;
double *resp_e;
double rms_e;
double rms = 100.0;
int i;
int j;
int k;
int nvsat;
int stat = 0;
int *svh_e;
int *vsat_e;
int sat = 0;
trace(3, "raim_fde: %s n=%2d\n", time_str(obs[0].time, 0), n); trace(3, "raim_fde: %s n=%2d\n", time_str(obs[0].time, 0), n);
@ -813,8 +858,17 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts,
const nav_t *nav, const double *rr, const double *x, const nav_t *nav, const double *rr, const double *x,
const double *azel, const int *vsat, double *v, double *H) const double *azel, const int *vsat, double *v, double *H)
{ {
double lam, rate, pos[3], E[9], a[3], e[3], vs[3], cosel; double lam;
int i, j, nv = 0; double rate;
double pos[3];
double E[9];
double a[3];
double e[3];
double vs[3];
double cosel;
int i;
int j;
int nv = 0;
int band = 0; int band = 0;
trace(3, "resdop : n=%d\n", n); trace(3, "resdop : n=%d\n", n);
@ -878,8 +932,14 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts,
const nav_t *nav, const prcopt_t *opt __attribute__((unused)), sol_t *sol, const nav_t *nav, const prcopt_t *opt __attribute__((unused)), sol_t *sol,
const double *azel, const int *vsat) const double *azel, const int *vsat)
{ {
double x[4] = {0}, dx[4], Q[16], *v, *H; double x[4] = {0};
int i, j, nv; double dx[4];
double Q[16];
double *v;
double *H;
int i;
int j;
int nv;
trace(3, "estvel : n=%d\n", n); trace(3, "estvel : n=%d\n", n);
@ -939,8 +999,15 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav,
char *msg) char *msg)
{ {
prcopt_t opt_ = *opt; prcopt_t opt_ = *opt;
double *rs, *dts, *var, *azel_, *resp; double *rs;
int i, stat, vsat[MAXOBS] = {0}, svh[MAXOBS]; double *dts;
double *var;
double *azel_;
double *resp;
int i;
int stat;
int vsat[MAXOBS] = {0};
int svh[MAXOBS];
sol->stat = SOLQ_NONE; sol->stat = SOLQ_NONE;

View File

@ -62,7 +62,9 @@
/* wave length of LC (m) -----------------------------------------------------*/ /* wave length of LC (m) -----------------------------------------------------*/
double lam_LC(int i, int j, int k) double lam_LC(int i, int j, int k)
{ {
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5; const double f1 = FREQ1;
const double f2 = FREQ2;
const double f5 = FREQ5;
return SPEED_OF_LIGHT / (i * f1 + j * f2 + k * f5); return SPEED_OF_LIGHT / (i * f1 + j * f2 + k * f5);
} }
@ -71,8 +73,12 @@ double lam_LC(int i, int j, int k)
/* carrier-phase LC (m) ------------------------------------------------------*/ /* carrier-phase LC (m) ------------------------------------------------------*/
double L_LC(int i, int j, int k, const double *L) double L_LC(int i, int j, int k, const double *L)
{ {
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5; const double f1 = FREQ1;
double L1, L2, L5; const double f2 = FREQ2;
const double f5 = FREQ5;
double L1;
double L2;
double L5;
if ((i && !L[0]) || (j && !L[1]) || (k && !L[2])) if ((i && !L[0]) || (j && !L[1]) || (k && !L[2]))
{ {
@ -88,8 +94,12 @@ double L_LC(int i, int j, int k, const double *L)
/* pseudorange LC (m) --------------------------------------------------------*/ /* pseudorange LC (m) --------------------------------------------------------*/
double P_LC(int i, int j, int k, const double *P) double P_LC(int i, int j, int k, const double *P)
{ {
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5; const double f1 = FREQ1;
double P1, P2, P5; const double f2 = FREQ2;
const double f5 = FREQ5;
double P1;
double P2;
double P5;
if ((i && !P[0]) || (j && !P[1]) || (k && !P[2])) if ((i && !P[0]) || (j && !P[1]) || (k && !P[2]))
{ {
@ -105,7 +115,9 @@ double P_LC(int i, int j, int k, const double *P)
/* noise variance of LC (m) --------------------------------------------------*/ /* noise variance of LC (m) --------------------------------------------------*/
double var_LC(int i, int j, int k, double sig) double var_LC(int i, int j, int k, double sig)
{ {
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5; const double f1 = FREQ1;
const double f2 = FREQ2;
const double f5 = FREQ5;
return (std::pow(i * f1, 2.0) + std::pow(j * f2, 2.0) + std::pow(k * f5, 2.0)) / std::pow(i * f1 + j * f2 + k * f5, 2.0) * std::pow(sig, 2.0); return (std::pow(i * f1, 2.0) + std::pow(j * f2, 2.0) + std::pow(k * f5, 2.0)) / std::pow(i * f1 + j * f2 + k * f5, 2.0) * std::pow(sig, 2.0);
} }
@ -114,7 +126,8 @@ double var_LC(int i, int j, int k, double sig)
/* complementaty error function (ref [1] p.227-229) --------------------------*/ /* complementaty error function (ref [1] p.227-229) --------------------------*/
double p_gamma(double a, double x, double log_gamma_a) double p_gamma(double a, double x, double log_gamma_a)
{ {
double y, w; double y;
double w;
int i; int i;
if (x == 0.0) if (x == 0.0)
@ -143,7 +156,11 @@ double p_gamma(double a, double x, double log_gamma_a)
double q_gamma(double a, double x, double log_gamma_a) double q_gamma(double a, double x, double log_gamma_a)
{ {
double y, w, la = 1.0, lb = x + 1.0 - a, lc; double y;
double w;
double la = 1.0;
double lb = x + 1.0 - a;
double lc;
int i; int i;
if (x < a + 1.0) if (x < a + 1.0)
@ -177,7 +194,8 @@ double f_erfc(double x)
/* confidence function of integer ambiguity ----------------------------------*/ /* confidence function of integer ambiguity ----------------------------------*/
double conffunc(int N, double B, double sig) double conffunc(int N, double B, double sig)
{ {
double x, p = 1.0; double x;
double p = 1.0;
int i; int i;
x = fabs(B - N); x = fabs(B - N);
@ -194,8 +212,16 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu
const double *azel) const double *azel)
{ {
ambc_t *amb; ambc_t *amb;
double LC1, LC2, LC3, var1, var2, var3, sig; double LC1;
int i, j, sat; double LC2;
double LC3;
double var1;
double var2;
double var3;
double sig;
int i;
int j;
int sat;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
@ -265,8 +291,11 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu
/* fix wide-lane ambiguity ---------------------------------------------------*/ /* fix wide-lane ambiguity ---------------------------------------------------*/
int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW) int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW)
{ {
ambc_t *amb1, *amb2; ambc_t *amb1;
double BW, vW, lam_WL = lam_LC(1, -1, 0); ambc_t *amb2;
double BW;
double vW;
double lam_WL = lam_LC(1, -1, 0);
amb1 = rtk->ambc + sat1 - 1; amb1 = rtk->ambc + sat1 - 1;
amb2 = rtk->ambc + sat2 - 1; amb2 = rtk->ambc + sat2 - 1;
@ -340,7 +369,10 @@ int is_depend(int sat1, int sat2, int *flgs, int *max_flg)
/* select fixed ambiguities --------------------------------------------------*/ /* select fixed ambiguities --------------------------------------------------*/
int sel_amb(int *sat1, int *sat2, double *N, double *var, int n) int sel_amb(int *sat1, int *sat2, double *N, double *var, int n)
{ {
int i, j, flgs[MAXSAT] = {0}, max_flg = 0; int i;
int j;
int flgs[MAXSAT] = {0};
int max_flg = 0;
/* sort by variance */ /* sort by variance */
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
@ -377,8 +409,13 @@ int sel_amb(int *sat1, int *sat2, double *N, double *var, int n)
int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2, int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2,
const double *NC, int n) const double *NC, int n)
{ {
double *v, *H, *R; double *v;
int i, j, k, info; double *H;
double *R;
int i;
int j;
int k;
int info;
if (n <= 0) if (n <= 0)
{ {
@ -433,8 +470,24 @@ int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2,
/* fix narrow-lane ambiguity by rounding -------------------------------------*/ /* fix narrow-lane ambiguity by rounding -------------------------------------*/
int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n) int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n)
{ {
double C1, C2, B1, v1, BC, v, vc, *NC, *var, lam_NL = lam_LC(1, 1, 0), lam1, lam2; double C1;
int i, j, k, m = 0, N1, stat; double C2;
double B1;
double v1;
double BC;
double v;
double vc;
double *NC;
double *var;
double lam_NL = lam_LC(1, 1, 0);
double lam1;
double lam2;
int i;
int j;
int k;
int m = 0;
int N1;
int stat;
lam1 = LAM_CARR[0]; lam1 = LAM_CARR[0];
lam2 = LAM_CARR[1]; lam2 = LAM_CARR[1];
@ -495,8 +548,26 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n)
/* fix narrow-lane ambiguity by ILS ------------------------------------------*/ /* fix narrow-lane ambiguity by ILS ------------------------------------------*/
int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n) int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n)
{ {
double C1, C2, *B1, *N1, *NC, *D, *E, *Q, s[2], lam_NL = lam_LC(1, 1, 0), lam1, lam2; double C1;
int i, j, k, m = 0, info, stat, flgs[MAXSAT] = {0}, max_flg = 0; double C2;
double *B1;
double *N1;
double *NC;
double *D;
double *E;
double *Q;
double s[2];
double lam_NL = lam_LC(1, 1, 0);
double lam1;
double lam2;
int i;
int j;
int k;
int m = 0;
int info;
int stat;
int flgs[MAXSAT] = {0};
int max_flg = 0;
lam1 = LAM_CARR[0]; lam1 = LAM_CARR[0];
lam2 = LAM_CARR[1]; lam2 = LAM_CARR[1];
@ -619,7 +690,13 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav,
const double *azel) const double *azel)
{ {
double elmask; double elmask;
int i, j, m = 0, stat = 0, *NW, *sat1, *sat2; int i;
int j;
int m = 0;
int stat = 0;
int *NW;
int *sat1;
int *sat2;
if (n <= 0 || rtk->opt.ionoopt != IONOOPT_IFLC || rtk->opt.nf < 2) if (n <= 0 || rtk->opt.ionoopt != IONOOPT_IFLC || rtk->opt.nf < 2)
{ {
@ -681,8 +758,14 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav,
void pppoutsolstat(rtk_t *rtk, int level, FILE *fp) void pppoutsolstat(rtk_t *rtk, int level, FILE *fp)
{ {
ssat_t *ssat; ssat_t *ssat;
double tow, pos[3], vel[3], acc[3]; double tow;
int i, j, week, nfreq = 1; double pos[3];
double vel[3];
double acc[3];
int i;
int j;
int week;
int nfreq = 1;
char id[32]; char id[32];
if (level <= 0 || !fp) if (level <= 0 || !fp)
@ -756,8 +839,14 @@ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp)
/* exclude meas of eclipsing satellite (block IIA) ---------------------------*/ /* exclude meas of eclipsing satellite (block IIA) ---------------------------*/
void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs) void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs)
{ {
double rsun[3], esun[3], r, ang, erpv[5] = {0}, cosa; double rsun[3];
int i, j; double esun[3];
double r;
double ang;
double erpv[5] = {0};
double cosa;
int i;
int j;
const char *type; const char *type;
trace(3, "testeclipse:\n"); trace(3, "testeclipse:\n");
@ -809,7 +898,11 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs)
/* measurement error variance ------------------------------------------------*/ /* measurement error variance ------------------------------------------------*/
double varerr(int sat __attribute__((unused)), int sys, double el, int type, const prcopt_t *opt) double varerr(int sat __attribute__((unused)), int sys, double el, int type, const prcopt_t *opt)
{ {
double a, b, a2, b2, fact = 1.0; double a;
double b;
double a2;
double b2;
double fact = 1.0;
double sinel = sin(el); double sinel = sin(el);
int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0); int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0);
@ -874,8 +967,18 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel,
double phw, double *meas, double *var) double phw, double *meas, double *var)
{ {
const double *lam = nav->lam[obs->sat - 1]; const double *lam = nav->lam[obs->sat - 1];
double c1, c2, L1, L2, P1, P2, P1_C1, P2_C2, gamma; double c1;
int i = 0, j = 1, k; double c2;
double L1;
double L2;
double P1;
double P2;
double P1_C1;
double P2_C2;
double gamma;
int i = 0;
int j = 1;
int k;
trace(4, "ifmeas :\n"); trace(4, "ifmeas :\n");
@ -1018,7 +1121,14 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos,
double *meas, double *var, int *brk) double *meas, double *var, int *brk)
{ {
const double *lam = nav->lam[obs->sat - 1]; const double *lam = nav->lam[obs->sat - 1];
double ion = 0.0, L1, P1, PC, P1_P2, P1_C1, vari, gamma; double ion = 0.0;
double L1;
double P1;
double PC;
double P1_P2;
double P1_C1;
double vari;
double gamma;
int i; int i;
trace(4, "corrmeas:\n"); trace(4, "corrmeas:\n");
@ -1168,8 +1278,12 @@ void udclk_ppp(rtk_t *rtk)
/* temporal update of tropospheric parameters --------------------------------*/ /* temporal update of tropospheric parameters --------------------------------*/
void udtrop_ppp(rtk_t *rtk) void udtrop_ppp(rtk_t *rtk)
{ {
double pos[3], azel[] = {0.0, PI / 2.0}, ztd, var; double pos[3];
int i = IT_PPP(&rtk->opt), j; double azel[] = {0.0, PI / 2.0};
double ztd;
double var;
int i = IT_PPP(&rtk->opt);
int j;
trace(3, "udtrop_ppp:\n"); trace(3, "udtrop_ppp:\n");
@ -1205,7 +1319,8 @@ void udtrop_ppp(rtk_t *rtk)
/* detect cycle slip by LLI --------------------------------------------------*/ /* detect cycle slip by LLI --------------------------------------------------*/
void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n) void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n)
{ {
int i, j; int i;
int j;
trace(3, "detslp_ll: n=%d\n", n); trace(3, "detslp_ll: n=%d\n", n);
@ -1229,8 +1344,10 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n)
/* detect cycle slip by geometry free phase jump -----------------------------*/ /* detect cycle slip by geometry free phase jump -----------------------------*/
void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{ {
double g0, g1; double g0;
int i, j; double g1;
int i;
int j;
trace(3, "detslp_gf: n=%d\n", n); trace(3, "detslp_gf: n=%d\n", n);
@ -1263,8 +1380,16 @@ void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
/* temporal update of phase biases -------------------------------------------*/ /* temporal update of phase biases -------------------------------------------*/
void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{ {
double meas[2], var[2], bias[MAXOBS] = {0}, offset = 0.0, pos[3] = {0}; double meas[2];
int i, j, k, sat, brk = 0; double var[2];
double bias[MAXOBS] = {0};
double offset = 0.0;
double pos[3] = {0};
int i;
int j;
int k;
int sat;
int brk = 0;
trace(3, "udbias : n=%d\n", n); trace(3, "udbias : n=%d\n", n);
@ -1380,7 +1505,12 @@ void udstate_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
void satantpcv(const double *rs, const double *rr, const pcv_t *pcv, void satantpcv(const double *rs, const double *rr, const pcv_t *pcv,
double *dant) double *dant)
{ {
double ru[3], rz[3], eu[3], ez[3], nadir, cosa; double ru[3];
double rz[3];
double eu[3];
double ez[3];
double nadir;
double cosa;
int i; int i;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
@ -1407,7 +1537,12 @@ double prectrop(gtime_t time, const double *pos, const double *azel,
double *var) double *var)
{ {
const double zazel[] = {0.0, PI / 2.0}; const double zazel[] = {0.0, PI / 2.0};
double zhd, m_h, m_w, cotz, grad_n, grad_e; double zhd;
double m_h;
double m_w;
double cotz;
double grad_n;
double grad_e;
/* zenith hydrostatic delay */ /* zenith hydrostatic delay */
zhd = tropmodel(time, pos, zazel, 0.0); zhd = tropmodel(time, pos, zazel, 0.0);
@ -1438,9 +1573,28 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do
double *H, double *R, double *azel) double *H, double *R, double *azel)
{ {
prcopt_t *opt = &rtk->opt; prcopt_t *opt = &rtk->opt;
double r, rr[3], disp[3], pos[3], e[3], meas[2], dtdx[3], dantr[NFREQ] = {0}; double r;
double dants[NFREQ] = {0}, var[MAXOBS * 2], dtrp = 0.0, vart = 0.0, varm[2] = {0}; double rr[3];
int i, j, k, sat, sys, nv = 0, nx = rtk->nx, brk, tideopt; double disp[3];
double pos[3];
double e[3];
double meas[2];
double dtdx[3];
double dantr[NFREQ] = {0};
double dants[NFREQ] = {0};
double var[MAXOBS * 2];
double dtrp = 0.0;
double vart = 0.0;
double varm[2] = {0};
int i;
int j;
int k;
int sat;
int sys;
int nv = 0;
int nx = rtk->nx;
int brk;
int tideopt;
trace(3, "res_ppp : n=%d nx=%d\n", n, nx); trace(3, "res_ppp : n=%d nx=%d\n", n, nx);
@ -1636,8 +1790,20 @@ int pppnx(const prcopt_t *opt)
void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{ {
const prcopt_t *opt = &rtk->opt; const prcopt_t *opt = &rtk->opt;
double *rs, *dts, *var, *v, *H, *R, *azel, *xp, *Pp; double *rs;
int i, nv, info, svh[MAXOBS], stat = SOLQ_SINGLE; double *dts;
double *var;
double *v;
double *H;
double *R;
double *azel;
double *xp;
double *Pp;
int i;
int nv;
int info;
int svh[MAXOBS];
int stat = SOLQ_SINGLE;
trace(3, "pppos : nx=%d n=%d\n", rtk->nx, n); trace(3, "pppos : nx=%d n=%d\n", rtk->nx, n);

View File

@ -99,7 +99,12 @@ int code2sys(char code)
int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats,
double *bfact, char *tsys) double *bfact, char *tsys)
{ {
int i, j, k = 0, ns = 0, sys, prn; int i;
int j;
int k = 0;
int ns = 0;
int sys;
int prn;
char buff[1024]; char buff[1024];
trace(3, "readsp3h:\n"); trace(3, "readsp3h:\n");
@ -179,8 +184,18 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co
{ {
peph_t peph; peph_t peph;
gtime_t time; gtime_t time;
double val, std, base; double val;
int i, j, sat, sys, prn, n = ns * (type == 'P' ? 1 : 2), pred_o, pred_c, v; double std;
double base;
int i;
int j;
int sat;
int sys;
int prn;
int n = ns * (type == 'P' ? 1 : 2);
int pred_o;
int pred_c;
int v;
char buff[1024]; char buff[1024];
trace(3, "readsp3b: type=%c ns=%d index=%d opt=%d\n", type, ns, index, opt); trace(3, "readsp3b: type=%c ns=%d index=%d opt=%d\n", type, ns, index, opt);
@ -309,7 +324,8 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co
/* compare precise ephemeris -------------------------------------------------*/ /* compare precise ephemeris -------------------------------------------------*/
int cmppeph(const void *p1, const void *p2) int cmppeph(const void *p1, const void *p2)
{ {
auto *q1 = (peph_t *)p1, *q2 = (peph_t *)p2; auto *q1 = (peph_t *)p1;
auto *q2 = (peph_t *)p2;
double tt = timediff(q1->time, q2->time); double tt = timediff(q1->time, q2->time);
return tt < -1e-9 ? -1 : (tt > 1e-9 ? 1 : q1->index - q2->index); return tt < -1e-9 ? -1 : (tt > 1e-9 ? 1 : q1->index - q2->index);
} }
@ -318,7 +334,10 @@ int cmppeph(const void *p1, const void *p2)
/* combine precise ephemeris -------------------------------------------------*/ /* combine precise ephemeris -------------------------------------------------*/
void combpeph(nav_t *nav, int opt) void combpeph(nav_t *nav, int opt)
{ {
int i, j, k, m; int i;
int j;
int k;
int m;
trace(3, "combpeph: ne=%d\n", nav->ne); trace(3, "combpeph: ne=%d\n", nav->ne);
@ -387,8 +406,15 @@ void readsp3(const char *file, nav_t *nav, int opt)
FILE *fp; FILE *fp;
gtime_t time = {0, 0}; gtime_t time = {0, 0};
double bfact[2] = {}; double bfact[2] = {};
int i, j, n, ns, sats[MAXSAT] = {}; int i;
char *efiles[MAXEXFILE], *ext, type = ' ', tsys[4] = ""; int j;
int n;
int ns;
int sats[MAXSAT] = {};
char *efiles[MAXEXFILE];
char *ext;
char type = ' ';
char tsys[4] = "";
trace(3, "readpephs: file=%s\n", file); trace(3, "readpephs: file=%s\n", file);
@ -456,7 +482,8 @@ void readsp3(const char *file, nav_t *nav, int opt)
int readsap(const char *file, gtime_t time, nav_t *nav) int readsap(const char *file, gtime_t time, nav_t *nav)
{ {
pcvs_t pcvs = {0, 0, (pcv_t *){nullptr}}; pcvs_t pcvs = {0, 0, (pcv_t *){nullptr}};
pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}, *pcv; pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}};
pcv_t *pcv;
int i; int i;
trace(3, "readsap : file=%s time=%s\n", file, time_str(time, 0)); trace(3, "readsap : file=%s time=%s\n", file, time_str(time, 0));
@ -481,8 +508,13 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta)
{ {
FILE *fp; FILE *fp;
double cbias; double cbias;
char buff[256], str1[32], str2[32] = ""; char buff[256];
int i, j, sat, type = 0; char str1[32];
char str2[32] = "";
int i;
int j;
int sat;
int type = 0;
trace(3, "readdcbf: file=%s\n", file); trace(3, "readdcbf: file=%s\n", file);
@ -553,7 +585,9 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int readdcb(const char *file, nav_t *nav, const sta_t *sta) int readdcb(const char *file, nav_t *nav, const sta_t *sta)
{ {
int i, j, n; int i;
int j;
int n;
char *efiles[MAXEXFILE] = {}; char *efiles[MAXEXFILE] = {};
trace(3, "readdcb : file=%s\n", file); trace(3, "readdcb : file=%s\n", file);
@ -596,7 +630,8 @@ int addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat,
const double *bias, const double *std) const double *bias, const double *std)
{ {
fcbd_t *nav_fcb; fcbd_t *nav_fcb;
int i, j; int i;
int j;
if (nav->nf > 0 && fabs(timediff(ts, nav->fcb[nav->nf - 1].ts)) <= 1e-3) if (nav->nf > 0 && fabs(timediff(ts, nav->fcb[nav->nf - 1].ts)) <= 1e-3)
{ {
@ -640,9 +675,15 @@ int addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat,
int readfcbf(const char *file, nav_t *nav) int readfcbf(const char *file, nav_t *nav)
{ {
FILE *fp; FILE *fp;
gtime_t ts, te; gtime_t ts;
double ep1[6], ep2[6], bias[3] = {}, std[3] = {}; gtime_t te;
char buff[1024], str[32], *p; double ep1[6];
double ep2[6];
double bias[3] = {};
double std[3] = {};
char buff[1024];
char str[32];
char *p;
int sat; int sat;
trace(3, "readfcbf: file=%s\n", file); trace(3, "readfcbf: file=%s\n", file);
@ -687,7 +728,8 @@ int readfcbf(const char *file, nav_t *nav)
/* compare satellite fcb -----------------------------------------------------*/ /* compare satellite fcb -----------------------------------------------------*/
int cmpfcb(const void *p1, const void *p2) int cmpfcb(const void *p1, const void *p2)
{ {
auto *q1 = (fcbd_t *)p1, *q2 = (fcbd_t *)p2; auto *q1 = (fcbd_t *)p1;
auto *q2 = (fcbd_t *)p2;
double tt = timediff(q1->ts, q2->ts); double tt = timediff(q1->ts, q2->ts);
return tt < -1e-3 ? -1 : (tt > 1e-3 ? 1 : 0); return tt < -1e-3 ? -1 : (tt > 1e-3 ? 1 : 0);
} }
@ -703,7 +745,8 @@ int cmpfcb(const void *p1, const void *p2)
int readfcb(const char *file, nav_t *nav) int readfcb(const char *file, nav_t *nav)
{ {
char *efiles[MAXEXFILE] = {}; char *efiles[MAXEXFILE] = {};
int i, n; int i;
int n;
trace(3, "readfcb : file=%s\n", file); trace(3, "readfcb : file=%s\n", file);
@ -740,7 +783,8 @@ int readfcb(const char *file, nav_t *nav)
/* polynomial interpolation by Neville's algorithm ---------------------------*/ /* polynomial interpolation by Neville's algorithm ---------------------------*/
double interppol(const double *x, double *y, int n) double interppol(const double *x, double *y, int n)
{ {
int i, j; int i;
int j;
for (j = 1; j < n; j++) for (j = 1; j < n; j++)
{ {
@ -757,8 +801,18 @@ double interppol(const double *x, double *y, int n)
int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs,
double *dts, double *vare, double *varc) double *dts, double *vare, double *varc)
{ {
double t[NMAX + 1], p[3][NMAX + 1], c[2], *pos, std = 0.0, s[3], sinl, cosl; double t[NMAX + 1];
int i, j, k, index; double p[3][NMAX + 1];
double c[2];
double *pos;
double std = 0.0;
double s[3];
double sinl;
double cosl;
int i;
int j;
int k;
int index;
trace(4, "pephpos : time=%s sat=%2d\n", time_str(time, 3), sat); trace(4, "pephpos : time=%s sat=%2d\n", time_str(time, 3), sat);
@ -886,8 +940,13 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs,
int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts,
double *varc) double *varc)
{ {
double t[2], c[2], std; double t[2];
int i, j, k, index; double c[2];
double std;
int i;
int j;
int k;
int index;
trace(4, "pephclk : time=%s sat=%2d\n", time_str(time, 3), sat); trace(4, "pephclk : time=%s sat=%2d\n", time_str(time, 3), sat);
@ -970,9 +1029,22 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav,
{ {
const double *lam = nav->lam[sat - 1]; const double *lam = nav->lam[sat - 1];
const pcv_t *pcv = nav->pcvs + sat - 1; const pcv_t *pcv = nav->pcvs + sat - 1;
double ex[3], ey[3], ez[3], es[3], r[3], rsun[3], gmst, erpv[5] = {}; double ex[3];
double gamma, C1, C2, dant1, dant2; double ey[3];
int i, j = 0, k = 1; double ez[3];
double es[3];
double r[3];
double rsun[3];
double gmst;
double erpv[5] = {};
double gamma;
double C1;
double C2;
double dant1;
double dant2;
int i;
int j = 0;
int k = 1;
trace(4, "satantoff: time=%s sat=%2d\n", time_str(time, 3), sat); trace(4, "satantoff: time=%s sat=%2d\n", time_str(time, 3), sat);
@ -1048,7 +1120,14 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav,
int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt, int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt,
double *rs, double *dts, double *var) double *rs, double *dts, double *var)
{ {
double rss[3], rst[3], dtss[1], dtst[1], dant[3] = {}, vare = 0.0, varc = 0.0, tt = 1e-3; double rss[3];
double rst[3];
double dtss[1];
double dtst[1];
double dant[3] = {};
double vare = 0.0;
double varc = 0.0;
double tt = 1e-3;
int i; int i;
trace(4, "peph2pos: time=%s sat=%2d opt=%d\n", time_str(time, 3), sat, opt); trace(4, "peph2pos: time=%s sat=%2d opt=%d\n", time_str(time, 3), sat, opt);

View File

@ -73,7 +73,8 @@ int init_rtcm(rtcm_t *rtcm)
geph_t geph0 = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0}, geph_t geph0 = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0},
0.0, 0.0, 0.0}; 0.0, 0.0, 0.0};
ssr_t ssr0 = {{{0, 0.0}}, {0.0}, {0}, 0, 0, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, {0.0}, {0.0}, {0.0}, 0.0, 0.0, '0'}; ssr_t ssr0 = {{{0, 0.0}}, {0.0}, {0}, 0, 0, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, {0.0}, {0.0}, {0.0}, 0.0, 0.0, '0'};
int i, j; int i;
int j;
trace(3, "init_rtcm:\n"); trace(3, "init_rtcm:\n");
@ -369,7 +370,9 @@ int input_rtcm3(rtcm_t *rtcm, unsigned char data)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int input_rtcm2f(rtcm_t *rtcm, FILE *fp) int input_rtcm2f(rtcm_t *rtcm, FILE *fp)
{ {
int i, data = 0, ret; int i;
int data = 0;
int ret;
trace(4, "input_rtcm2f: data=%02x\n", data); trace(4, "input_rtcm2f: data=%02x\n", data);
@ -397,7 +400,9 @@ int input_rtcm2f(rtcm_t *rtcm, FILE *fp)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int input_rtcm3f(rtcm_t *rtcm, FILE *fp) int input_rtcm3f(rtcm_t *rtcm, FILE *fp)
{ {
int i, data = 0, ret; int i;
int data = 0;
int ret;
trace(4, "input_rtcm3f: data=%02x\n", data); trace(4, "input_rtcm3f: data=%02x\n", data);

View File

@ -59,7 +59,9 @@
/* adjust hourly rollover of rtcm 2 time -------------------------------------*/ /* adjust hourly rollover of rtcm 2 time -------------------------------------*/
void adjhour(rtcm_t *rtcm, double zcnt) void adjhour(rtcm_t *rtcm, double zcnt)
{ {
double tow, hour, sec; double tow;
double hour;
double sec;
int week; int week;
/* if no time, get cpu time */ /* if no time, get cpu time */
@ -85,7 +87,8 @@ void adjhour(rtcm_t *rtcm, double zcnt)
/* get observation data index ------------------------------------------------*/ /* get observation data index ------------------------------------------------*/
int obsindex(obs_t *obs, gtime_t time, int sat) int obsindex(obs_t *obs, gtime_t time, int sat)
{ {
int i, j; int i;
int j;
for (i = 0; i < obs->n; i++) for (i = 0; i < obs->n; i++)
{ {
@ -116,8 +119,14 @@ int obsindex(obs_t *obs, gtime_t time, int sat)
/* decode type 1/9: differential gps correction/partial correction set -------*/ /* decode type 1/9: differential gps correction/partial correction set -------*/
int decode_type1(rtcm_t *rtcm) int decode_type1(rtcm_t *rtcm)
{ {
int i = 48, fact, udre, prn, sat, iod; int i = 48;
double prc, rrc; int fact;
int udre;
int prn;
int sat;
int iod;
double prc;
double rrc;
trace(4, "decode_type1: len=%d\n", rtcm->len); trace(4, "decode_type1: len=%d\n", rtcm->len);
@ -186,7 +195,10 @@ int decode_type3(rtcm_t *rtcm)
int decode_type14(rtcm_t *rtcm) int decode_type14(rtcm_t *rtcm)
{ {
double zcnt; double zcnt;
int i = 48, week, hour, leaps; int i = 48;
int week;
int hour;
int leaps;
trace(4, "decode_type14: len=%d\n", rtcm->len); trace(4, "decode_type14: len=%d\n", rtcm->len);
@ -214,7 +226,8 @@ int decode_type14(rtcm_t *rtcm)
/* decode type 16: gps special message ---------------------------------------*/ /* decode type 16: gps special message ---------------------------------------*/
int decode_type16(rtcm_t *rtcm) int decode_type16(rtcm_t *rtcm)
{ {
int i = 48, n = 0; int i = 48;
int n = 0;
trace(4, "decode_type16: len=%d\n", rtcm->len); trace(4, "decode_type16: len=%d\n", rtcm->len);
@ -236,8 +249,12 @@ int decode_type17(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0}, eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA; double toc;
int i = 48, week, prn, sat; double sqrtA;
int i = 48;
int week;
int prn;
int sat;
trace(4, "decode_type17: len=%d\n", rtcm->len); trace(4, "decode_type17: len=%d\n", rtcm->len);
@ -327,8 +344,18 @@ int decode_type17(rtcm_t *rtcm)
int decode_type18(rtcm_t *rtcm) int decode_type18(rtcm_t *rtcm)
{ {
gtime_t time; gtime_t time;
double usec, cp, tt; double usec;
int i = 48, index, freq, sync = 1, code, sys, prn, sat, loss; double cp;
double tt;
int i = 48;
int index;
int freq;
int sync = 1;
int code;
int sys;
int prn;
int sat;
int loss;
trace(4, "decode_type18: len=%d\n", rtcm->len); trace(4, "decode_type18: len=%d\n", rtcm->len);
@ -403,8 +430,17 @@ int decode_type18(rtcm_t *rtcm)
int decode_type19(rtcm_t *rtcm) int decode_type19(rtcm_t *rtcm)
{ {
gtime_t time; gtime_t time;
double usec, pr, tt; double usec;
int i = 48, index, freq, sync = 1, code, sys, prn, sat; double pr;
double tt;
int i = 48;
int index;
int freq;
int sync = 1;
int code;
int sys;
int prn;
int sat;
trace(4, "decode_type19: len=%d\n", rtcm->len); trace(4, "decode_type19: len=%d\n", rtcm->len);
@ -474,8 +510,11 @@ int decode_type19(rtcm_t *rtcm)
/* decode type 22: extended reference station parameter ----------------------*/ /* decode type 22: extended reference station parameter ----------------------*/
int decode_type22(rtcm_t *rtcm) int decode_type22(rtcm_t *rtcm)
{ {
double del[2][3] = {{0}}, hgt = 0.0; double del[2][3] = {{0}};
int i = 48, j, noh; double hgt = 0.0;
int i = 48;
int j;
int noh;
trace(4, "decode_type22: len=%d\n", rtcm->len); trace(4, "decode_type22: len=%d\n", rtcm->len);
@ -579,7 +618,11 @@ int decode_type59(rtcm_t *rtcm __attribute((unused)))
int decode_rtcm2(rtcm_t *rtcm) int decode_rtcm2(rtcm_t *rtcm)
{ {
double zcnt; double zcnt;
int staid, seqno, stah, ret = 0, type = getbitu(rtcm->buff, 8, 6); int staid;
int seqno;
int stah;
int ret = 0;
int type = getbitu(rtcm->buff, 8, 6);
trace(3, "decode_rtcm2: type=%2d len=%3d\n", type, rtcm->len); trace(3, "decode_rtcm2: type=%2d len=%3d\n", type, rtcm->len);

View File

@ -149,7 +149,8 @@ int adjbdtweek(int week)
void adjday_glot(rtcm_t *rtcm, double tod) void adjday_glot(rtcm_t *rtcm, double tod)
{ {
gtime_t time; gtime_t time;
double tow, tod_p; double tow;
double tod_p;
int week; int week;
if (rtcm->time.time == 0) if (rtcm->time.time == 0)
@ -212,7 +213,8 @@ unsigned char snratio(double snr)
/* get observation data index ------------------------------------------------*/ /* get observation data index ------------------------------------------------*/
int obsindex3(obs_t *obs, gtime_t time, int sat) int obsindex3(obs_t *obs, gtime_t time, int sat)
{ {
int i, j; int i;
int j;
for (i = 0; i < obs->n; i++) for (i = 0; i < obs->n; i++)
{ {
@ -244,7 +246,8 @@ int obsindex3(obs_t *obs, gtime_t time, int sat)
int test_staid(rtcm_t *rtcm, int staid) int test_staid(rtcm_t *rtcm, int staid)
{ {
char *p; char *p;
int type, id; int type;
int id;
/* test station id option */ /* test station id option */
if ((p = strstr(rtcm->opt, "-STA=")) && sscanf(p, "-STA=%d", &id) == 1) if ((p = strstr(rtcm->opt, "-STA=")) && sscanf(p, "-STA=%d", &id) == 1)
@ -277,7 +280,10 @@ int decode_head1001(rtcm_t *rtcm, int *sync)
{ {
double tow; double tow;
char *msg; char *msg;
int i = 24, staid, nsat, type; int i = 24;
int staid;
int nsat;
int type;
type = getbitu(rtcm->buff, i, 12); type = getbitu(rtcm->buff, i, 12);
i += 12; i += 12;
@ -334,8 +340,22 @@ int decode_type1001(rtcm_t *rtcm)
/* decode type 1002: extended L1-only gps rtk observables --------------------*/ /* decode type 1002: extended L1-only gps rtk observables --------------------*/
int decode_type1002(rtcm_t *rtcm) int decode_type1002(rtcm_t *rtcm)
{ {
double pr1, cnr1, tt, cp1; double pr1;
int i = 24 + 64, j, index, nsat, sync, prn, code, sat, ppr1, lock1, amb, sys; double cnr1;
double tt;
double cp1;
int i = 24 + 64;
int j;
int index;
int nsat;
int sync;
int prn;
int code;
int sat;
int ppr1;
int lock1;
int amb;
int sys;
if ((nsat = decode_head1001(rtcm, &sync)) < 0) if ((nsat = decode_head1001(rtcm, &sync)) < 0)
{ {
@ -413,9 +433,28 @@ int decode_type1003(rtcm_t *rtcm)
int decode_type1004(rtcm_t *rtcm) int decode_type1004(rtcm_t *rtcm)
{ {
const int L2codes[] = {CODE_L2X, CODE_L2P, CODE_L2D, CODE_L2W}; const int L2codes[] = {CODE_L2X, CODE_L2P, CODE_L2D, CODE_L2W};
double pr1, cnr1, cnr2, tt, cp1, cp2; double pr1;
int i = 24 + 64, j, index, nsat, sync, prn, sat, code1, code2, pr21, ppr1, ppr2; double cnr1;
int lock1, lock2, amb, sys; double cnr2;
double tt;
double cp1;
double cp2;
int i = 24 + 64;
int j;
int index;
int nsat;
int sync;
int prn;
int sat;
int code1;
int code2;
int pr21;
int ppr1;
int ppr2;
int lock1;
int lock2;
int amb;
int sys;
if ((nsat = decode_head1001(rtcm, &sync)) < 0) if ((nsat = decode_head1001(rtcm, &sync)) < 0)
{ {
@ -510,9 +549,14 @@ double getbits_38(const unsigned char *buff, int pos)
/* decode type 1005: stationary rtk reference station arp --------------------*/ /* decode type 1005: stationary rtk reference station arp --------------------*/
int decode_type1005(rtcm_t *rtcm) int decode_type1005(rtcm_t *rtcm)
{ {
double rr[3], re[3], pos[3]; double rr[3];
double re[3];
double pos[3];
char *msg; char *msg;
int i = 24 + 12, j, staid, itrf; int i = 24 + 12;
int j;
int staid;
int itrf;
if (i + 140 == rtcm->len * 8) if (i + 140 == rtcm->len * 8)
{ {
@ -563,9 +607,15 @@ int decode_type1005(rtcm_t *rtcm)
/* decode type 1006: stationary rtk reference station arp with height --------*/ /* decode type 1006: stationary rtk reference station arp with height --------*/
int decode_type1006(rtcm_t *rtcm) int decode_type1006(rtcm_t *rtcm)
{ {
double rr[3], re[3], pos[3], anth; double rr[3];
double re[3];
double pos[3];
double anth;
char *msg; char *msg;
int i = 24 + 12, j, staid, itrf; int i = 24 + 12;
int j;
int staid;
int itrf;
if (i + 156 <= rtcm->len * 8) if (i + 156 <= rtcm->len * 8)
{ {
@ -620,7 +670,11 @@ int decode_type1007(rtcm_t *rtcm)
{ {
char des[32] = ""; char des[32] = "";
char *msg; char *msg;
int i = 24 + 12, j, staid, n, setup; int i = 24 + 12;
int j;
int staid;
int n;
int setup;
n = getbitu(rtcm->buff, i + 12, 8); n = getbitu(rtcm->buff, i + 12, 8);
@ -662,9 +716,15 @@ int decode_type1007(rtcm_t *rtcm)
/* decode type 1008: antenna descriptor & serial number ----------------------*/ /* decode type 1008: antenna descriptor & serial number ----------------------*/
int decode_type1008(rtcm_t *rtcm) int decode_type1008(rtcm_t *rtcm)
{ {
char des[32] = "", sno[32] = ""; char des[32] = "";
char sno[32] = "";
char *msg; char *msg;
int i = 24 + 12, j, staid, n, m, setup; int i = 24 + 12;
int j;
int staid;
int n;
int m;
int setup;
n = getbitu(rtcm->buff, i + 12, 8); n = getbitu(rtcm->buff, i + 12, 8);
m = getbitu(rtcm->buff, i + 28 + 8 * n, 8); m = getbitu(rtcm->buff, i + 28 + 8 * n, 8);
@ -716,7 +776,10 @@ int decode_head1009(rtcm_t *rtcm, int *sync)
{ {
double tod; double tod;
char *msg; char *msg;
int i = 24, staid, nsat, type; int i = 24;
int staid;
int nsat;
int type;
type = getbitu(rtcm->buff, i, 12); type = getbitu(rtcm->buff, i, 12);
i += 12; i += 12;
@ -773,8 +836,24 @@ int decode_type1009(rtcm_t *rtcm)
/* decode type 1010: extended L1-only glonass rtk observables ----------------*/ /* decode type 1010: extended L1-only glonass rtk observables ----------------*/
int decode_type1010(rtcm_t *rtcm) int decode_type1010(rtcm_t *rtcm)
{ {
double pr1, cnr1, tt, cp1, lam1; double pr1;
int i = 24 + 61, j, index, nsat, sync, prn, sat, code, freq, ppr1, lock1, amb, sys = SYS_GLO; double cnr1;
double tt;
double cp1;
double lam1;
int i = 24 + 61;
int j;
int index;
int nsat;
int sync;
int prn;
int sat;
int code;
int freq;
int ppr1;
int lock1;
int amb;
int sys = SYS_GLO;
if ((nsat = decode_head1009(rtcm, &sync)) < 0) if ((nsat = decode_head1009(rtcm, &sync)) < 0)
{ {
@ -845,9 +924,31 @@ int decode_type1011(rtcm_t *rtcm)
/* decode type 1012: extended L1&L2 glonass rtk observables ------------------*/ /* decode type 1012: extended L1&L2 glonass rtk observables ------------------*/
int decode_type1012(rtcm_t *rtcm) int decode_type1012(rtcm_t *rtcm)
{ {
double pr1, cnr1, cnr2, tt, cp1, cp2, lam1, lam2; double pr1;
int i = 24 + 61, j, index, nsat, sync, prn, sat, freq, code1, code2, pr21, ppr1, ppr2; double cnr1;
int lock1, lock2, amb, sys = SYS_GLO; double cnr2;
double tt;
double cp1;
double cp2;
double lam1;
double lam2;
int i = 24 + 61;
int j;
int index;
int nsat;
int sync;
int prn;
int sat;
int freq;
int code1;
int code2;
int pr21;
int ppr1;
int ppr2;
int lock1;
int lock2;
int amb;
int sys = SYS_GLO;
if ((nsat = decode_head1009(rtcm, &sync)) < 0) if ((nsat = decode_head1009(rtcm, &sync)) < 0)
{ {
@ -940,9 +1041,14 @@ int decode_type1019(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0}, eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA; double toc;
double sqrtA;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_GPS; int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_GPS;
if (i + 476 <= rtcm->len * 8) if (i + 476 <= rtcm->len * 8)
{ {
@ -1053,9 +1159,21 @@ int decode_type1020(rtcm_t *rtcm)
{ {
geph_t geph = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0}, geph_t geph = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0},
0.0, 0.0, 0.0}; 0.0, 0.0, 0.0};
double tk_h, tk_m, tk_s, toe, tow, tod, tof; double tk_h;
double tk_m;
double tk_s;
double toe;
double tow;
double tod;
double tof;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, tb, bn, sys = SYS_GLO; int i = 24 + 12;
int prn;
int sat;
int week;
int tb;
int bn;
int sys = SYS_GLO;
if (i + 348 <= rtcm->len * 8) if (i + 348 <= rtcm->len * 8)
{ {
@ -1218,7 +1336,10 @@ int decode_type1027(rtcm_t *rtcm __attribute__((unused)))
int decode_type1029(rtcm_t *rtcm) int decode_type1029(rtcm_t *rtcm)
{ {
char *msg; char *msg;
int i = 24 + 12, j, staid, nchar; // mjd, tod, nchar, cunit; int i = 24 + 12;
int j;
int staid;
int nchar; // mjd, tod, nchar, cunit;
if (i + 60 <= rtcm->len * 8) if (i + 60 <= rtcm->len * 8)
{ {
@ -1283,9 +1404,21 @@ int decode_type1032(rtcm_t *rtcm __attribute__((unused)))
/* decode type 1033: receiver and antenna descriptor -------------------------*/ /* decode type 1033: receiver and antenna descriptor -------------------------*/
int decode_type1033(rtcm_t *rtcm) int decode_type1033(rtcm_t *rtcm)
{ {
char des[32] = "", sno[32] = "", rec[32] = "", ver[32] = "", rsn[32] = ""; char des[32] = "";
char sno[32] = "";
char rec[32] = "";
char ver[32] = "";
char rsn[32] = "";
char *msg; char *msg;
int i = 24 + 12, j, staid, n, m, n1, n2, n3, setup; int i = 24 + 12;
int j;
int staid;
int n;
int m;
int n1;
int n2;
int n3;
int setup;
n = getbitu(rtcm->buff, i + 12, 8); n = getbitu(rtcm->buff, i + 12, 8);
m = getbitu(rtcm->buff, i + 28 + 8 * n, 8); m = getbitu(rtcm->buff, i + 28 + 8 * n, 8);
@ -1407,9 +1540,14 @@ int decode_type1044(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0}, eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA; double toc;
double sqrtA;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_QZS; int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_QZS;
if (i + 473 <= rtcm->len * 8) if (i + 473 <= rtcm->len * 8)
{ {
@ -1515,9 +1653,16 @@ int decode_type1045(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0}, eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA; double toc;
double sqrtA;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL; int i = 24 + 12;
int prn;
int sat;
int week;
int e5a_hs;
int e5a_dvs;
int sys = SYS_GAL;
if (i + 484 <= rtcm->len * 8) if (i + 484 <= rtcm->len * 8)
{ {
@ -1622,9 +1767,16 @@ int decode_type1046(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0}, eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA; double toc;
double sqrtA;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL; int i = 24 + 12;
int prn;
int sat;
int week;
int e5a_hs;
int e5a_dvs;
int sys = SYS_GAL;
if (i + 484 <= rtcm->len * 8) if (i + 484 <= rtcm->len * 8)
{ {
@ -1730,9 +1882,14 @@ int decode_type1047(rtcm_t *rtcm)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
; ;
double toc, sqrtA; double toc;
double sqrtA;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_BDS; int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_BDS;
if (i + 476 <= rtcm->len * 8) if (i + 476 <= rtcm->len * 8)
{ {
@ -1842,9 +1999,14 @@ int decode_type63(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0}, eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA; double toc;
double sqrtA;
char *msg; char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_BDS; int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_BDS;
if (i + 499 <= rtcm->len * 8) if (i + 499 <= rtcm->len * 8)
{ {
@ -1948,9 +2110,15 @@ int decode_type63(rtcm_t *rtcm)
int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod, int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
double *udint, int *refd, int *hsize) double *udint, int *refd, int *hsize)
{ {
double tod, tow; double tod;
double tow;
char *msg; char *msg;
int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6; int i = 24 + 12;
int nsat;
int udi;
int provid = 0;
int solid = 0;
int ns = 6;
#ifndef SSR_QZSS_DRAFT_V05 #ifndef SSR_QZSS_DRAFT_V05
ns = sys == SYS_QZS ? 4 : 6; ns = sys == SYS_QZS ? 4 : 6;
@ -2006,9 +2174,15 @@ int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod, int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
double *udint, int *hsize) double *udint, int *hsize)
{ {
double tod, tow; double tod;
double tow;
char *msg; char *msg;
int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6; int i = 24 + 12;
int nsat;
int udi;
int provid = 0;
int solid = 0;
int ns = 6;
#ifndef SSR_QZSS_DRAFT_V05 #ifndef SSR_QZSS_DRAFT_V05
ns = sys == SYS_QZS ? 4 : 6; ns = sys == SYS_QZS ? 4 : 6;
@ -2062,9 +2236,15 @@ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod, int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
double *udint, int *dispe, int *mw, int *hsize) double *udint, int *dispe, int *mw, int *hsize)
{ {
double tod, tow; double tod;
double tow;
char *msg; char *msg;
int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6; int i = 24 + 12;
int nsat;
int udi;
int provid = 0;
int solid = 0;
int ns = 6;
#ifndef SSR_QZSS_DRAFT_V05 #ifndef SSR_QZSS_DRAFT_V05
ns = sys == SYS_QZS ? 4 : 6; ns = sys == SYS_QZS ? 4 : 6;
@ -2121,8 +2301,25 @@ int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
/* decode ssr 1: orbit corrections -------------------------------------------*/ /* decode ssr 1: orbit corrections -------------------------------------------*/
int decode_ssr1(rtcm_t *rtcm, int sys) int decode_ssr1(rtcm_t *rtcm, int sys)
{ {
double udint, deph[3], ddeph[3]; double udint;
int i, j, k, type, sync, iod, nsat, prn, sat, iode, iodcrc, refd = 0, np, ni, nj, offp; double deph[3];
double ddeph[3];
int i;
int j;
int k;
int type;
int sync;
int iod;
int nsat;
int prn;
int sat;
int iode;
int iodcrc;
int refd = 0;
int np;
int ni;
int nj;
int offp;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2219,8 +2416,19 @@ int decode_ssr1(rtcm_t *rtcm, int sys)
/* decode ssr 2: clock corrections -------------------------------------------*/ /* decode ssr 2: clock corrections -------------------------------------------*/
int decode_ssr2(rtcm_t *rtcm, int sys) int decode_ssr2(rtcm_t *rtcm, int sys)
{ {
double udint, dclk[3]; double udint;
int i, j, k, type, sync, iod, nsat, prn, sat, np, offp; double dclk[3];
int i;
int j;
int k;
int type;
int sync;
int iod;
int nsat;
int prn;
int sat;
int np;
int offp;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2292,8 +2500,23 @@ int decode_ssr2(rtcm_t *rtcm, int sys)
int decode_ssr3(rtcm_t *rtcm, int sys) int decode_ssr3(rtcm_t *rtcm, int sys)
{ {
const int *codes; const int *codes;
double udint, bias, cbias[MAXCODE]; double udint;
int i, j, k, type, mode, sync, iod, nsat, prn, sat, nbias, np, offp, ncode; double bias;
double cbias[MAXCODE];
int i;
int j;
int k;
int type;
int mode;
int sync;
int iod;
int nsat;
int prn;
int sat;
int nbias;
int np;
int offp;
int ncode;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2391,8 +2614,26 @@ int decode_ssr3(rtcm_t *rtcm, int sys)
/* decode ssr 4: combined orbit and clock corrections ------------------------*/ /* decode ssr 4: combined orbit and clock corrections ------------------------*/
int decode_ssr4(rtcm_t *rtcm, int sys) int decode_ssr4(rtcm_t *rtcm, int sys)
{ {
double udint, deph[3], ddeph[3], dclk[3]; double udint;
int i, j, k, type, nsat, sync, iod, prn, sat, iode, iodcrc, refd = 0, np, ni, nj, offp; double deph[3];
double ddeph[3];
double dclk[3];
int i;
int j;
int k;
int type;
int nsat;
int sync;
int iod;
int prn;
int sat;
int iode;
int iodcrc;
int refd = 0;
int np;
int ni;
int nj;
int offp;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2498,7 +2739,17 @@ int decode_ssr4(rtcm_t *rtcm, int sys)
int decode_ssr5(rtcm_t *rtcm, int sys) int decode_ssr5(rtcm_t *rtcm, int sys)
{ {
double udint; double udint;
int i, j, type, nsat, sync, iod, prn, sat, ura, np, offp; int i;
int j;
int type;
int nsat;
int sync;
int iod;
int prn;
int sat;
int ura;
int np;
int offp;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2561,8 +2812,18 @@ int decode_ssr5(rtcm_t *rtcm, int sys)
/* decode ssr 6: high rate clock correction ----------------------------------*/ /* decode ssr 6: high rate clock correction ----------------------------------*/
int decode_ssr6(rtcm_t *rtcm, int sys) int decode_ssr6(rtcm_t *rtcm, int sys)
{ {
double udint, hrclk; double udint;
int i, j, type, nsat, sync, iod, prn, sat, np, offp; double hrclk;
int i;
int j;
int type;
int nsat;
int sync;
int iod;
int prn;
int sat;
int np;
int offp;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2626,9 +2887,29 @@ int decode_ssr6(rtcm_t *rtcm, int sys)
int decode_ssr7(rtcm_t *rtcm, int sys) int decode_ssr7(rtcm_t *rtcm, int sys)
{ {
const int *codes; const int *codes;
double udint, bias, std, pbias[MAXCODE], stdpb[MAXCODE]; double udint;
int i, j, k, type, mode, sync, iod, nsat, prn, sat, nbias, ncode, np, mw, offp; double bias;
int dispe, yaw_ang, yaw_rate; double std;
double pbias[MAXCODE];
double stdpb[MAXCODE];
int i;
int j;
int k;
int type;
int mode;
int sync;
int iod;
int nsat;
int prn;
int sat;
int nbias;
int ncode;
int np;
int mw;
int offp;
int dispe;
int yaw_ang;
int yaw_rate;
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2733,7 +3014,12 @@ int decode_ssr7(rtcm_t *rtcm, int sys)
void sigindex(int sys, const unsigned char *code, const int *freq, int n, void sigindex(int sys, const unsigned char *code, const int *freq, int n,
const char *opt, int *ind) const char *opt, int *ind)
{ {
int i, nex, pri, pri_h[8] = {0}, index[8] = {0}, ex[32] = {0}; int i;
int nex;
int pri;
int pri_h[8] = {0};
int index[8] = {0};
int ex[32] = {0};
/* test code priority */ /* test code priority */
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
@ -2796,10 +3082,21 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r,
const int *ex, const int *half) const int *ex, const int *half)
{ {
const char *sig[32]; const char *sig[32];
double tt, wl; double tt;
double wl;
unsigned char code[32]; unsigned char code[32];
char *msm_type = (char *)"", *q = nullptr; char *msm_type = (char *)"";
int i, j, k, type, prn, sat, fn, index = 0, freq[32], ind[32]; char *q = nullptr;
int i;
int j;
int k;
int type;
int prn;
int sat;
int fn;
int index = 0;
int freq[32];
int ind[32];
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -2963,9 +3260,15 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
msm_h_t *h, int *hsize) msm_h_t *h, int *hsize)
{ {
msm_h_t h0 = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; msm_h_t h0 = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double tow, tod; double tow;
double tod;
char *msg; char *msg;
int i = 24, j, mask, staid, type, ncell = 0; int i = 24;
int j;
int mask;
int staid;
int type;
int ncell = 0;
type = getbitu(rtcm->buff, i, 12); type = getbitu(rtcm->buff, i, 12);
i += 12; i += 12;
@ -3080,7 +3383,9 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
int decode_msm0(rtcm_t *rtcm, int sys) int decode_msm0(rtcm_t *rtcm, int sys)
{ {
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
int i, sync, iod; int i;
int sync;
int iod;
if (decode_msm_head(rtcm, sys, &sync, &iod, &h, &i) < 0) if (decode_msm_head(rtcm, sys, &sync, &iod, &h, &i) < 0)
{ {
return -1; return -1;
@ -3094,8 +3399,22 @@ int decode_msm0(rtcm_t *rtcm, int sys)
int decode_msm4(rtcm_t *rtcm, int sys) int decode_msm4(rtcm_t *rtcm, int sys)
{ {
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], pr[64], cp[64], cnr[64]; double r[64];
int i, j, type, sync, iod, ncell, rng, rng_m, prv, cpv, lock[64], half[64]; double pr[64];
double cp[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int prv;
int cpv;
int lock[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -3185,9 +3504,27 @@ int decode_msm4(rtcm_t *rtcm, int sys)
int decode_msm5(rtcm_t *rtcm, int sys) int decode_msm5(rtcm_t *rtcm, int sys)
{ {
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], rr[64], pr[64], cp[64], rrf[64], cnr[64]; double r[64];
int i, j, type, sync, iod, ncell, rng, rng_m, rate, prv, cpv, rrv, lock[64]; double rr[64];
int ex[64], half[64]; double pr[64];
double cp[64];
double rrf[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int rate;
int prv;
int cpv;
int rrv;
int lock[64];
int ex[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -3301,8 +3638,22 @@ int decode_msm5(rtcm_t *rtcm, int sys)
int decode_msm6(rtcm_t *rtcm, int sys) int decode_msm6(rtcm_t *rtcm, int sys)
{ {
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], pr[64], cp[64], cnr[64]; double r[64];
int i, j, type, sync, iod, ncell, rng, rng_m, prv, cpv, lock[64], half[64]; double pr[64];
double cp[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int prv;
int cpv;
int lock[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -3392,9 +3743,27 @@ int decode_msm6(rtcm_t *rtcm, int sys)
int decode_msm7(rtcm_t *rtcm, int sys) int decode_msm7(rtcm_t *rtcm, int sys)
{ {
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], rr[64], pr[64], cp[64], rrf[64], cnr[64]; double r[64];
int i, j, type, sync, iod, ncell, rng, rng_m, rate, prv, cpv, rrv, lock[64]; double rr[64];
int ex[64], half[64]; double pr[64];
double cp[64];
double rrf[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int rate;
int prv;
int cpv;
int rrv;
int lock[64];
int ex[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12); type = getbitu(rtcm->buff, 24, 12);
@ -3516,7 +3885,9 @@ int decode_type1230(rtcm_t *rtcm __attribute__((unused)))
int decode_rtcm3(rtcm_t *rtcm) int decode_rtcm3(rtcm_t *rtcm)
{ {
double tow; double tow;
int ret = 0, type = getbitu(rtcm->buff, 24, 12), week; int ret = 0;
int type = getbitu(rtcm->buff, 24, 12);
int week;
trace(3, "decode_rtcm3: len=%3d type=%d\n", rtcm->len, type); trace(3, "decode_rtcm3: len=%3d type=%d\n", rtcm->len, type);

View File

@ -396,7 +396,8 @@ int satsys(int sat, int *prn)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int satid2no(const char *id) int satid2no(const char *id)
{ {
int sys, prn; int sys;
int prn;
char code; char code;
if (sscanf(id, "%d", &prn) == 1) if (sscanf(id, "%d", &prn) == 1)
@ -564,7 +565,8 @@ int satexclude(int sat, int svh, const prcopt_t *opt)
int testsnr(int base, int freq, double el, double snr, int testsnr(int base, int freq, double el, double snr,
const snrmask_t *mask) const snrmask_t *mask)
{ {
double minsnr, a; double minsnr;
double a;
int i; int i;
if (!mask->ena[base] || freq < 0 || freq >= NFREQ) if (!mask->ena[base] || freq < 0 || freq >= NFREQ)
@ -713,9 +715,12 @@ void setcodepri(int sys, int freq, const char *pri)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int getcodepri(int sys, unsigned char code, const char *opt) int getcodepri(int sys, unsigned char code, const char *opt)
{ {
const char *p, *optstr; const char *p;
char *obs, str[8] = ""; const char *optstr;
int i, j; char *obs;
char str[8] = "";
int i;
int j;
switch (sys) switch (sys)
{ {
@ -850,7 +855,8 @@ void setbits(unsigned char *buff, int pos, int len, int data)
unsigned int rtk_crc32(const unsigned char *buff, int len) unsigned int rtk_crc32(const unsigned char *buff, int len)
{ {
unsigned int crc = 0; unsigned int crc = 0;
int i, j; int i;
int j;
trace(4, "rtk_crc32: len=%d\n", len); trace(4, "rtk_crc32: len=%d\n", len);
@ -930,7 +936,8 @@ int decode_word(unsigned int word, unsigned char *data)
{ {
const unsigned int hamming[] = { const unsigned int hamming[] = {
0xBB1F3480, 0x5D8F9A40, 0xAEC7CD00, 0x5763E680, 0x6BB1F340, 0x8B7A89C0}; 0xBB1F3480, 0x5D8F9A40, 0xAEC7CD00, 0x5763E680, 0x6BB1F340, 0x8B7A89C0};
unsigned int parity = 0, w; unsigned int parity = 0;
unsigned int w;
int i; int i;
trace(5, "decodeword: word=%08x\n", word); trace(5, "decodeword: word=%08x\n", word);
@ -1142,7 +1149,8 @@ void matcpy(double *A, const double *B, int n, int m)
void matmul(const char *tr, int n, int k, int m, double alpha, void matmul(const char *tr, int n, int k, int m, double alpha,
const double *A, const double *B, double beta, double *C) const double *A, const double *B, double beta, double *C)
{ {
int lda = tr[0] == 'T' ? m : n, ldb = tr[1] == 'T' ? k : m; int lda = tr[0] == 'T' ? m : n;
int ldb = tr[1] == 'T' ? k : m;
dgemm_(const_cast<char *>(tr), const_cast<char *>(tr) + 1, &n, &k, &m, &alpha, const_cast<double *>(A), &lda, const_cast<double *>(B), dgemm_(const_cast<char *>(tr), const_cast<char *>(tr) + 1, &n, &k, &m, &alpha, const_cast<double *>(A), &lda, const_cast<double *>(B),
&ldb, &beta, C, &n); &ldb, &beta, C, &n);
@ -1158,7 +1166,9 @@ void matmul(const char *tr, int n, int k, int m, double alpha,
int matinv(double *A, int n) int matinv(double *A, int n)
{ {
double *work; double *work;
int info, lwork = n * 16, *ipiv = imat(n, 1); int info;
int lwork = n * 16;
int *ipiv = imat(n, 1);
work = mat(lwork, 1); work = mat(lwork, 1);
dgetrf_(&n, &n, A, &n, ipiv, &info); dgetrf_(&n, &n, A, &n, ipiv, &info);
@ -1187,7 +1197,8 @@ int solve(const char *tr, const double *A, const double *Y, int n,
int m, double *X) int m, double *X)
{ {
double *B = mat(n, n); double *B = mat(n, n);
int info, *ipiv = imat(n, 1); int info;
int *ipiv = imat(n, 1);
matcpy(B, A, n, n); matcpy(B, A, n, n);
matcpy(X, Y, n, m); matcpy(X, Y, n, m);
@ -1258,7 +1269,10 @@ int filter_(const double *x, const double *P, const double *H,
const double *v, const double *R, int n, int m, const double *v, const double *R, int n, int m,
double *xp, double *Pp) double *xp, double *Pp)
{ {
double *F = mat(n, m), *Q = mat(m, m), *K = mat(n, m), *I = eye(n); double *F = mat(n, m);
double *Q = mat(m, m);
double *K = mat(n, m);
double *I = eye(n);
int info; int info;
matcpy(Q, R, m, m); matcpy(Q, R, m, m);
@ -1283,8 +1297,16 @@ int filter_(const double *x, const double *P, const double *H,
int filter(double *x, double *P, const double *H, const double *v, int filter(double *x, double *P, const double *H, const double *v,
const double *R, int n, int m) const double *R, int n, int m)
{ {
double *x_, *xp_, *P_, *Pp_, *H_; double *x_;
int i, j, k, info, *ix; double *xp_;
double *P_;
double *Pp_;
double *H_;
int i;
int j;
int k;
int info;
int *ix;
ix = imat(n, 1); ix = imat(n, 1);
for (i = k = 0; i < n; i++) for (i = k = 0; i < n; i++)
@ -1349,8 +1371,11 @@ int filter(double *x, double *P, const double *H, const double *v,
int smoother(const double *xf, const double *Qf, const double *xb, int smoother(const double *xf, const double *Qf, const double *xb,
const double *Qb, int n, double *xs, double *Qs) const double *Qb, int n, double *xs, double *Qs)
{ {
double *invQf = mat(n, n), *invQb = mat(n, n), *xx = mat(n, 1); double *invQf = mat(n, n);
int i, info = -1; double *invQb = mat(n, n);
double *xx = mat(n, 1);
int i;
int info = -1;
matcpy(invQf, Qf, n, n); matcpy(invQf, Qf, n, n);
matcpy(invQb, Qb, n, n); matcpy(invQb, Qb, n, n);
@ -1385,7 +1410,8 @@ int smoother(const double *xf, const double *Qf, const double *xb,
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void matfprint(const double A[], int n, int m, int p, int q, FILE *fp) void matfprint(const double A[], int n, int m, int p, int q, FILE *fp)
{ {
int i, j; int i;
int j;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
@ -1399,7 +1425,8 @@ void matfprint(const double A[], int n, int m, int p, int q, FILE *fp)
void matsprint(const double A[], int n, int m, int p, int q, std::string &buffer) void matsprint(const double A[], int n, int m, int p, int q, std::string &buffer)
{ {
int i, j; int i;
int j;
buffer += '\n'; buffer += '\n';
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
@ -1430,7 +1457,8 @@ void matprint(const double A[], int n, int m, int p, int q)
double str2num(const char *s, int i, int n) double str2num(const char *s, int i, int n)
{ {
double value; double value;
char str[256], *p = str; char str[256];
char *p = str;
if (i < 0 || static_cast<int>(strlen(s)) < i || static_cast<int>(sizeof(str)) - 1 < n) if (i < 0 || static_cast<int>(strlen(s)) < i || static_cast<int>(sizeof(str)) - 1 < n)
{ {
@ -1455,7 +1483,8 @@ double str2num(const char *s, int i, int n)
int str2time(const char *s, int i, int n, gtime_t *t) int str2time(const char *s, int i, int n, gtime_t *t)
{ {
double ep[6]; double ep[6];
char str[256], *p = str; char str[256];
char *p = str;
if (i < 0 || static_cast<int>(strlen(s)) < i || static_cast<int>(sizeof(str)) - 1 < i) if (i < 0 || static_cast<int>(strlen(s)) < i || static_cast<int>(sizeof(str)) - 1 < i)
{ {
@ -1489,7 +1518,11 @@ gtime_t epoch2time(const double *ep)
{ {
const int doy[] = {1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}; const int doy[] = {1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
gtime_t time = {0, 0}; gtime_t time = {0, 0};
int days, sec, year = static_cast<int>(ep[0]), mon = static_cast<int>(ep[1]), day = static_cast<int>(ep[2]); int days;
int sec;
int year = static_cast<int>(ep[0]);
int mon = static_cast<int>(ep[1]);
int day = static_cast<int>(ep[2]);
if (year < 1970 || 2099 < year || mon < 1 || 12 < mon) if (year < 1970 || 2099 < year || mon < 1 || 12 < mon)
{ {
@ -1517,7 +1550,10 @@ void time2epoch(gtime_t t, double *ep)
const int mday[] = {/* # of days in a month */ const int mday[] = {/* # of days in a month */
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int days, sec, mon, day; int days;
int sec;
int mon;
int day;
/* leap year if year%4==0 in 1901-2099 */ /* leap year if year%4==0 in 1901-2099 */
days = static_cast<int>(t.time / 86400); days = static_cast<int>(t.time / 86400);
@ -1760,8 +1796,12 @@ void timeset(gtime_t t)
/* read leap seconds table by text -------------------------------------------*/ /* read leap seconds table by text -------------------------------------------*/
int read_leaps_text(FILE *fp) int read_leaps_text(FILE *fp)
{ {
char buff[256], *p; char buff[256];
int i, n = 0, ep[6], ls; char *p;
int i;
int n = 0;
int ep[6];
int ls;
rewind(fp); rewind(fp);
@ -1791,9 +1831,17 @@ int read_leaps_usno(FILE *fp)
{ {
static const char *months[] = { static const char *months[] = {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}; "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
double jd, tai_utc; double jd;
char buff[256], month[32], ls[MAXLEAPS][7] = {}; double tai_utc;
int i, j, y, m, d, n = 0; char buff[256];
char month[32];
char ls[MAXLEAPS][7] = {};
int i;
int j;
int y;
int m;
int d;
int n = 0;
rewind(fp); rewind(fp);
@ -1849,7 +1897,8 @@ int read_leaps_usno(FILE *fp)
int read_leaps(const char *file) int read_leaps(const char *file)
{ {
FILE *fp; FILE *fp;
int i, n; int i;
int n;
if (!(fp = fopen(file, "re"))) if (!(fp = fopen(file, "re")))
{ {
@ -1944,7 +1993,8 @@ gtime_t bdt2gpst(gtime_t t)
/* time to day and sec -------------------------------------------------------*/ /* time to day and sec -------------------------------------------------------*/
double time2sec(gtime_t time, gtime_t *day) double time2sec(gtime_t time, gtime_t *day)
{ {
double ep[6], sec; double ep[6];
double sec;
time2epoch(time, ep); time2epoch(time, ep);
sec = ep[3] * 3600.0 + ep[4] * 60.0 + ep[5]; sec = ep[3] * 3600.0 + ep[4] * 60.0 + ep[5];
ep[3] = ep[4] = ep[5] = 0.0; ep[3] = ep[4] = ep[5] = 0.0;
@ -1962,8 +2012,14 @@ double time2sec(gtime_t time, gtime_t *day)
double utc2gmst(gtime_t t, double ut1_utc) double utc2gmst(gtime_t t, double ut1_utc)
{ {
const double ep2000[] = {2000, 1, 1, 12, 0, 0}; const double ep2000[] = {2000, 1, 1, 12, 0, 0};
gtime_t tut, tut0; gtime_t tut;
double ut, t1, t2, t3, gmst0, gmst; gtime_t tut0;
double ut;
double t1;
double t2;
double t3;
double gmst0;
double gmst;
tut = timeadd(t, ut1_utc); tut = timeadd(t, ut1_utc);
ut = time2sec(tut, &tut0); ut = time2sec(tut, &tut0);
@ -2120,7 +2176,8 @@ void sleepms(int ms)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void deg2dms(double deg, double *dms, int ndec) void deg2dms(double deg, double *dms, int ndec)
{ {
double sign = deg < 0.0 ? -1.0 : 1.0, a = fabs(deg); double sign = deg < 0.0 ? -1.0 : 1.0;
double a = fabs(deg);
double unit = pow(0.1, ndec); double unit = pow(0.1, ndec);
dms[0] = floor(a); dms[0] = floor(a);
a = (a - dms[0]) * 60.0; a = (a - dms[0]) * 60.0;
@ -2142,7 +2199,8 @@ void deg2dms(double deg, double *dms, int ndec)
void deg2dms(double deg, double *dms) void deg2dms(double deg, double *dms)
{ {
double sign = deg < 0.0 ? -1.0 : 1.0, a = fabs(deg); double sign = deg < 0.0 ? -1.0 : 1.0;
double a = fabs(deg);
dms[0] = floor(a); dms[0] = floor(a);
a = (a - dms[0]) * 60.0; a = (a - dms[0]) * 60.0;
dms[1] = floor(a); dms[1] = floor(a);
@ -2172,7 +2230,12 @@ double dms2deg(const double *dms)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void ecef2pos(const double *r, double *pos) void ecef2pos(const double *r, double *pos)
{ {
double e2 = FE_WGS84 * (2.0 - FE_WGS84), r2 = dot(r, r, 2), z, zk, v = RE_WGS84, sinp; double e2 = FE_WGS84 * (2.0 - FE_WGS84);
double r2 = dot(r, r, 2);
double z;
double zk;
double v = RE_WGS84;
double sinp;
for (z = r[2], zk = 0.0; fabs(z - zk) >= 1e-4;) for (z = r[2], zk = 0.0; fabs(z - zk) >= 1e-4;)
{ {
@ -2196,8 +2259,12 @@ void ecef2pos(const double *r, double *pos)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void pos2ecef(const double *pos, double *r) void pos2ecef(const double *pos, double *r)
{ {
double sinp = sin(pos[0]), cosp = cos(pos[0]), sinl = sin(pos[1]), cosl = cos(pos[1]); double sinp = sin(pos[0]);
double e2 = FE_WGS84 * (2.0 - FE_WGS84), v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp); double cosp = cos(pos[0]);
double sinl = sin(pos[1]);
double cosl = cos(pos[1]);
double e2 = FE_WGS84 * (2.0 - FE_WGS84);
double v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp);
r[0] = (v + pos[2]) * cosp * cosl; r[0] = (v + pos[2]) * cosp * cosl;
r[1] = (v + pos[2]) * cosp * sinl; r[1] = (v + pos[2]) * cosp * sinl;
@ -2214,7 +2281,10 @@ void pos2ecef(const double *pos, double *r)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void xyz2enu(const double *pos, double *E) void xyz2enu(const double *pos, double *E)
{ {
double sinp = sin(pos[0]), cosp = cos(pos[0]), sinl = sin(pos[1]), cosl = cos(pos[1]); double sinp = sin(pos[0]);
double cosp = cos(pos[0]);
double sinl = sin(pos[1]);
double cosl = cos(pos[1]);
E[0] = -sinl; E[0] = -sinl;
E[3] = cosl; E[3] = cosl;
@ -2269,7 +2339,8 @@ void enu2ecef(const double *pos, const double *e, double *r)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void covenu(const double *pos, const double *P, double *Q) void covenu(const double *pos, const double *P, double *Q)
{ {
double E[9], EP[9]; double E[9];
double EP[9];
xyz2enu(pos, E); xyz2enu(pos, E);
matmul("NN", 3, 3, 3, 1.0, E, P, 0.0, EP); matmul("NN", 3, 3, 3, 1.0, E, P, 0.0, EP);
@ -2286,7 +2357,8 @@ void covenu(const double *pos, const double *P, double *Q)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void covecef(const double *pos, const double *Q, double *P) void covecef(const double *pos, const double *Q, double *P)
{ {
double E[9], EQ[9]; double E[9];
double EQ[9];
xyz2enu(pos, E); xyz2enu(pos, E);
matmul("TN", 3, 3, 3, 1.0, E, Q, 0.0, EQ); matmul("TN", 3, 3, 3, 1.0, E, Q, 0.0, EQ);
@ -2304,7 +2376,8 @@ void ast_args(double t, double *f)
{297.85019547, 1602961601.2090, -6.3706, 0.006593, -0.00003169}, {297.85019547, 1602961601.2090, -6.3706, 0.006593, -0.00003169},
{125.04455501, -6962890.2665, 7.4722, 0.007702, -0.00005939}}; {125.04455501, -6962890.2665, 7.4722, 0.007702, -0.00005939}};
double tt[4]; double tt[4];
int i, j; int i;
int j;
for (tt[0] = t, i = 1; i < 4; i++) for (tt[0] = t, i = 1; i < 4; i++)
{ {
@ -2433,7 +2506,8 @@ void nut_iau1980(double t, const double *f, double *dpsi, double *deps)
{-1, -1, 0, 2, 1, 35.0, 1, 0.0, 0, 0.0}, {-1, -1, 0, 2, 1, 35.0, 1, 0.0, 0, 0.0},
{0, 1, 0, 1, 0, 27.3, 1, 0.0, 0, 0.0}}; {0, 1, 0, 1, 0, 27.3, 1, 0.0, 0, 0.0}};
double ang; double ang;
int i, j; int i;
int j;
*dpsi = *deps = 0.0; *dpsi = *deps = 0.0;
@ -2467,10 +2541,28 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst)
{ {
const double ep2000[] = {2000, 1, 1, 12, 0, 0}; const double ep2000[] = {2000, 1, 1, 12, 0, 0};
static gtime_t tutc_; static gtime_t tutc_;
static double U_[9], gmst_; static double U_[9];
static double gmst_;
gtime_t tgps; gtime_t tgps;
double eps, ze, th, z, t, t2, t3, dpsi, deps, gast, f[5]; double eps;
double R1[9], R2[9], R3[9], R[9], W[9], N[9], P[9], NP[9]; double ze;
double th;
double z;
double t;
double t2;
double t3;
double dpsi;
double deps;
double gast;
double f[5];
double R1[9];
double R2[9];
double R3[9];
double R[9];
double W[9];
double N[9];
double P[9];
double NP[9];
int i; int i;
trace(4, "eci2ecef: tutc=%s\n", time_str(tutc, 3)); trace(4, "eci2ecef: tutc=%s\n", time_str(tutc, 3));
@ -2674,7 +2766,11 @@ int readantex(const char *file, pcvs_t *pcvs)
static const pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}; static const pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}};
pcv_t pcv = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}; pcv_t pcv = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}};
double neu[3]; double neu[3];
int i, f, freq = 0, state = 0, freqs[] = {1, 2, 5, 6, 7, 8, 0}; int i;
int f;
int freq = 0;
int state = 0;
int freqs[] = {1, 2, 5, 6, 7, 8, 0};
char buff[256]; char buff[256];
trace(3, "readantex: file=%s\n", file); trace(3, "readantex: file=%s\n", file);
@ -2803,7 +2899,8 @@ int readpcv(const char *file, pcvs_t *pcvs)
{ {
pcv_t *pcv; pcv_t *pcv;
const char *ext; const char *ext;
int i, stat; int i;
int stat;
trace(3, "readpcv: file=%s\n", file); trace(3, "readpcv: file=%s\n", file);
@ -2843,8 +2940,12 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time,
const pcvs_t *pcvs) const pcvs_t *pcvs)
{ {
pcv_t *pcv; pcv_t *pcv;
char buff[MAXANT] = "", *types[2], *p; char buff[MAXANT] = "";
int i, j, n = 0; char *types[2];
char *p;
int i;
int j;
int n = 0;
trace(3, "searchpcv: sat=%2d type=%s\n", sat, type); trace(3, "searchpcv: sat=%2d type=%s\n", sat, type);
@ -2934,8 +3035,12 @@ void readpos(const char *file, const char *rcv, double *pos)
static double poss[2048][3]; static double poss[2048][3];
static char stas[2048][16]; static char stas[2048][16];
FILE *fp; FILE *fp;
int i, j, len, np = 0; int i;
char buff[256], str[256]; int j;
int len;
int np = 0;
char buff[256];
char str[256];
trace(3, "readpos: file=%s\n", file); trace(3, "readpos: file=%s\n", file);
@ -2984,7 +3089,8 @@ int readblqrecord(FILE *fp, double *odisp)
{ {
double v[11]; double v[11];
char buff[256]; char buff[256];
int i, n = 0; int i;
int n = 0;
while (fgets(buff, sizeof(buff), fp)) while (fgets(buff, sizeof(buff), fp))
{ {
@ -3020,7 +3126,10 @@ int readblqrecord(FILE *fp, double *odisp)
int readblq(const char *file, const char *sta, double *odisp) int readblq(const char *file, const char *sta, double *odisp)
{ {
FILE *fp; FILE *fp;
char buff[256], staname[32] = "", name[32], *p; char buff[256];
char staname[32] = "";
char name[32];
char *p;
/* station name to upper case */ /* station name to upper case */
sscanf(sta, "%16s", staname); sscanf(sta, "%16s", staname);
@ -3131,8 +3240,12 @@ int readerp(const char *file, erp_t *erp)
int geterp(const erp_t *erp, gtime_t time, double *erpv) int geterp(const erp_t *erp, gtime_t time, double *erpv)
{ {
const double ep[] = {2000, 1, 1, 12, 0, 0}; const double ep[] = {2000, 1, 1, 12, 0, 0};
double mjd, day, a; double mjd;
int i, j, k; double day;
double a;
int i;
int j;
int k;
trace(4, "geterp:\n"); trace(4, "geterp:\n");
@ -3191,7 +3304,8 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv)
/* compare ephemeris ---------------------------------------------------------*/ /* compare ephemeris ---------------------------------------------------------*/
int cmpeph(const void *p1, const void *p2) int cmpeph(const void *p1, const void *p2)
{ {
auto *q1 = (eph_t *)p1, *q2 = (eph_t *)p2; auto *q1 = (eph_t *)p1;
auto *q2 = (eph_t *)p2;
return q1->ttr.time != q2->ttr.time ? static_cast<int>(q1->ttr.time - q2->ttr.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat); return q1->ttr.time != q2->ttr.time ? static_cast<int>(q1->ttr.time - q2->ttr.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat);
} }
@ -3200,7 +3314,8 @@ int cmpeph(const void *p1, const void *p2)
void uniqeph(nav_t *nav) void uniqeph(nav_t *nav)
{ {
eph_t *nav_eph; eph_t *nav_eph;
int i, j; int i;
int j;
trace(3, "uniqeph: n=%d\n", nav->n); trace(3, "uniqeph: n=%d\n", nav->n);
@ -3239,7 +3354,8 @@ void uniqeph(nav_t *nav)
/* compare glonass ephemeris -------------------------------------------------*/ /* compare glonass ephemeris -------------------------------------------------*/
int cmpgeph(const void *p1, const void *p2) int cmpgeph(const void *p1, const void *p2)
{ {
auto *q1 = (geph_t *)p1, *q2 = (geph_t *)p2; auto *q1 = (geph_t *)p1;
auto *q2 = (geph_t *)p2;
return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat); return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat);
} }
@ -3248,7 +3364,8 @@ int cmpgeph(const void *p1, const void *p2)
void uniqgeph(nav_t *nav) void uniqgeph(nav_t *nav)
{ {
geph_t *nav_geph; geph_t *nav_geph;
int i, j; int i;
int j;
trace(3, "uniqgeph: ng=%d\n", nav->ng); trace(3, "uniqgeph: ng=%d\n", nav->ng);
@ -3288,7 +3405,8 @@ void uniqgeph(nav_t *nav)
/* compare sbas ephemeris ----------------------------------------------------*/ /* compare sbas ephemeris ----------------------------------------------------*/
int cmpseph(const void *p1, const void *p2) int cmpseph(const void *p1, const void *p2)
{ {
auto *q1 = (seph_t *)p1, *q2 = (seph_t *)p2; auto *q1 = (seph_t *)p1;
auto *q2 = (seph_t *)p2;
return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->t0.time != q2->t0.time ? static_cast<int>(q1->t0.time - q2->t0.time) : q1->sat - q2->sat); return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->t0.time != q2->t0.time ? static_cast<int>(q1->t0.time - q2->t0.time) : q1->sat - q2->sat);
} }
@ -3297,7 +3415,8 @@ int cmpseph(const void *p1, const void *p2)
void uniqseph(nav_t *nav) void uniqseph(nav_t *nav)
{ {
seph_t *nav_seph; seph_t *nav_seph;
int i, j; int i;
int j;
trace(3, "uniqseph: ns=%d\n", nav->ns); trace(3, "uniqseph: ns=%d\n", nav->ns);
@ -3340,7 +3459,8 @@ void uniqseph(nav_t *nav)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void uniqnav(nav_t *nav) void uniqnav(nav_t *nav)
{ {
int i, j; int i;
int j;
trace(3, "uniqnav: neph=%d ngeph=%d nseph=%d\n", nav->n, nav->ng, nav->ns); trace(3, "uniqnav: neph=%d ngeph=%d nseph=%d\n", nav->n, nav->ng, nav->ns);
@ -3363,7 +3483,8 @@ void uniqnav(nav_t *nav)
/* compare observation data -------------------------------------------------*/ /* compare observation data -------------------------------------------------*/
int cmpobs(const void *p1, const void *p2) int cmpobs(const void *p1, const void *p2)
{ {
auto *q1 = (obsd_t *)p1, *q2 = (obsd_t *)p2; auto *q1 = (obsd_t *)p1;
auto *q2 = (obsd_t *)p2;
double tt = timediff(q1->time, q2->time); double tt = timediff(q1->time, q2->time);
if (fabs(tt) > DTTOL) if (fabs(tt) > DTTOL)
{ {
@ -3384,7 +3505,9 @@ int cmpobs(const void *p1, const void *p2)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int sortobs(obs_t *obs) int sortobs(obs_t *obs)
{ {
int i, j, n; int i;
int j;
int n;
trace(3, "sortobs: nobs=%d\n", obs->n); trace(3, "sortobs: nobs=%d\n", obs->n);
@ -3449,9 +3572,15 @@ int readnav(const char *file, nav_t *nav)
eph_t eph0 = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0, eph_t eph0 = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0}; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0};
geph_t geph0 = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {}, {}, {}, 0.0, 0.0, 0.0}; geph_t geph0 = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {}, {}, {}, 0.0, 0.0, 0.0};
char buff[4096], *p; char buff[4096];
int32_t toe_time, tof_time, toc_time, ttr_time; char *p;
int i, sat, prn; int32_t toe_time;
int32_t tof_time;
int32_t toc_time;
int32_t ttr_time;
int i;
int sat;
int prn;
trace(3, "loadnav: file=%s\n", file); trace(3, "loadnav: file=%s\n", file);
@ -3956,7 +4085,8 @@ int execcmd(const char *cmd)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void createdir(const char *path) void createdir(const char *path)
{ {
char buff[1024], *p; char buff[1024];
char *p;
//tracet(3, "createdir: path=%s\n", path); //tracet(3, "createdir: path=%s\n", path);
if (strlen(path) < 1025) if (strlen(path) < 1025)
@ -3984,7 +4114,10 @@ void createdir(const char *path)
int repstr(char *str, const char *pat, const char *rep) int repstr(char *str, const char *pat, const char *rep)
{ {
int len = static_cast<int>(strlen(pat)); int len = static_cast<int>(strlen(pat));
char buff[1024], *p, *q, *r; char buff[1024];
char *p;
char *q;
char *r;
for (p = str, r = buff; *p; p = q + len) for (p = str, r = buff; *p; p = q + len)
{ {
@ -4045,8 +4178,12 @@ int repstr(char *str, const char *pat, const char *rep)
int reppath(const char *path, char *rpath, gtime_t time, const char *rov, int reppath(const char *path, char *rpath, gtime_t time, const char *rov,
const char *base) const char *base)
{ {
double ep[6], ep0[6] = {2000, 1, 1, 0, 0, 0}; double ep[6];
int week, dow, doy, stat = 0; double ep0[6] = {2000, 1, 1, 0, 0, 0};
int week;
int dow;
int doy;
int stat = 0;
char rep[64]; char rep[64];
strcpy(rpath, path); strcpy(rpath, path);
@ -4130,8 +4267,11 @@ int reppaths(const char *path, char *rpath[], int nmax, gtime_t ts,
gtime_t te, const char *rov, const char *base) gtime_t te, const char *rov, const char *base)
{ {
gtime_t time; gtime_t time;
double tow, tint = 86400.0; double tow;
int i, n = 0, week; double tint = 86400.0;
int i;
int n = 0;
int week;
trace(3, "reppaths: path =%s nmax=%d rov=%s base=%s\n", path, nmax, rov, base); trace(3, "reppaths: path =%s nmax=%d rov=%s base=%s\n", path, nmax, rov, base);
@ -4180,7 +4320,8 @@ double satwavelen(int sat, int frq, const nav_t *nav)
{ {
const double freq_glo[] = {FREQ1_GLO, FREQ2_GLO}; const double freq_glo[] = {FREQ1_GLO, FREQ2_GLO};
const double dfrq_glo[] = {DFRQ1_GLO, DFRQ2_GLO}; const double dfrq_glo[] = {DFRQ1_GLO, DFRQ2_GLO};
int i, sys = satsys(sat, nullptr); int i;
int sys = satsys(sat, nullptr);
if (sys == SYS_GLO) if (sys == SYS_GLO)
{ {
@ -4290,7 +4431,9 @@ double geodist(const double *rs, const double *rr, double *e)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
double satazel(const double *pos, const double *e, double *azel) double satazel(const double *pos, const double *e, double *azel)
{ {
double az = 0.0, el = PI / 2.0, enu[3]; double az = 0.0;
double el = PI / 2.0;
double enu[3];
if (pos[2] > -RE_WGS84) if (pos[2] > -RE_WGS84)
{ {
@ -4322,8 +4465,12 @@ double satazel(const double *pos, const double *e, double *azel)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void dops(int ns, const double *azel, double elmin, double *dop) void dops(int ns, const double *azel, double elmin, double *dop)
{ {
double H[4 * MAXSAT], Q[16], cosel, sinel; double H[4 * MAXSAT];
int i, n; double Q[16];
double cosel;
double sinel;
int i;
int n;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
@ -4372,7 +4519,14 @@ double ionmodel(gtime_t t, const double *ion, const double *pos,
const double ion_default[] = {/* 2004/1/1 */ const double ion_default[] = {/* 2004/1/1 */
0.1118E-07, -0.7451e-08, -0.5961e-07, 0.1192E-06, 0.1118E-07, -0.7451e-08, -0.5961e-07, 0.1192E-06,
0.1167E+06, -0.2294E+06, -0.1311e+06, 0.1049E+07}; 0.1167E+06, -0.2294E+06, -0.1311e+06, 0.1049E+07};
double tt, f, psi, phi, lam, amp, per, x; double tt;
double f;
double psi;
double phi;
double lam;
double amp;
double per;
double x;
int week; int week;
if (pos[2] < -1e3 || azel[1] <= 0) if (pos[2] < -1e3 || azel[1] <= 0)
@ -4450,7 +4604,11 @@ double ionmapf(const double *pos, const double *azel)
double ionppp(const double *pos, const double *azel, double re, double ionppp(const double *pos, const double *azel, double re,
double hion, double *posp) double hion, double *posp)
{ {
double cosaz, rp, ap, sinap, tanap; double cosaz;
double rp;
double ap;
double sinap;
double tanap;
rp = re / (re + hion) * cos(azel[1]); rp = re / (re + hion) * cos(azel[1]);
ap = PI / 2.0 - azel[1] - asin(rp); ap = PI / 2.0 - azel[1] - asin(rp);
@ -4484,7 +4642,13 @@ double tropmodel(gtime_t time __attribute__((unused)), const double *pos, const
double humi) double humi)
{ {
const double temp0 = 15.0; /* temparature at sea level */ const double temp0 = 15.0; /* temparature at sea level */
double hgt, pres, temp, e, z, trph, trpw; double hgt;
double pres;
double temp;
double e;
double z;
double trph;
double trpw;
if (pos[2] < -100.0 || 1e4 < pos[2] || azel[1] <= 0) if (pos[2] < -100.0 || 1e4 < pos[2] || azel[1] <= 0)
{ {
@ -4548,7 +4712,14 @@ double nmf(gtime_t time, const double pos[], const double azel[],
{4.3472961e-2, 4.6729510E-2, 4.3908931e-2, 4.4626982E-2, 5.4736038E-2}}; {4.3472961e-2, 4.6729510E-2, 4.3908931e-2, 4.4626982E-2, 5.4736038E-2}};
const double aht[] = {2.53E-5, 5.49E-3, 1.14E-3}; /* height correction */ const double aht[] = {2.53E-5, 5.49E-3, 1.14E-3}; /* height correction */
double y, cosy, ah[3], aw[3], dm, el = azel[1], lat = pos[0] * R2D, hgt = pos[2]; double y;
double cosy;
double ah[3];
double aw[3];
double dm;
double el = azel[1];
double lat = pos[0] * R2D;
double hgt = pos[2];
int i; int i;
if (el <= 0.0) if (el <= 0.0)
@ -4660,8 +4831,11 @@ double interpvar(double ang, const double *var)
void antmodel(const pcv_t *pcv, const double *del, const double *azel, void antmodel(const pcv_t *pcv, const double *del, const double *azel,
int opt, double *dant) int opt, double *dant)
{ {
double e[3], off[3], cosel = cos(azel[1]); double e[3];
int i, j; double off[3];
double cosel = cos(azel[1]);
int i;
int j;
trace(4, "antmodel: azel=%6.1f %4.1f opt=%d\n", azel[0] * R2D, azel[1] * R2D, opt); trace(4, "antmodel: azel=%6.1f %4.1f opt=%d\n", azel[0] * R2D, azel[1] * R2D, opt);
@ -4707,7 +4881,21 @@ void antmodel_s(const pcv_t *pcv, double nadir, double *dant)
void sunmoonpos_eci(gtime_t tut, double *rsun, double *rmoon) void sunmoonpos_eci(gtime_t tut, double *rsun, double *rmoon)
{ {
const double ep2000[] = {2000, 1, 1, 12, 0, 0}; const double ep2000[] = {2000, 1, 1, 12, 0, 0};
double t, f[5], eps, Ms, ls, rs, lm, pm, rm, sine, cose, sinp, cosp, sinl, cosl; double t;
double f[5];
double eps;
double Ms;
double ls;
double rs;
double lm;
double pm;
double rm;
double sine;
double cose;
double sinp;
double cosp;
double sinl;
double cosl;
trace(4, "sunmoonpos_eci: tut=%s\n", time_str(tut, 3)); trace(4, "sunmoonpos_eci: tut=%s\n", time_str(tut, 3));
@ -4771,7 +4959,10 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
double *rmoon, double *gmst) double *rmoon, double *gmst)
{ {
gtime_t tut; gtime_t tut;
double rs[3], rm[3], U[9], gmst_; double rs[3];
double rm[3];
double U[9];
double gmst_;
trace(4, "sunmoonpos: tutc=%s\n", time_str(tutc, 3)); trace(4, "sunmoonpos: tutc=%s\n", time_str(tutc, 3));
@ -4807,8 +4998,14 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void csmooth(obs_t *obs, int ns) void csmooth(obs_t *obs, int ns)
{ {
double Ps[2][MAXSAT][NFREQ] = {}, Lp[2][MAXSAT][NFREQ] = {}, dcp; double Ps[2][MAXSAT][NFREQ] = {};
int i, j, s, r, n[2][MAXSAT][NFREQ] = {}; double Lp[2][MAXSAT][NFREQ] = {};
double dcp;
int i;
int j;
int s;
int r;
int n[2][MAXSAT][NFREQ] = {};
obsd_t *p; obsd_t *p;
trace(3, "csmooth: nobs=%d,ns=%d\n", obs->n, ns); trace(3, "csmooth: nobs=%d,ns=%d\n", obs->n, ns);
@ -4866,7 +5063,12 @@ void csmooth(obs_t *obs, int ns)
int rtk_uncompress(const char *file, char *uncfile) int rtk_uncompress(const char *file, char *uncfile)
{ {
int stat = 0; int stat = 0;
char *p, cmd[2048] = "", tmpfile[1024] = "", buff[1024], *fname, *dir = (char *)""; char *p;
char cmd[2048] = "";
char tmpfile[1024] = "";
char buff[1024];
char *fname;
char *dir = (char *)"";
trace(3, "rtk_uncompress: file=%s\n", file); trace(3, "rtk_uncompress: file=%s\n", file);
@ -5001,12 +5203,19 @@ int rtk_uncompress(const char *file, char *uncfile)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int expath(const char *path, char *paths[], int nmax) int expath(const char *path, char *paths[], int nmax)
{ {
int i, j, n = 0; int i;
int j;
int n = 0;
char tmp[1024] = ""; char tmp[1024] = "";
struct dirent *d; struct dirent *d;
DIR *dp; DIR *dp;
const char *file = path; const char *file = path;
char dir[1024] = "", s1[1024], s2[1024], *p, *q, *r; char dir[1024] = "";
char s1[1024];
char s2[1024];
char *p;
char *q;
char *r;
trace(3, "expath : path=%s nmax=%d\n", path, nmax); trace(3, "expath : path=%s nmax=%d\n", path, nmax);
@ -5083,8 +5292,25 @@ int expath(const char *path, char *paths[], int nmax)
/* From RTKLIB 2.4.2 */ /* From RTKLIB 2.4.2 */
void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw) void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw)
{ {
double ek[3], exs[3], eys[3], ezs[3], ess[3], exr[3], eyr[3], eks[3], ekr[3], E[9]; double ek[3];
double dr[3], ds[3], drs[3], r[3], pos[3], rsun[3], cosp, ph, erpv[5] = {0}; double exs[3];
double eys[3];
double ezs[3];
double ess[3];
double exr[3];
double eyr[3];
double eks[3];
double ekr[3];
double E[9];
double dr[3];
double ds[3];
double drs[3];
double r[3];
double pos[3];
double rsun[3];
double cosp;
double ph;
double erpv[5] = {0};
int i; int i;
trace(4, "windupcorr: time=%s\n", time_str(time, 0)); trace(4, "windupcorr: time=%s\n", time_str(time, 0));

View File

@ -198,8 +198,19 @@ void rtkclosestat(void)
void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused)))
{ {
ssat_t *ssat; ssat_t *ssat;
double tow, pos[3], vel[3], acc[3], vela[3] = {0}, acca[3] = {0}, xa[3]; double tow;
int i, j, week, est, nfreq, nf = NF_RTK(&rtk->opt); double pos[3];
double vel[3];
double acc[3];
double vela[3] = {0};
double acca[3] = {0};
double xa[3];
int i;
int j;
int week;
int est;
int nfreq;
int nf = NF_RTK(&rtk->opt);
char id[32]; char id[32];
if (statlevel <= 0 || !fp_stat) if (statlevel <= 0 || !fp_stat)
@ -363,8 +374,19 @@ void swapsolstat(void)
void outsolstat(rtk_t *rtk) void outsolstat(rtk_t *rtk)
{ {
ssat_t *ssat; ssat_t *ssat;
double tow, pos[3], vel[3], acc[3], vela[3] = {0}, acca[3] = {0}, xa[3]; double tow;
int i, j, week, est, nfreq, nf = NF_RTK(&rtk->opt); double pos[3];
double vel[3];
double acc[3];
double vela[3] = {0};
double acca[3] = {0};
double xa[3];
int i;
int j;
int week;
int est;
int nfreq;
int nf = NF_RTK(&rtk->opt);
char id[32]; char id[32];
if (statlevel <= 0 || !fp_stat) if (statlevel <= 0 || !fp_stat)
@ -496,7 +518,8 @@ void outsolstat(rtk_t *rtk)
/* save error message --------------------------------------------------------*/ /* save error message --------------------------------------------------------*/
void errmsg(rtk_t *rtk, const char *format, ...) void errmsg(rtk_t *rtk, const char *format, ...)
{ {
char buff[256], tstr[32]; char buff[256];
char tstr[32];
int n; int n;
va_list ap; va_list ap;
time2str(rtk->sol.time, tstr, 2); time2str(rtk->sol.time, tstr, 2);
@ -523,14 +546,16 @@ double sdobs(const obsd_t *obs, int i, int j, int f)
/* single-differenced geometry-free linear combination of phase --------------*/ /* single-differenced geometry-free linear combination of phase --------------*/
double gfobs_L1L2(const obsd_t *obs, int i, int j, const double *lam) double gfobs_L1L2(const obsd_t *obs, int i, int j, const double *lam)
{ {
double pi = sdobs(obs, i, j, 0) * lam[0], pj = sdobs(obs, i, j, 1) * lam[1]; double pi = sdobs(obs, i, j, 0) * lam[0];
double pj = sdobs(obs, i, j, 1) * lam[1];
return pi == 0.0 || pj == 0.0 ? 0.0 : pi - pj; return pi == 0.0 || pj == 0.0 ? 0.0 : pi - pj;
} }
double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam) double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam)
{ {
double pi = sdobs(obs, i, j, 0) * lam[0], pj = sdobs(obs, i, j, 2) * lam[2]; double pi = sdobs(obs, i, j, 0) * lam[0];
double pj = sdobs(obs, i, j, 2) * lam[2];
return pi == 0.0 || pj == 0.0 ? 0.0 : pi - pj; return pi == 0.0 || pj == 0.0 ? 0.0 : pi - pj;
} }
@ -539,9 +564,14 @@ double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam)
double varerr(int sat __attribute((unused)), int sys, double el, double bl, double dt, int f, double varerr(int sat __attribute((unused)), int sys, double el, double bl, double dt, int f,
const prcopt_t *opt) const prcopt_t *opt)
{ {
double a, b, c = opt->err[3] * bl / 1e4, d = SPEED_OF_LIGHT * opt->sclkstab * dt, fact = 1.0; double a;
double b;
double c = opt->err[3] * bl / 1e4;
double d = SPEED_OF_LIGHT * opt->sclkstab * dt;
double fact = 1.0;
double sinel = sin(el); double sinel = sin(el);
int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0), nf = NF_RTK(opt); int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0);
int nf = NF_RTK(opt);
/* extended error model */ /* extended error model */
if (f >= nf && opt->exterr.ena[0]) if (f >= nf && opt->exterr.ena[0])
@ -610,7 +640,9 @@ void initx_rtk(rtk_t *rtk, double xi, double var, int i)
int selsat(const obsd_t *obs, const double *azel, int nu, int nr, int selsat(const obsd_t *obs, const double *azel, int nu, int nr,
const prcopt_t *opt, int *sat, int *iu, int *ir) const prcopt_t *opt, int *sat, int *iu, int *ir)
{ {
int i, j, k = 0; int i;
int j;
int k = 0;
trace(3, "selsat : nu=%d nr=%d\n", nu, nr); trace(3, "selsat : nu=%d nr=%d\n", nu, nr);
@ -639,8 +671,15 @@ int selsat(const obsd_t *obs, const double *azel, int nu, int nr,
/* temporal update of position/velocity/acceleration -------------------------*/ /* temporal update of position/velocity/acceleration -------------------------*/
void udpos(rtk_t *rtk, double tt) void udpos(rtk_t *rtk, double tt)
{ {
double *F, *FP, *xp, pos[3], Q[9] = {0}, Qv[9], var = 0.0; double *F;
int i, j; double *FP;
double *xp;
double pos[3];
double Q[9] = {0};
double Qv[9];
double var = 0.0;
int i;
int j;
trace(3, "udpos : tt=%.3f\n", tt); trace(3, "udpos : tt=%.3f\n", tt);
@ -748,8 +787,10 @@ void udpos(rtk_t *rtk, double tt)
/* temporal update of ionospheric parameters ---------------------------------*/ /* temporal update of ionospheric parameters ---------------------------------*/
void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns) void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns)
{ {
double el, fact; double el;
int i, j; double fact;
int i;
int j;
trace(3, "udion : tt=%.1f bl=%.0f ns=%d\n", tt, bl, ns); trace(3, "udion : tt=%.1f bl=%.0f ns=%d\n", tt, bl, ns);
@ -784,7 +825,9 @@ void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns)
/* temporal update of tropospheric parameters --------------------------------*/ /* temporal update of tropospheric parameters --------------------------------*/
void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused))) void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused)))
{ {
int i, j, k; int i;
int j;
int k;
trace(3, "udtrop : tt=%.1f\n", tt); trace(3, "udtrop : tt=%.1f\n", tt);
@ -823,7 +866,8 @@ void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused)))
/* temporal update of receiver h/w biases ------------------------------------*/ /* temporal update of receiver h/w biases ------------------------------------*/
void udrcvbias(rtk_t *rtk, double tt) void udrcvbias(rtk_t *rtk, double tt)
{ {
int i, j; int i;
int j;
trace(3, "udrcvbias: tt=%.1f\n", tt); trace(3, "udrcvbias: tt=%.1f\n", tt);
@ -851,8 +895,10 @@ void udrcvbias(rtk_t *rtk, double tt)
/* detect cycle slip by LLI --------------------------------------------------*/ /* detect cycle slip by LLI --------------------------------------------------*/
void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv) void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv)
{ {
unsigned int slip, LLI; unsigned int slip;
int f, sat = obs[i].sat; unsigned int LLI;
int f;
int sat = obs[i].sat;
trace(3, "detslp_ll: i=%d rcv=%d\n", i, rcv); trace(3, "detslp_ll: i=%d rcv=%d\n", i, rcv);
@ -921,7 +967,8 @@ void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j,
const nav_t *nav) const nav_t *nav)
{ {
int sat = obs[i].sat; int sat = obs[i].sat;
double g0, g1; double g0;
double g1;
trace(3, "detslp_gf_L1L2: i=%d j=%d\n", i, j); trace(3, "detslp_gf_L1L2: i=%d j=%d\n", i, j);
@ -948,7 +995,8 @@ void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j,
const nav_t *nav) const nav_t *nav)
{ {
int sat = obs[i].sat; int sat = obs[i].sat;
double g0, g1; double g0;
double g1;
trace(3, "detslp_gf_L1L5: i=%d j=%d\n", i, j); trace(3, "detslp_gf_L1L5: i=%d j=%d\n", i, j);
@ -1012,8 +1060,25 @@ void detslp_dop(rtk_t *rtk __attribute__((unused)), const obsd_t *obs __attribut
void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat,
const int *iu, const int *ir, int ns, const nav_t *nav) const int *iu, const int *ir, int ns, const nav_t *nav)
{ {
double cp, pr, cp1, cp2, pr1, pr2, *bias, offset, lami, lam1, lam2, C1, C2; double cp;
int i, j, f, slip, reset, nf = NF_RTK(&rtk->opt); double pr;
double cp1;
double cp2;
double pr1;
double pr2;
double *bias;
double offset;
double lami;
double lam1;
double lam2;
double C1;
double C2;
int i;
int j;
int f;
int slip;
int reset;
int nf = NF_RTK(&rtk->opt);
trace(3, "udbias : tt=%.1f ns=%d\n", tt, ns); trace(3, "udbias : tt=%.1f ns=%d\n", tt, ns);
@ -1150,7 +1215,9 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat,
void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat, void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat,
const int *iu, const int *ir, int ns, const nav_t *nav) const int *iu, const int *ir, int ns, const nav_t *nav)
{ {
double tt = fabs(rtk->tt), bl = 0.0, dr[3]; double tt = fabs(rtk->tt);
double bl = 0.0;
double dr[3];
trace(3, "udstate : ns=%d\n", ns); trace(3, "udstate : ns=%d\n", ns);
@ -1187,8 +1254,13 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav,
const prcopt_t *opt, double *y) const prcopt_t *opt, double *y)
{ {
const double *lam = nav->lam[obs->sat - 1]; const double *lam = nav->lam[obs->sat - 1];
double f1, f2, C1, C2, dant_if; double f1;
int i, nf = NF_RTK(opt); double f2;
double C1;
double C2;
double dant_if;
int i;
int nf = NF_RTK(opt);
if (opt->ionoopt == IONOOPT_IFLC) if (opt->ionoopt == IONOOPT_IFLC)
{ /* iono-free linear combination */ { /* iono-free linear combination */
@ -1252,9 +1324,15 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs,
const double *rr, const prcopt_t *opt, int index, double *y, const double *rr, const prcopt_t *opt, int index, double *y,
double *e, double *azel) double *e, double *azel)
{ {
double r, rr_[3], pos[3], dant[NFREQ] = {0}, disp[3]; double r;
double zhd, zazel[] = {0.0, 90.0 * D2R}; double rr_[3];
int i, nf = NF_RTK(opt); double pos[3];
double dant[NFREQ] = {0};
double disp[3];
double zhd;
double zazel[] = {0.0, 90.0 * D2R};
int i;
int nf = NF_RTK(opt);
trace(3, "zdres : n=%d\n", n); trace(3, "zdres : n=%d\n", n);
@ -1345,7 +1423,10 @@ int validobs(int i, int j, int f, int nf, const double *y)
void ddcov(const int *nb, int n, const double *Ri, const double *Rj, void ddcov(const int *nb, int n, const double *Ri, const double *Rj,
int nv, double *R) int nv, double *R)
{ {
int i, j, k = 0, b; int i;
int j;
int k = 0;
int b;
trace(3, "ddcov : n=%d\n", n); trace(3, "ddcov : n=%d\n", n);
@ -1373,7 +1454,10 @@ int constbl(rtk_t *rtk, const double *x, const double *P, double *v,
double *H, double *Ri, double *Rj, int index) double *H, double *Ri, double *Rj, int index)
{ {
const double thres = 0.1; /* threshold for nonliearity (v.2.3.0) */ const double thres = 0.1; /* threshold for nonliearity (v.2.3.0) */
double xb[3], b[3], bb, var = 0.0; double xb[3];
double b[3];
double bb;
double var = 0.0;
int i; int i;
trace(3, "constbl : \n"); trace(3, "constbl : \n");
@ -1430,7 +1514,10 @@ double prectrop(gtime_t time, const double *pos, int r,
const double *azel, const prcopt_t *opt, const double *x, const double *azel, const prcopt_t *opt, const double *x,
double *dtdx) double *dtdx)
{ {
double m_w = 0.0, cotz, grad_n, grad_e; double m_w = 0.0;
double cotz;
double grad_n;
double grad_e;
int i = IT_RTK(r, opt); int i = IT_RTK(r, opt);
/* wet mapping function */ /* wet mapping function */
@ -1501,9 +1588,37 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x,
double *H, double *R, int *vflg) double *H, double *R, int *vflg)
{ {
prcopt_t *opt = &rtk->opt; prcopt_t *opt = &rtk->opt;
double bl, dr[3], posu[3], posr[3], didxi = 0.0, didxj = 0.0, *im; double bl;
double *tropr, *tropu, *dtdxr, *dtdxu, *Ri, *Rj, lami, lamj, fi, fj, df, *Hi = nullptr; double dr[3];
int i, j, k, m, f, ff, nv = 0, nb[NFREQ * 4 * 2 + 2] = {0}, b = 0, sysi, sysj, nf = NF_RTK(opt); double posu[3];
double posr[3];
double didxi = 0.0;
double didxj = 0.0;
double *im;
double *tropr;
double *tropu;
double *dtdxr;
double *dtdxu;
double *Ri;
double *Rj;
double lami;
double lamj;
double fi;
double fj;
double df;
double *Hi = nullptr;
int i;
int j;
int k;
int m;
int f;
int ff;
int nv = 0;
int nb[NFREQ * 4 * 2 + 2] = {0};
int b = 0;
int sysi;
int sysj;
int nf = NF_RTK(opt);
trace(3, "ddres : dt=%.1f nx=%d ns=%d\n", dt, rtk->nx, ns); trace(3, "ddres : dt=%.1f nx=%d ns=%d\n", dt, rtk->nx, ns);
@ -1778,12 +1893,23 @@ double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav,
rtk_t *rtk, double *y) rtk_t *rtk, double *y)
{ {
static obsd_t obsb[MAXOBS]; static obsd_t obsb[MAXOBS];
static double yb[MAXOBS * NFREQ * 2], rs[MAXOBS * 6], dts[MAXOBS * 2], var[MAXOBS]; static double yb[MAXOBS * NFREQ * 2];
static double e[MAXOBS * 3], azel[MAXOBS * 2]; static double rs[MAXOBS * 6];
static int nb = 0, svh[MAXOBS * 2]; static double dts[MAXOBS * 2];
static double var[MAXOBS];
static double e[MAXOBS * 3];
static double azel[MAXOBS * 2];
static int nb = 0;
static int svh[MAXOBS * 2];
prcopt_t *opt = &rtk->opt; prcopt_t *opt = &rtk->opt;
double tt = timediff(time, obs[0].time), ttb, *p, *q; double tt = timediff(time, obs[0].time);
int i, j, k, nf = NF_RTK(opt); double ttb;
double *p;
double *q;
int i;
int j;
int k;
int nf = NF_RTK(opt);
trace(3, "intpres : n=%d tt=%.1f\n", n, tt); trace(3, "intpres : n=%d tt=%.1f\n", n, tt);
@ -1840,7 +1966,16 @@ double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav,
/* single to double-difference transformation matrix (D') --------------------*/ /* single to double-difference transformation matrix (D') --------------------*/
int ddmat(rtk_t *rtk, double *D) int ddmat(rtk_t *rtk, double *D)
{ {
int i, j, k, m, f, nb = 0, nx = rtk->nx, na = rtk->na, nf = NF_RTK(&rtk->opt), nofix; int i;
int j;
int k;
int m;
int f;
int nb = 0;
int nx = rtk->nx;
int na = rtk->na;
int nf = NF_RTK(&rtk->opt);
int nofix;
trace(3, "ddmat :\n"); trace(3, "ddmat :\n");
@ -1912,7 +2047,13 @@ int ddmat(rtk_t *rtk, double *D)
/* restore single-differenced ambiguity --------------------------------------*/ /* restore single-differenced ambiguity --------------------------------------*/
void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), double *xa) void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), double *xa)
{ {
int i, n, m, f, index[MAXSAT], nv = 0, nf = NF_RTK(&rtk->opt); int i;
int n;
int m;
int f;
int index[MAXSAT];
int nv = 0;
int nf = NF_RTK(&rtk->opt);
trace(3, "restamb :\n"); trace(3, "restamb :\n");
@ -1956,8 +2097,18 @@ void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), doubl
/* hold integer ambiguity ----------------------------------------------------*/ /* hold integer ambiguity ----------------------------------------------------*/
void holdamb(rtk_t *rtk, const double *xa) void holdamb(rtk_t *rtk, const double *xa)
{ {
double *v, *H, *R; double *v;
int i, n, m, f, info, index[MAXSAT], nb = rtk->nx - rtk->na, nv = 0, nf = NF_RTK(&rtk->opt); double *H;
double *R;
int i;
int n;
int m;
int f;
int info;
int index[MAXSAT];
int nb = rtk->nx - rtk->na;
int nv = 0;
int nf = NF_RTK(&rtk->opt);
trace(3, "holdamb :\n"); trace(3, "holdamb :\n");
@ -2013,8 +2164,23 @@ void holdamb(rtk_t *rtk, const double *xa)
int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa)
{ {
prcopt_t *opt = &rtk->opt; prcopt_t *opt = &rtk->opt;
int i, j, ny, nb, info, nx = rtk->nx, na = rtk->na; int i;
double *D, *DP, *y, *Qy, *b, *db, *Qb, *Qab, *QQ, s[2]; int j;
int ny;
int nb;
int info;
int nx = rtk->nx;
int na = rtk->na;
double *D;
double *DP;
double *y;
double *Qy;
double *b;
double *db;
double *Qb;
double *Qab;
double *QQ;
double s[2];
trace(3, "resamb_LAMBDA : nx=%d\n", nx); trace(3, "resamb_LAMBDA : nx=%d\n", nx);
@ -2152,7 +2318,12 @@ int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg,
double vv = 0.0; double vv = 0.0;
#endif #endif
double fact = thres * thres; double fact = thres * thres;
int i, stat = 1, sat1, sat2, type, freq; int i;
int stat = 1;
int sat1;
int sat2;
int type;
int freq;
char stype; char stype;
trace(3, "valpos : nv=%d thres=%.1f\n", nv, thres); trace(3, "valpos : nv=%d thres=%.1f\n", nv, thres);
@ -2201,9 +2372,34 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr,
{ {
prcopt_t *opt = &rtk->opt; prcopt_t *opt = &rtk->opt;
gtime_t time = obs[0].time; gtime_t time = obs[0].time;
double *rs, *dts, *var, *y, *e, *azel, *v, *H, *R, *xp, *Pp, *xa, *bias, dt; double *rs;
int i, j, f, n = nu + nr, ns, ny, nv, sat[MAXSAT], iu[MAXSAT], ir[MAXSAT], niter; double *dts;
int info, vflg[MAXOBS * NFREQ * 2 + 1], svh[MAXOBS * 2]; double *var;
double *y;
double *e;
double *azel;
double *v;
double *H;
double *R;
double *xp;
double *Pp;
double *xa;
double *bias;
double dt;
int i;
int j;
int f;
int n = nu + nr;
int ns;
int ny;
int nv;
int sat[MAXSAT];
int iu[MAXSAT];
int ir[MAXSAT];
int niter;
int info;
int vflg[MAXOBS * NFREQ * 2 + 1];
int svh[MAXOBS * 2];
int stat = rtk->opt.mode <= PMODE_DGPS ? SOLQ_DGPS : SOLQ_FLOAT; int stat = rtk->opt.mode <= PMODE_DGPS ? SOLQ_DGPS : SOLQ_FLOAT;
int nf = opt->ionoopt == IONOOPT_IFLC ? 1 : opt->nf; int nf = opt->ionoopt == IONOOPT_IFLC ? 1 : opt->nf;
@ -2593,7 +2789,9 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
prcopt_t *opt = &rtk->opt; prcopt_t *opt = &rtk->opt;
sol_t solb = {{0, 0}, {}, {}, {}, '0', '0', '0', 0.0, 0.0, 0.0}; sol_t solb = {{0, 0}, {}, {}, {}, '0', '0', '0', 0.0, 0.0, 0.0};
gtime_t time; gtime_t time;
int i, nu, nr; int i;
int nu;
int nr;
char msg[128] = ""; char msg[128] = "";
trace(3, "rtkpos : time=%s n=%d\n", time_str(obs[0].time, 3), n); trace(3, "rtkpos : time=%s n=%d\n", time_str(obs[0].time, 3), n);

View File

@ -89,7 +89,8 @@ void writesol(rtksvr_t *svr, int index)
{ {
solopt_t solopt = SOLOPT_DEFAULT; solopt_t solopt = SOLOPT_DEFAULT;
unsigned char buff[1024]; unsigned char buff[1024];
int i, n; int i;
int n;
tracet(4, "writesol: index=%d\n", index); tracet(4, "writesol: index=%d\n", index);
@ -128,7 +129,8 @@ void writesol(rtksvr_t *svr, int index)
/* update navigation data ----------------------------------------------------*/ /* update navigation data ----------------------------------------------------*/
void updatenav(nav_t *nav) void updatenav(nav_t *nav)
{ {
int i, j; int i;
int j;
for (i = 0; i < MAXSAT; i++) for (i = 0; i < MAXSAT; i++)
{ {
for (j = 0; j < NFREQ; j++) for (j = 0; j < NFREQ; j++)
@ -142,7 +144,10 @@ void updatenav(nav_t *nav)
/* update glonass frequency channel number in raw data struct ----------------*/ /* update glonass frequency channel number in raw data struct ----------------*/
void updatefcn(rtksvr_t *svr) void updatefcn(rtksvr_t *svr)
{ {
int i, j, sat, frq; int i;
int j;
int sat;
int frq;
for (i = 0; i < MAXPRNGLO; i++) for (i = 0; i < MAXPRNGLO; i++)
{ {
@ -178,11 +183,22 @@ void updatefcn(rtksvr_t *svr)
void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat,
sbsmsg_t *sbsmsg, int index, int iobs) sbsmsg_t *sbsmsg, int index, int iobs)
{ {
eph_t *eph1, *eph2, *eph3; eph_t *eph1;
geph_t *geph1, *geph2, *geph3; eph_t *eph2;
eph_t *eph3;
geph_t *geph1;
geph_t *geph2;
geph_t *geph3;
// gtime_t tof; // gtime_t tof;
double pos[3], del[3] = {0}, dr[3]; double pos[3];
int i, n = 0, prn, sbssat = svr->rtk.opt.sbassatsel, sys, iode; double del[3] = {0};
double dr[3];
int i;
int n = 0;
int prn;
int sbssat = svr->rtk.opt.sbassatsel;
int sys;
int iode;
tracet(4, "updatesvr: ret=%d sat=%2d index=%d\n", ret, sat, index); tracet(4, "updatesvr: ret=%d sat=%2d index=%d\n", ret, sat, index);
@ -383,7 +399,10 @@ int decoderaw(rtksvr_t *svr, int index)
obs_t *obs; obs_t *obs;
nav_t *nav; nav_t *nav;
sbsmsg_t *sbsmsg = nullptr; sbsmsg_t *sbsmsg = nullptr;
int i, ret = 0, sat, fobs = 0; int i;
int ret = 0;
int sat;
int fobs = 0;
tracet(4, "decoderaw: index=%d\n", index); tracet(4, "decoderaw: index=%d\n", index);
@ -556,9 +575,16 @@ void *rtksvrthread(void *arg)
obs_t obs; obs_t obs;
obsd_t data[MAXOBS * 2]; obsd_t data[MAXOBS * 2];
double tt; double tt;
unsigned int tick, ticknmea; unsigned int tick;
unsigned char *p, *q; unsigned int ticknmea;
int i, j, n, fobs[3] = {0}, cycle, cputime; unsigned char *p;
unsigned char *q;
int i;
int j;
int n;
int fobs[3] = {0};
int cycle;
int cputime;
tracet(3, "rtksvrthread:\n"); tracet(3, "rtksvrthread:\n");
@ -708,7 +734,8 @@ int rtksvrinit(rtksvr_t *svr)
geph_t geph0 = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0}, geph_t geph0 = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0},
0.0, 0.0, 0.0}; 0.0, 0.0, 0.0};
seph_t seph0 = {0, {0, 0.0}, {0, 0.0}, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, 0.0}; seph_t seph0 = {0, {0, 0.0}, {0, 0.0}, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, 0.0};
int i, j; int i;
int j;
tracet(3, "rtksvrinit:\n"); tracet(3, "rtksvrinit:\n");
@ -833,7 +860,8 @@ int rtksvrinit(rtksvr_t *svr)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void rtksvrfree(rtksvr_t *svr) void rtksvrfree(rtksvr_t *svr)
{ {
int i, j; int i;
int j;
free(svr->nav.eph); free(svr->nav.eph);
free(svr->nav.geph); free(svr->nav.geph);
@ -904,8 +932,11 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs,
const double *nmeapos, prcopt_t *prcopt, const double *nmeapos, prcopt_t *prcopt,
solopt_t *solopt, stream_t *moni) solopt_t *solopt, stream_t *moni)
{ {
gtime_t time, time0 = {0, 0.0}; gtime_t time;
int i, j, rw; gtime_t time0 = {0, 0.0};
int i;
int j;
int rw;
tracet(3, "rtksvrstart: cycle=%d buffsize=%d navsel=%d nmeacycle=%d nmeareq=%d\n", tracet(3, "rtksvrstart: cycle=%d buffsize=%d navsel=%d nmeacycle=%d nmeareq=%d\n",
cycle, buffsize, navsel, nmeacycle, nmeareq); cycle, buffsize, navsel, nmeacycle, nmeareq);
@ -1181,7 +1212,9 @@ void rtksvrclosestr(rtksvr_t *svr, int index)
int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat, int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat,
double *az, double *el, int **snr, int *vsat) double *az, double *el, int **snr, int *vsat)
{ {
int i, j, ns; int i;
int j;
int ns;
tracet(4, "rtksvrostat: rcv=%d\n", rcv); tracet(4, "rtksvrostat: rcv=%d\n", rcv);
@ -1228,7 +1261,8 @@ int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat,
void rtksvrsstat(rtksvr_t *svr, int *sstat, char *msg) void rtksvrsstat(rtksvr_t *svr, int *sstat, char *msg)
{ {
int i; int i;
char s[MAXSTRMSG], *p = msg; char s[MAXSTRMSG];
char *p = msg;
tracet(4, "rtksvrsstat:\n"); tracet(4, "rtksvrsstat:\n");

View File

@ -110,7 +110,9 @@ double degfcorr(int ai)
/* decode type 1: prn masks --------------------------------------------------*/ /* decode type 1: prn masks --------------------------------------------------*/
int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat) int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat)
{ {
int i, n, sat; int i;
int n;
int sat;
trace(4, "decode_sbstype1:\n"); trace(4, "decode_sbstype1:\n");
@ -164,8 +166,13 @@ int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat)
/* decode type 2-5,0: fast corrections ---------------------------------------*/ /* decode type 2-5,0: fast corrections ---------------------------------------*/
int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat) int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat)
{ {
int i, j, iodf, type, udre; int i;
double prc, dt; int j;
int iodf;
int type;
int udre;
double prc;
double dt;
gtime_t t0; gtime_t t0;
trace(4, "decode_sbstype2:\n"); trace(4, "decode_sbstype2:\n");
@ -211,7 +218,9 @@ int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat)
/* decode type 6: integrity info ---------------------------------------------*/ /* decode type 6: integrity info ---------------------------------------------*/
int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat) int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat)
{ {
int i, iodf[4], udre; int i;
int iodf[4];
int udre;
trace(4, "decode_sbstype6:\n"); trace(4, "decode_sbstype6:\n");
@ -259,7 +268,9 @@ int decode_sbstype7(const sbsmsg_t *msg, sbssat_t *sbssat)
int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav) int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
{ {
seph_t seph = {0, {0, 0}, {0, 0}, 0, 0, {}, {}, {}, 0.0, 0.0}; seph_t seph = {0, {0, 0}, {0, 0}, 0, 0, {}, {}, {}, 0.0, 0.0};
int i, sat, t; int i;
int sat;
int t;
trace(4, "decode_sbstype9:\n"); trace(4, "decode_sbstype9:\n");
@ -313,7 +324,11 @@ int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion) int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion)
{ {
const sbsigpband_t *p; const sbsigpband_t *p;
int i, j, n, m, band = getbitu(msg->msg, 18, 4); int i;
int j;
int n;
int m;
int band = getbitu(msg->msg, 18, 4);
trace(4, "decode_sbstype18:\n"); trace(4, "decode_sbstype18:\n");
@ -361,7 +376,8 @@ int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion)
/* decode half long term correction (vel code=0) -----------------------------*/ /* decode half long term correction (vel code=0) -----------------------------*/
int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat) int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
{ {
int i, n = getbitu(msg->msg, p, 6); int i;
int n = getbitu(msg->msg, p, 6);
trace(4, "decode_longcorr0:\n"); trace(4, "decode_longcorr0:\n");
@ -389,7 +405,9 @@ int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
/* decode half long term correction (vel code=1) -----------------------------*/ /* decode half long term correction (vel code=1) -----------------------------*/
int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat) int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
{ {
int i, n = getbitu(msg->msg, p, 6), t; int i;
int n = getbitu(msg->msg, p, 6);
int t;
trace(4, "decode_longcorr1:\n"); trace(4, "decode_longcorr1:\n");
@ -447,7 +465,11 @@ int decode_longcorrh(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
/* decode type 24: mixed fast/long term correction ---------------------------*/ /* decode type 24: mixed fast/long term correction ---------------------------*/
int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat) int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat)
{ {
int i, j, iodf, blk, udre; int i;
int j;
int iodf;
int blk;
int udre;
trace(4, "decode_sbstype24:\n"); trace(4, "decode_sbstype24:\n");
@ -488,7 +510,12 @@ int decode_sbstype25(const sbsmsg_t *msg, sbssat_t *sbssat)
/* decode type 26: ionospheric deley corrections -----------------------------*/ /* decode type 26: ionospheric deley corrections -----------------------------*/
int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion) int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion)
{ {
int i, j, block, delay, give, band = getbitu(msg->msg, 14, 4); int i;
int j;
int block;
int delay;
int give;
int band = getbitu(msg->msg, 14, 4);
trace(4, "decode_sbstype26:\n"); trace(4, "decode_sbstype26:\n");
@ -533,7 +560,8 @@ int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav) int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav)
{ {
int type = getbitu(msg->msg, 8, 6), stat = -1; int type = getbitu(msg->msg, 8, 6);
int stat = -1;
trace(3, "sbsupdatecorr: type=%d\n", type); trace(3, "sbsupdatecorr: type=%d\n", type);
@ -591,10 +619,16 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,
sbs_t *sbs) sbs_t *sbs)
{ {
sbsmsg_t *sbs_msgs; sbsmsg_t *sbs_msgs;
int i, week, prn, ch, msg; int i;
int week;
int prn;
int ch;
int msg;
unsigned int b; unsigned int b;
double tow, ep[6] = {}; double tow;
char buff[256], *p; double ep[6] = {};
char buff[256];
char *p;
gtime_t time; gtime_t time;
FILE *fp; FILE *fp;
@ -715,7 +749,8 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,
/* compare sbas messages -----------------------------------------------------*/ /* compare sbas messages -----------------------------------------------------*/
int cmpmsgs(const void *p1, const void *p2) int cmpmsgs(const void *p1, const void *p2)
{ {
auto *q1 = (sbsmsg_t *)p1, *q2 = (sbsmsg_t *)p2; auto *q1 = (sbsmsg_t *)p1;
auto *q2 = (sbsmsg_t *)p2;
return q1->week != q2->week ? q1->week - q2->week : (q1->tow < q2->tow ? -1 : (q1->tow > q2->tow ? 1 : q1->prn - q2->prn)); return q1->week != q2->week ? q1->week - q2->week : (q1->tow < q2->tow ? -1 : (q1->tow > q2->tow ? 1 : q1->prn - q2->prn));
} }
@ -738,8 +773,10 @@ int cmpmsgs(const void *p1, const void *p2)
int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te,
sbs_t *sbs) sbs_t *sbs)
{ {
char *efiles[MAXEXFILE] = {}, *ext; char *efiles[MAXEXFILE] = {};
int i, n; char *ext;
int i;
int n;
trace(3, "sbsreadmsgt: file=%s sel=%d\n", file, sel); trace(3, "sbsreadmsgt: file=%s sel=%d\n", file, sel);
@ -787,7 +824,8 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te,
int sbsreadmsg(const char *file, int sel, sbs_t *sbs) int sbsreadmsg(const char *file, int sel, sbs_t *sbs)
{ {
gtime_t ts = {0, 0}, te = {0, 0}; gtime_t ts = {0, 0};
gtime_t te = {0, 0};
trace(3, "sbsreadmsg: file=%s sel=%d\n", file, sel); trace(3, "sbsreadmsg: file=%s sel=%d\n", file, sel);
@ -803,7 +841,8 @@ int sbsreadmsg(const char *file, int sel, sbs_t *sbs)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg) void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg)
{ {
int i, type = sbsmsg->msg[1] >> 2; int i;
int type = sbsmsg->msg[1] >> 2;
trace(4, "sbsoutmsg:\n"); trace(4, "sbsoutmsg:\n");
@ -820,8 +859,11 @@ void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg)
void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sbsion_t *ion, void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sbsion_t *ion,
const sbsigp_t **igp, double *x, double *y) const sbsigp_t **igp, double *x, double *y)
{ {
int i, latp[2], lonp[4]; int i;
double lat = pos[0] * R2D, lon = pos[1] * R2D; int latp[2];
int lonp[4];
double lat = pos[0] * R2D;
double lon = pos[1] * R2D;
const sbsigp_t *p; const sbsigp_t *p;
trace(4, "searchigp: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D); trace(4, "searchigp: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D);
@ -928,9 +970,16 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb
int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos,
const double *azel, double *delay, double *var) const double *azel, double *delay, double *var)
{ {
const double re = 6378.1363, hion = 350.0; const double re = 6378.1363;
int i, err = 0; const double hion = 350.0;
double fp, posp[2], x = 0.0, y = 0.0, t, w[4] = {}; int i;
int err = 0;
double fp;
double posp[2];
double x = 0.0;
double y = 0.0;
double t;
double w[4] = {};
const sbsigp_t *igp[4] = {}; /* {ws,wn,es,en} */ const sbsigp_t *igp[4] = {}; /* {ws,wn,es,en} */
trace(4, "sbsioncorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D, trace(4, "sbsioncorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D,
@ -1030,7 +1079,8 @@ void getmet(double lat, double *met)
{1015.75, 283.15, 11.66, 5.58E-3, 2.57, -2.25, 11.00, 7.24, 0.32E-3, 0.46}, {1015.75, 283.15, 11.66, 5.58E-3, 2.57, -2.25, 11.00, 7.24, 0.32E-3, 0.46},
{1011.75, 272.15, 6.78, 5.39E-3, 1.81, -1.75, 15.00, 5.36, 0.81E-3, 0.74}, {1011.75, 272.15, 6.78, 5.39E-3, 1.81, -1.75, 15.00, 5.36, 0.81E-3, 0.74},
{1013.00, 263.65, 4.11, 4.53E-3, 1.55, -0.50, 14.50, 3.39, 0.62E-3, 0.30}}; {1013.00, 263.65, 4.11, 4.53E-3, 1.55, -0.50, 14.50, 3.39, 0.62E-3, 0.30}};
int i, j; int i;
int j;
double a; double a;
lat = fabs(lat); lat = fabs(lat);
if (lat <= 15.0) if (lat <= 15.0)
@ -1070,10 +1120,20 @@ void getmet(double lat, double *met)
double sbstropcorr(gtime_t time, const double *pos, const double *azel, double sbstropcorr(gtime_t time, const double *pos, const double *azel,
double *var) double *var)
{ {
const double k1 = 77.604, k2 = 382000.0, rd = 287.054, gm = 9.784, g = 9.80665; const double k1 = 77.604;
static double pos_[3] = {}, zh = 0.0, zw = 0.0; const double k2 = 382000.0;
const double rd = 287.054;
const double gm = 9.784;
const double g = 9.80665;
static double pos_[3] = {};
static double zh = 0.0;
static double zw = 0.0;
int i; int i;
double c, met[10], sinel = sin(azel[1]), h = pos[2], m; double c;
double met[10];
double sinel = sin(azel[1]);
double h = pos[2];
double m;
trace(4, "sbstropcorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D, trace(4, "sbstropcorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D,
azel[0] * R2D, azel[1] * R2D); azel[0] * R2D, azel[1] * R2D);
@ -1216,7 +1276,9 @@ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat,
int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs,
double *dts, double *var) double *dts, double *var)
{ {
double drs[3] = {}, dclk = 0.0, prc = 0.0; double drs[3] = {};
double dclk = 0.0;
double prc = 0.0;
int i; int i;
trace(3, "sbssatcorr : sat=%2d\n", sat); trace(3, "sbssatcorr : sat=%2d\n", sat);
@ -1256,7 +1318,8 @@ int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs,
int sbsdecodemsg(gtime_t time, int prn, const unsigned int *words, int sbsdecodemsg(gtime_t time, int prn, const unsigned int *words,
sbsmsg_t *sbsmsg) sbsmsg_t *sbsmsg)
{ {
int i, j; int i;
int j;
unsigned char f[29]; unsigned char f[29];
double tow; double tow;

View File

@ -93,8 +93,10 @@ const char *opt2sep(const solopt_t *opt)
/* separate fields -----------------------------------------------------------*/ /* separate fields -----------------------------------------------------------*/
int tonum(char *buff, const char *sep, double *v) int tonum(char *buff, const char *sep, double *v)
{ {
int n, len = static_cast<int>(strlen(sep)); int n;
char *p, *q; int len = static_cast<int>(strlen(sep));
char *p;
char *q;
for (p = buff, n = 0; n < MAXFIELD; p = q + len) for (p = buff, n = 0; n < MAXFIELD; p = q + len)
{ {
@ -166,9 +168,20 @@ void covtosol(const double *P, sol_t *sol)
/* decode nmea gprmc: recommended minimum data for gps -----------------------*/ /* decode nmea gprmc: recommended minimum data for gps -----------------------*/
int decode_nmearmc(char **val, int n, sol_t *sol) int decode_nmearmc(char **val, int n, sol_t *sol)
{ {
double tod = 0.0, lat = 0.0, lon = 0.0, vel = 0.0, dir = 0.0, date = 0.0, ang = 0.0, ep[6]; double tod = 0.0;
double lat = 0.0;
double lon = 0.0;
double vel = 0.0;
double dir = 0.0;
double date = 0.0;
double ang = 0.0;
double ep[6];
double pos[3] = {0}; double pos[3] = {0};
char act = ' ', ns = 'N', ew = 'E', mew = 'E', mode = 'A'; char act = ' ';
char ns = 'N';
char ew = 'E';
char mew = 'E';
char mode = 'A';
int i; int i;
trace(4, "decode_nmearmc: n=%d\n", n); trace(4, "decode_nmearmc: n=%d\n", n);
@ -246,10 +259,22 @@ int decode_nmearmc(char **val, int n, sol_t *sol)
int decode_nmeagga(char **val, int n, sol_t *sol) int decode_nmeagga(char **val, int n, sol_t *sol)
{ {
gtime_t time; gtime_t time;
double tod = 0.0, lat = 0.0, lon = 0.0, hdop = 0.0, alt = 0.0, msl = 0.0, ep[6], tt; double tod = 0.0;
double lat = 0.0;
double lon = 0.0;
double hdop = 0.0;
double alt = 0.0;
double msl = 0.0;
double ep[6];
double tt;
double pos[3] = {0}; double pos[3] = {0};
char ns = 'N', ew = 'E', ua = ' ', um = ' '; char ns = 'N';
int i, solq = 0, nrcv = 0; char ew = 'E';
char ua = ' ';
char um = ' ';
int i;
int solq = 0;
int nrcv = 0;
trace(4, "decode_nmeagga: n=%d\n", n); trace(4, "decode_nmeagga: n=%d\n", n);
@ -342,7 +367,9 @@ int decode_nmeagga(char **val, int n, sol_t *sol)
/* decode nmea ---------------------------------------------------------------*/ /* decode nmea ---------------------------------------------------------------*/
int decode_nmea(char *buff, sol_t *sol) int decode_nmea(char *buff, sol_t *sol)
{ {
char *p, *q, *val[MAXFIELD] = {nullptr}; char *p;
char *q;
char *val[MAXFIELD] = {nullptr};
int n = 0; int n = 0;
trace(4, "decode_nmea: buff=%s\n", buff); trace(4, "decode_nmea: buff=%s\n", buff);
@ -377,8 +404,11 @@ int decode_nmea(char *buff, sol_t *sol)
char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time)
{ {
double v[MAXFIELD]; double v[MAXFIELD];
char *p, *q, s[64] = " "; char *p;
int n, len; char *q;
char s[64] = " ";
int n;
int len;
trace(4, "decode_soltime:\n"); trace(4, "decode_soltime:\n");
@ -463,8 +493,11 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time)
/* decode x/y/z-ecef ---------------------------------------------------------*/ /* decode x/y/z-ecef ---------------------------------------------------------*/
int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol) int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol)
{ {
double val[MAXFIELD], P[9] = {0}; double val[MAXFIELD];
int i = 0, j, n; double P[9] = {0};
int i = 0;
int j;
int n;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
trace(4, "decode_solxyz:\n"); trace(4, "decode_solxyz:\n");
@ -527,8 +560,12 @@ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol)
/* decode lat/lon/height -----------------------------------------------------*/ /* decode lat/lon/height -----------------------------------------------------*/
int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol) int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol)
{ {
double val[MAXFIELD], pos[3], Q[9] = {0}, P[9]; double val[MAXFIELD];
int i = 0, n; double pos[3];
double Q[9] = {0};
double P[9];
int i = 0;
int n;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
trace(4, "decode_solllh:\n"); trace(4, "decode_solllh:\n");
@ -607,8 +644,11 @@ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol)
/* decode e/n/u-baseline -----------------------------------------------------*/ /* decode e/n/u-baseline -----------------------------------------------------*/
int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol) int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol)
{ {
double val[MAXFIELD], Q[9] = {0}; double val[MAXFIELD];
int i = 0, j, n; double Q[9] = {0};
int i = 0;
int j;
int n;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
trace(4, "decode_solenu:\n"); trace(4, "decode_solenu:\n");
@ -672,7 +712,8 @@ int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol)
int decode_solgsi(char *buff, const solopt_t *opt __attribute((unused)), sol_t *sol) int decode_solgsi(char *buff, const solopt_t *opt __attribute((unused)), sol_t *sol)
{ {
double val[MAXFIELD]; double val[MAXFIELD];
int i = 0, j; int i = 0;
int j;
trace(4, "decode_solgsi:\n"); trace(4, "decode_solgsi:\n");
@ -724,8 +765,10 @@ int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol)
/* decode reference position -------------------------------------------------*/ /* decode reference position -------------------------------------------------*/
void decode_refpos(char *buff, const solopt_t *opt, double *rb) void decode_refpos(char *buff, const solopt_t *opt, double *rb)
{ {
double val[MAXFIELD], pos[3]; double val[MAXFIELD];
int i, n; double pos[3];
int i;
int n;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
trace(3, "decode_refpos: buff=%s\n", buff); trace(3, "decode_refpos: buff=%s\n", buff);
@ -955,7 +998,8 @@ int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag,
/* compare solution data -----------------------------------------------------*/ /* compare solution data -----------------------------------------------------*/
int cmpsol(const void *p1, const void *p2) int cmpsol(const void *p1, const void *p2)
{ {
auto *q1 = (sol_t *)p1, *q2 = (sol_t *)p2; auto *q1 = (sol_t *)p1;
auto *q2 = (sol_t *)p2;
double tt = timediff(q1->time, q2->time); double tt = timediff(q1->time, q2->time);
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0); return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
} }
@ -1183,7 +1227,8 @@ void freesolstatbuf(solstatbuf_t *solstatbuf)
/* compare solution status ---------------------------------------------------*/ /* compare solution status ---------------------------------------------------*/
int cmpsolstat(const void *p1, const void *p2) int cmpsolstat(const void *p1, const void *p2)
{ {
auto *q1 = (solstat_t *)p1, *q2 = (solstat_t *)p2; auto *q1 = (solstat_t *)p1;
auto *q2 = (solstat_t *)p2;
double tt = timediff(q1->time, q2->time); double tt = timediff(q1->time, q2->time);
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0); return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
} }
@ -1220,9 +1265,25 @@ int sort_solstat(solstatbuf_t *statbuf)
int decode_solstat(char *buff, solstat_t *stat) int decode_solstat(char *buff, solstat_t *stat)
{ {
static const solstat_t stat0 = {{0, 0.0}, '0', '0', 0, 0, 0, 0, '0', '0', 0, 0, 0, 0}; static const solstat_t stat0 = {{0, 0.0}, '0', '0', 0, 0, 0, 0, '0', '0', 0, 0, 0, 0};
double tow, az, el, resp, resc; double tow;
int n, week, sat, frq, vsat, snr, fix, slip, lock, outc, slipc, rejc; double az;
char id[32] = "", *p; double el;
double resp;
double resc;
int n;
int week;
int sat;
int frq;
int vsat;
int snr;
int fix;
int slip;
int lock;
int outc;
int slipc;
int rejc;
char id[32] = "";
char *p;
trace(4, "decode_solstat: buff=%s\n", buff); trace(4, "decode_solstat: buff=%s\n", buff);
@ -1396,7 +1457,11 @@ int outecef(unsigned char *buff, const char *s, const sol_t *sol,
int outpos(unsigned char *buff, const char *s, const sol_t *sol, int outpos(unsigned char *buff, const char *s, const sol_t *sol,
const solopt_t *opt) const solopt_t *opt)
{ {
double pos[3], dms1[3], dms2[3], P[9], Q[9]; double pos[3];
double dms1[3];
double dms2[3];
double P[9];
double Q[9];
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
char *p = reinterpret_cast<char *>(buff); char *p = reinterpret_cast<char *>(buff);
@ -1433,7 +1498,11 @@ int outpos(unsigned char *buff, const char *s, const sol_t *sol,
int outenu(unsigned char *buff, const char *s, const sol_t *sol, int outenu(unsigned char *buff, const char *s, const sol_t *sol,
const double *rb, const solopt_t *opt) const double *rb, const solopt_t *opt)
{ {
double pos[3], rr[3], enu[3], P[9], Q[9]; double pos[3];
double rr[3];
double enu[3];
double P[9];
double Q[9];
int i; int i;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
char *p = reinterpret_cast<char *>(buff); char *p = reinterpret_cast<char *>(buff);
@ -1461,8 +1530,18 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol)
{ {
static double dirp = 0.0; static double dirp = 0.0;
gtime_t time; gtime_t time;
double ep[6], pos[3], enuv[3], dms1[3], dms2[3], vel, dir, amag = 0.0; double ep[6];
char *p = reinterpret_cast<char *>(buff), *q, sum, *emag = (char *)"E"; double pos[3];
double enuv[3];
double dms1[3];
double dms2[3];
double vel;
double dir;
double amag = 0.0;
char *p = reinterpret_cast<char *>(buff);
char *q;
char sum;
char *emag = (char *)"E";
trace(3, "outnmea_rmc:\n"); trace(3, "outnmea_rmc:\n");
@ -1519,9 +1598,16 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol)
int outnmea_gga(unsigned char *buff, const sol_t *sol) int outnmea_gga(unsigned char *buff, const sol_t *sol)
{ {
gtime_t time; gtime_t time;
double h, ep[6], pos[3], dms1[3], dms2[3], dop = 1.0; double h;
double ep[6];
double pos[3];
double dms1[3];
double dms2[3];
double dop = 1.0;
int solq; int solq;
char *p = reinterpret_cast<char *>(buff), *q, sum; char *p = reinterpret_cast<char *>(buff);
char *q;
char sum;
trace(3, "outnmea_gga:\n"); trace(3, "outnmea_gga:\n");
@ -1574,9 +1660,17 @@ int outnmea_gga(unsigned char *buff, const sol_t *sol)
int outnmea_gsa(unsigned char *buff, const sol_t *sol, int outnmea_gsa(unsigned char *buff, const sol_t *sol,
const ssat_t *ssat) const ssat_t *ssat)
{ {
double azel[MAXSAT * 2], dop[4]; double azel[MAXSAT * 2];
int i, sat, sys, nsat, prn[MAXSAT]; double dop[4];
char *p = reinterpret_cast<char *>(buff), *q, *s, sum; int i;
int sat;
int sys;
int nsat;
int prn[MAXSAT];
char *p = reinterpret_cast<char *>(buff);
char *q;
char *s;
char sum;
trace(3, "outnmea_gsa:\n"); trace(3, "outnmea_gsa:\n");
@ -1724,9 +1818,22 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol,
int outnmea_gsv(unsigned char *buff, const sol_t *sol, int outnmea_gsv(unsigned char *buff, const sol_t *sol,
const ssat_t *ssat) const ssat_t *ssat)
{ {
double az, el, snr; double az;
int i, j, k, n, sat, prn, sys, nmsg, sats[MAXSAT]; double el;
char *p = reinterpret_cast<char *>(buff), *q, *s, sum; double snr;
int i;
int j;
int k;
int n;
int sat;
int prn;
int sys;
int nmsg;
int sats[MAXSAT];
char *p = reinterpret_cast<char *>(buff);
char *q;
char *s;
char sum;
trace(3, "outnmea_gsv:\n"); trace(3, "outnmea_gsv:\n");
@ -1984,8 +2091,10 @@ int outprcopts(unsigned char *buff, const prcopt_t *opt)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
int outsolheads(unsigned char *buff, const solopt_t *opt) int outsolheads(unsigned char *buff, const solopt_t *opt)
{ {
const char *s1[] = {"WGS84", "Tokyo"}, *s2[] = {"ellipsoidal", "geodetic"}; const char *s1[] = {"WGS84", "Tokyo"};
const char *s3[] = {"GPST", "UTC ", "JST "}, *sep = opt2sep(opt); const char *s2[] = {"ellipsoidal", "geodetic"};
const char *s3[] = {"GPST", "UTC ", "JST "};
const char *sep = opt2sep(opt);
char *p = reinterpret_cast<char *>(buff); char *p = reinterpret_cast<char *>(buff);
int timeu = opt->timeu < 0 ? 0 : (opt->timeu > 20 ? 20 : opt->timeu); int timeu = opt->timeu < 0 ? 0 : (opt->timeu > 20 ? 20 : opt->timeu);
@ -2061,9 +2170,11 @@ int outsolheads(unsigned char *buff, const solopt_t *opt)
int outsols(unsigned char *buff, const sol_t *sol, const double *rb, int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
const solopt_t *opt) const solopt_t *opt)
{ {
gtime_t time, ts = {0, 0.0}; gtime_t time;
gtime_t ts = {0, 0.0};
double gpst; double gpst;
int week, timeu; int week;
int timeu;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
char s[255]; char s[255];
unsigned char *p = buff; unsigned char *p = buff;

View File

@ -86,8 +86,15 @@ serial_t *openserial(const char *path, int mode, char *msg)
const int br[] = { const int br[] = {
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}; 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400};
serial_t *serial; serial_t *serial;
int i, brate = 9600, bsize = 8, stopb = 1; int i;
char *p, parity = 'N', dev[128], port[128], fctr[64] = ""; int brate = 9600;
int bsize = 8;
int stopb = 1;
char *p;
char parity = 'N';
char dev[128];
char port[128];
char fctr[64] = "";
const speed_t bs[] = { const speed_t bs[] = {
B300, B600, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400}; B300, B600, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400};
@ -240,7 +247,8 @@ int stateserial(serial_t *serial)
int openfile_(file_t *file, gtime_t time, char *msg) int openfile_(file_t *file, gtime_t time, char *msg)
{ {
FILE *fp; FILE *fp;
char *rw, tagpath[MAXSTRPATH + 4] = ""; char *rw;
char tagpath[MAXSTRPATH + 4] = "";
char tagh[TIMETAGH_LEN + 1] = ""; char tagh[TIMETAGH_LEN + 1] = "";
tracet(3, "openfile_: path=%s time=%s\n", file->path, time_str(time, 0)); tracet(3, "openfile_: path=%s time=%s\n", file->path, time_str(time, 0));
@ -362,8 +370,11 @@ void closefile_(file_t *file)
file_t *openfile(const char *path, int mode, char *msg) file_t *openfile(const char *path, int mode, char *msg)
{ {
file_t *file; file_t *file;
gtime_t time, time0 = {0, 0.0}; gtime_t time;
double speed = 0.0, start = 0.0, swapintv = 0.0; gtime_t time0 = {0, 0.0};
double speed = 0.0;
double start = 0.0;
double swapintv = 0.0;
char *p; char *p;
int timetag = 0; int timetag = 0;
@ -512,7 +523,8 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
{ {
struct timeval tv = {0, 0}; struct timeval tv = {0, 0};
fd_set rs; fd_set rs;
unsigned int t, tick; unsigned int t;
unsigned int tick;
int nr = 0; int nr = 0;
size_t fpos; size_t fpos;
@ -612,10 +624,15 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
int writefile(file_t *file, unsigned char *buff, int n, char *msg) int writefile(file_t *file, unsigned char *buff, int n, char *msg)
{ {
gtime_t wtime; gtime_t wtime;
unsigned int ns, tick = tickget(); unsigned int ns;
int week1, week2; unsigned int tick = tickget();
double tow1, tow2, intv; int week1;
size_t fpos, fpos_tmp; int week2;
double tow1;
double tow2;
double intv;
size_t fpos;
size_t fpos_tmp;
if (!file) if (!file)
{ {
@ -697,7 +714,9 @@ void syncfile(file_t *file1, file_t *file2)
void decodetcppath(const char *path, char *addr, char *port, char *user, void decodetcppath(const char *path, char *addr, char *port, char *user,
char *passwd, char *mntpnt, char *str) char *passwd, char *mntpnt, char *str)
{ {
char buff[MAXSTRPATH], *p, *q; char buff[MAXSTRPATH];
char *p;
char *q;
tracet(4, "decodetcpepath: path=%s\n", path); tracet(4, "decodetcpepath: path=%s\n", path);
@ -791,7 +810,8 @@ int errsock(void) { return errno; }
/* set socket option ---------------------------------------------------------*/ /* set socket option ---------------------------------------------------------*/
int setsock(socket_t sock, char *msg) int setsock(socket_t sock, char *msg)
{ {
int bs = buffsize, mode = 1; int bs = buffsize;
int mode = 1;
struct timeval tv = {0, 0}; struct timeval tv = {0, 0};
tracet(3, "setsock: sock=%d\n", sock); tracet(3, "setsock: sock=%d\n", sock);
@ -838,8 +858,10 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len)
int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len) int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len)
{ {
struct timeval tv = {0, 0}; struct timeval tv = {0, 0};
fd_set rs, ws; fd_set rs;
int err, flag; fd_set ws;
int err;
int flag;
flag = fcntl(sock, F_GETFL, 0); flag = fcntl(sock, F_GETFL, 0);
if (fcntl(sock, F_SETFL, flag | O_NONBLOCK) == -1) if (fcntl(sock, F_SETFL, flag | O_NONBLOCK) == -1)
@ -975,7 +997,8 @@ void discontcp(tcp_t *tcp, int tcon)
/* open tcp server -----------------------------------------------------------*/ /* open tcp server -----------------------------------------------------------*/
tcpsvr_t *opentcpsvr(const char *path, char *msg) tcpsvr_t *opentcpsvr(const char *path, char *msg)
{ {
tcpsvr_t *tcpsvr, tcpsvr0{}; tcpsvr_t *tcpsvr;
tcpsvr_t tcpsvr0{};
char port[256] = ""; char port[256] = "";
tracet(3, "opentcpsvr: path=%s\n", path); tracet(3, "opentcpsvr: path=%s\n", path);
@ -1023,7 +1046,9 @@ void closetcpsvr(tcpsvr_t *tcpsvr)
void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg)
{ {
char saddr[256] = ""; char saddr[256] = "";
int i, j, n = 0; int i;
int j;
int n = 0;
tracet(3, "updatetcpsvr: state=%d\n", tcpsvr->svr.state); tracet(3, "updatetcpsvr: state=%d\n", tcpsvr->svr.state);
@ -1084,7 +1109,8 @@ int accsock(tcpsvr_t *tcpsvr, char *msg)
}; };
socket_t sock; socket_t sock;
socklen_t len = sizeof(addr); socklen_t len = sizeof(addr);
int i, err; int i;
int err;
tracet(3, "accsock: sock=%d\n", tcpsvr->svr.sock); tracet(3, "accsock: sock=%d\n", tcpsvr->svr.sock);
@ -1152,7 +1178,8 @@ int waittcpsvr(tcpsvr_t *tcpsvr, char *msg)
/* read tcp server -----------------------------------------------------------*/ /* read tcp server -----------------------------------------------------------*/
int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
{ {
int nr, err; int nr;
int err;
tracet(4, "readtcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n); tracet(4, "readtcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n);
@ -1182,7 +1209,9 @@ int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
/* write tcp server ----------------------------------------------------------*/ /* write tcp server ----------------------------------------------------------*/
int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
{ {
int i, ns = 0, err; int i;
int ns = 0;
int err;
tracet(3, "writetcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n); tracet(3, "writetcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n);
@ -1227,7 +1256,8 @@ int statetcpsvr(tcpsvr_t *tcpsvr)
/* connect server ------------------------------------------------------------*/ /* connect server ------------------------------------------------------------*/
int consock(tcpcli_t *tcpcli, char *msg) int consock(tcpcli_t *tcpcli, char *msg)
{ {
int stat, err; int stat;
int err;
tracet(3, "consock: sock=%d\n", tcpcli->svr.sock); tracet(3, "consock: sock=%d\n", tcpcli->svr.sock);
@ -1264,7 +1294,8 @@ int consock(tcpcli_t *tcpcli, char *msg)
/* open tcp client -----------------------------------------------------------*/ /* open tcp client -----------------------------------------------------------*/
tcpcli_t *opentcpcli(const char *path, char *msg) tcpcli_t *opentcpcli(const char *path, char *msg)
{ {
tcpcli_t *tcpcli, tcpcli0{}; tcpcli_t *tcpcli;
tcpcli_t tcpcli0{};
char port[256] = ""; char port[256] = "";
tracet(3, "opentcpcli: path=%s\n", path); tracet(3, "opentcpcli: path=%s\n", path);
@ -1340,7 +1371,8 @@ int waittcpcli(tcpcli_t *tcpcli, char *msg)
/* read tcp client -----------------------------------------------------------*/ /* read tcp client -----------------------------------------------------------*/
int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
{ {
int nr, err; int nr;
int err;
tracet(4, "readtcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n); tracet(4, "readtcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n);
@ -1369,7 +1401,8 @@ int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
/* write tcp client ----------------------------------------------------------*/ /* write tcp client ----------------------------------------------------------*/
int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
{ {
int ns, err; int ns;
int err;
tracet(3, "writetcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n); tracet(3, "writetcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n);
@ -1407,7 +1440,10 @@ int encbase64(char *str, const unsigned char *byte, int n)
{ {
const char table[] = const char table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i, j, k, b; int i;
int j;
int k;
int b;
tracet(4, "encbase64: n=%d\n", n); tracet(4, "encbase64: n=%d\n", n);
@ -1436,7 +1472,8 @@ int encbase64(char *str, const unsigned char *byte, int n)
/* send ntrip server request -------------------------------------------------*/ /* send ntrip server request -------------------------------------------------*/
int reqntrip_s(ntrip_t *ntrip, char *msg) int reqntrip_s(ntrip_t *ntrip, char *msg)
{ {
char buff[256 + NTRIP_MAXSTR], *p = buff; char buff[256 + NTRIP_MAXSTR];
char *p = buff;
tracet(3, "reqntrip_s: state=%d\n", ntrip->state); tracet(3, "reqntrip_s: state=%d\n", ntrip->state);
@ -1460,7 +1497,9 @@ int reqntrip_s(ntrip_t *ntrip, char *msg)
/* send ntrip client request -------------------------------------------------*/ /* send ntrip client request -------------------------------------------------*/
int reqntrip_c(ntrip_t *ntrip, char *msg) int reqntrip_c(ntrip_t *ntrip, char *msg)
{ {
char buff[1024], user[512], *p = buff; char buff[1024];
char user[512];
char *p = buff;
tracet(3, "reqntrip_c: state=%d\n", ntrip->state); tracet(3, "reqntrip_c: state=%d\n", ntrip->state);
@ -1496,8 +1535,10 @@ int reqntrip_c(ntrip_t *ntrip, char *msg)
/* test ntrip server response ------------------------------------------------*/ /* test ntrip server response ------------------------------------------------*/
int rspntrip_s(ntrip_t *ntrip, char *msg) int rspntrip_s(ntrip_t *ntrip, char *msg)
{ {
int i, nb; int i;
char *p, *q; int nb;
char *p;
char *q;
tracet(3, "rspntrip_s: state=%d nb=%d\n", ntrip->state, ntrip->nb); tracet(3, "rspntrip_s: state=%d nb=%d\n", ntrip->state, ntrip->nb);
ntrip->buff[ntrip->nb] = '0'; ntrip->buff[ntrip->nb] = '0';
@ -1553,7 +1594,8 @@ int rspntrip_s(ntrip_t *ntrip, char *msg)
int rspntrip_c(ntrip_t *ntrip, char *msg) int rspntrip_c(ntrip_t *ntrip, char *msg)
{ {
int i; int i;
char *p, *q; char *p;
char *q;
tracet(3, "rspntrip_c: state=%d nb=%d\n", ntrip->state, ntrip->nb); tracet(3, "rspntrip_c: state=%d nb=%d\n", ntrip->state, ntrip->nb);
ntrip->buff[ntrip->nb] = '0'; ntrip->buff[ntrip->nb] = '0';
@ -1669,7 +1711,9 @@ ntrip_t *openntrip(const char *path, int type, char *msg)
{ {
ntrip_t *ntrip; ntrip_t *ntrip;
int i; int i;
char addr[256] = "", port[256] = "", tpath[MAXSTRPATH]; char addr[256] = "";
char port[256] = "";
char tpath[MAXSTRPATH];
tracet(3, "openntrip: path=%s type=%d\n", path, type); tracet(3, "openntrip: path=%s type=%d\n", path, type);
@ -1780,7 +1824,9 @@ int statentrip(ntrip_t *ntrip)
void decodeftppath(const char *path, char *addr, char *file, char *user, void decodeftppath(const char *path, char *addr, char *file, char *user,
char *passwd, int *topts) char *passwd, int *topts)
{ {
char buff[MAXSTRPATH], *p, *q; char buff[MAXSTRPATH];
char *p;
char *q;
tracet(4, "decodeftpath: path=%s\n", path); tracet(4, "decodeftpath: path=%s\n", path);
@ -1852,7 +1898,8 @@ gtime_t nextdltime(const int *topts, int stat)
{ {
gtime_t time; gtime_t time;
double tow; double tow;
int week, tint; int week;
int tint;
tracet(3, "nextdltime: topts=%d %d %d %d stat=%d\n", topts[0], topts[1], tracet(3, "nextdltime: topts=%d %d %d %d stat=%d\n", topts[0], topts[1],
topts[2], topts[3], stat); topts[2], topts[3], stat);
@ -1882,8 +1929,16 @@ void *ftpthread(void *arg)
auto *ftp = static_cast<ftp_t *>(arg); auto *ftp = static_cast<ftp_t *>(arg);
FILE *fp; FILE *fp;
gtime_t time; gtime_t time;
char remote[1024], local[1024], tmpfile[1024], errfile[1024], *p; char remote[1024];
char cmd[2048], env[1024] = "", opt[1024], *proxyopt = (char *)"", *proto; char local[1024];
char tmpfile[1024];
char errfile[1024];
char *p;
char cmd[2048];
char env[1024] = "";
char opt[1024];
char *proxyopt = (char *)"";
char *proto;
int ret; int ret;
tracet(3, "ftpthread:\n"); tracet(3, "ftpthread:\n");
@ -2097,7 +2152,8 @@ void closeftp(ftp_t *ftp)
int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg)
{ {
gtime_t time; gtime_t time;
unsigned char *p, *q; unsigned char *p;
unsigned char *q;
tracet(4, "readftp: n=%d\n", n); tracet(4, "readftp: n=%d\n", n);
@ -2339,7 +2395,8 @@ void strclose(stream_t *stream)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void strsync(stream_t *stream1, stream_t *stream2) void strsync(stream_t *stream1, stream_t *stream2)
{ {
file_t *file1, *file2; file_t *file1;
file_t *file2;
if (stream1->type != STR_FILE || stream2->type != STR_FILE) if (stream1->type != STR_FILE || stream2->type != STR_FILE)
{ {
return; return;
@ -2710,7 +2767,8 @@ void strsendnmea(stream_t *stream, const double *pos)
{ {
sol_t sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; sol_t sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0};
unsigned char buff[1024]; unsigned char buff[1024];
int i, n; int i;
int n;
tracet(3, "strsendnmea: pos=%.3f %.3f %.3f\n", pos[0], pos[1], pos[2]); tracet(3, "strsendnmea: pos=%.3f %.3f %.3f\n", pos[0], pos[1], pos[2]);
@ -2729,9 +2787,12 @@ void strsendnmea(stream_t *stream, const double *pos)
int gen_hex(const char *msg, unsigned char *buff) int gen_hex(const char *msg, unsigned char *buff)
{ {
unsigned char *q = buff; unsigned char *q = buff;
char mbuff[1024] = "", *args[256], *p; char mbuff[1024] = "";
char *args[256];
char *p;
unsigned int byte; unsigned int byte;
int i, narg = 0; int i;
int narg = 0;
trace(4, "gen_hex: msg=%s\n", msg); trace(4, "gen_hex: msg=%s\n", msg);
@ -2760,9 +2821,13 @@ int gen_hex(const char *msg, unsigned char *buff)
void strsendcmd(stream_t *str, const char *cmd) void strsendcmd(stream_t *str, const char *cmd)
{ {
unsigned char buff[1024]; unsigned char buff[1024];
const char *p = cmd, *q; const char *p = cmd;
char msg[1024], cmdend[] = "\r\n"; const char *q;
int n, m, ms; char msg[1024];
char cmdend[] = "\r\n";
int n;
int m;
int ms;
tracet(3, "strsendcmd: cmd=%s\n", cmd); tracet(3, "strsendcmd: cmd=%s\n", cmd);

View File

@ -59,8 +59,23 @@
void tide_pl(const double *eu, const double *rp, double GMp, void tide_pl(const double *eu, const double *rp, double GMp,
const double *pos, double *dr) const double *pos, double *dr)
{ {
const double H3 = 0.292, L3 = 0.015; const double H3 = 0.292;
double r, ep[3], latp, lonp, p, K2, K3, a, H2, L2, dp, du, cosp, sinl, cosl; const double L3 = 0.015;
double r;
double ep[3];
double latp;
double lonp;
double p;
double K2;
double K3;
double a;
double H2;
double L2;
double dp;
double du;
double cosp;
double sinl;
double cosl;
int i; int i;
trace(4, "tide_pl : pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D); trace(4, "tide_pl : pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D);
@ -112,7 +127,13 @@ void tide_solid(const double *rsun, const double *rmoon,
const double *pos, const double *E, double gmst, int opt, const double *pos, const double *E, double gmst, int opt,
double *dr) double *dr)
{ {
double dr1[3], dr2[3], eu[3], du, dn, sinl, sin2l; double dr1[3];
double dr2[3];
double eu[3];
double du;
double dn;
double sinl;
double sin2l;
trace(3, "tide_solid: pos=%.3f %.3f opt=%d\n", pos[0] * R2D, pos[1] * R2D, opt); trace(3, "tide_solid: pos=%.3f %.3f opt=%d\n", pos[0] * R2D, pos[1] * R2D, opt);
@ -163,8 +184,17 @@ void tide_oload(gtime_t tut, const double *odisp, double *denu)
{0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */ {0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */
}; };
const double ep1975[] = {1975, 1, 1, 0, 0, 0}; const double ep1975[] = {1975, 1, 1, 0, 0, 0};
double ep[6], fday, days, t, t2, t3, a[5], ang, dp[3] = {0}; double ep[6];
int i, j; double fday;
double days;
double t;
double t2;
double t3;
double a[5];
double ang;
double dp[3] = {0};
int i;
int j;
trace(3, "tide_oload:\n"); trace(3, "tide_oload:\n");
@ -208,7 +238,9 @@ void tide_oload(gtime_t tut, const double *odisp, double *denu)
void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar) void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar)
{ {
const double ep2000[] = {2000, 1, 1, 0, 0, 0}; const double ep2000[] = {2000, 1, 1, 0, 0, 0};
double y, y2, y3; double y;
double y2;
double y3;
y = timediff(tut, epoch2time(ep2000)) / 86400.0 / 365.25; y = timediff(tut, epoch2time(ep2000)) / 86400.0 / 365.25;
@ -231,7 +263,12 @@ void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar)
void tide_pole(gtime_t tut, const double *pos, const double *erpv, void tide_pole(gtime_t tut, const double *pos, const double *erpv,
double *denu) double *denu)
{ {
double xp_bar, yp_bar, m1, m2, cosl, sinl; double xp_bar;
double yp_bar;
double m1;
double m2;
double cosl;
double sinl;
trace(3, "tide_pole: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D); trace(3, "tide_pole: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D);
@ -282,7 +319,14 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp,
const double *odisp, double *dr) const double *odisp, double *dr)
{ {
gtime_t tut; gtime_t tut;
double pos[2], E[9], drt[3], denu[3], rs[3], rm[3], gmst, erpv[5] = {0}; double pos[2];
double E[9];
double drt[3];
double denu[3];
double rs[3];
double rm[3];
double gmst;
double erpv[5] = {0};
int i; int i;
#ifdef IERS_MODEL #ifdef IERS_MODEL
double ep[6], fhr; double ep[6], fhr;

View File

@ -48,7 +48,8 @@ DirectResamplerConditioner::DirectResamplerConditioner(
{ {
std::string default_item_type = "short"; std::string default_item_type = "short";
std::string default_dump_file = "./data/signal_conditioner.dat"; std::string default_dump_file = "./data/signal_conditioner.dat";
double fs_in_deprecated, fs_in; double fs_in_deprecated;
double fs_in;
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0); fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0); sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);

View File

@ -43,7 +43,8 @@ MmseResamplerConditioner::MmseResamplerConditioner(
{ {
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_conditioner.dat"; std::string default_dump_file = "./data/signal_conditioner.dat";
double fs_in_deprecated, fs_in; double fs_in_deprecated;
double fs_in;
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0); fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0); sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);

View File

@ -319,7 +319,7 @@ void Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread(pcap_t *pcap_handle)
} }
void Gr_Complex_Ip_Packet_Source::demux_samples(gr_vector_void_star output_items, int num_samples_readed) void Gr_Complex_Ip_Packet_Source::demux_samples(const gr_vector_void_star& output_items, int num_samples_readed)
{ {
int8_t real; int8_t real;
int8_t imag; int8_t imag;

View File

@ -98,7 +98,7 @@ private:
size_t d_item_size; size_t d_item_size;
bool d_IQ_swap; bool d_IQ_swap;
boost::thread *d_pcap_thread; boost::thread *d_pcap_thread;
void demux_samples(gr_vector_void_star output_items, int num_samples_readed); void demux_samples(const gr_vector_void_star& output_items, int num_samples_readed);
void my_pcap_loop_thread(pcap_t *pcap_handle); void my_pcap_loop_thread(pcap_t *pcap_handle);
void pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); void pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);
static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);

View File

@ -40,7 +40,7 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS
glonass_l1_ca_telemetry_decoder.h glonass_l1_ca_telemetry_decoder.h
glonass_l2_ca_telemetry_decoder.h glonass_l2_ca_telemetry_decoder.h
beidou_b1i_telemetry_decoder.h beidou_b1i_telemetry_decoder.h
beidou_b3i_telemetry_decoder.h beidou_b3i_telemetry_decoder.h
) )
list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS)

View File

@ -130,7 +130,8 @@ beidou_b1i_telemetry_decoder_gs::~beidou_b1i_telemetry_decoder_gs()
void beidou_b1i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits, std::array<int32_t, 15> &decbits) void beidou_b1i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits, std::array<int32_t, 15> &decbits)
{ {
int32_t bit, err; int32_t bit;
int32_t err;
std::array<int32_t, 4> reg{1, 1, 1, 1}; std::array<int32_t, 4> reg{1, 1, 1, 1};
const std::array<int32_t, 15> errind{14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; const std::array<int32_t, 15> errind{14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2};
@ -373,7 +374,6 @@ void beidou_b1i_telemetry_decoder_gs::reset()
d_sent_tlm_failed_msg = false; d_sent_tlm_failed_msg = false;
d_flag_valid_word = false; d_flag_valid_word = false;
DLOG(INFO) << "Beidou B1I Telemetry decoder reset for satellite " << d_satellite; DLOG(INFO) << "Beidou B1I Telemetry decoder reset for satellite " << d_satellite;
return;
} }
int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),

View File

@ -131,7 +131,8 @@ beidou_b3i_telemetry_decoder_gs::~beidou_b3i_telemetry_decoder_gs()
void beidou_b3i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits, void beidou_b3i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits,
std::array<int32_t, 15> &decbits) std::array<int32_t, 15> &decbits)
{ {
int32_t bit, err; int32_t bit;
int32_t err;
std::array<int32_t, 4> reg{1, 1, 1, 1}; std::array<int32_t, 4> reg{1, 1, 1, 1};
const std::array<int32_t, 15> errind{14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; const std::array<int32_t, 15> errind{14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2};
@ -395,7 +396,6 @@ void beidou_b3i_telemetry_decoder_gs::reset()
d_sent_tlm_failed_msg = false; d_sent_tlm_failed_msg = false;
d_flag_valid_word = false; d_flag_valid_word = false;
DLOG(INFO) << "Beidou B3I Telemetry decoder reset for satellite " << d_satellite; DLOG(INFO) << "Beidou B3I Telemetry decoder reset for satellite " << d_satellite;
return;
} }

View File

@ -135,7 +135,15 @@ gps_l1_ca_telemetry_decoder_gs::~gps_l1_ca_telemetry_decoder_gs()
bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword) bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword)
{ {
uint32_t d1, d2, d3, d4, d5, d6, d7, t, parity; uint32_t d1;
uint32_t d2;
uint32_t d3;
uint32_t d4;
uint32_t d5;
uint32_t d6;
uint32_t d7;
uint32_t t;
uint32_t parity;
// XOR as many bits in parallel as possible. The magic constants pick // XOR as many bits in parallel as possible. The magic constants pick
// up bits which are to be XOR'ed together to implement the GPS parity // up bits which are to be XOR'ed together to implement the GPS parity
// check algorithm described in IS-GPS-200E. This avoids lengthy shift- // check algorithm described in IS-GPS-200E. This avoids lengthy shift-

View File

@ -95,7 +95,10 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count,
/* C-language butterfly */ /* C-language butterfly */
#define BFLY(i) \ #define BFLY(i) \
{ \ { \
unsigned int metric, m0, m1, decision; \ unsigned int metric; \
unsigned int m0; \
unsigned int m1; \
unsigned int decision; \
metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1); \ metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1); \
m0 = v->old_metrics[i] + metric; \ m0 = v->old_metrics[i] + metric; \
m1 = v->old_metrics[(i) + 32] + (510 - metric); \ m1 = v->old_metrics[(i) + 32] + (510 - metric); \
@ -118,7 +121,8 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count,
*/ */
void v27_update(v27_t *v, const unsigned char *syms, int nbits) void v27_update(v27_t *v, const unsigned char *syms, int nbits)
{ {
unsigned char sym0, sym1; unsigned char sym0;
unsigned char sym1;
unsigned int *tmp; unsigned int *tmp;
int normalize = 0; int normalize = 0;

View File

@ -164,7 +164,9 @@ void Viterbi_Decoder::init_trellis_state()
int Viterbi_Decoder::do_acs(const double sym[], int nbits) int Viterbi_Decoder::do_acs(const double sym[], int nbits)
{ {
int t, i, state_at_t; int t;
int i;
int state_at_t;
float metric; float metric;
float max_val; float max_val;
std::vector<float> pm_t_next(d_states); std::vector<float> pm_t_next(d_states);
@ -365,7 +367,8 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons
int KK, int nn) int KK, int nn)
{ {
int nextstate[1]; int nextstate[1];
int state, states; int state;
int states;
states = (1U << (KK - 1)); /* The number of states: 2^mm */ states = (1U << (KK - 1)); /* The number of states: 2^mm */
/* Determine the output and next state for each possible starting state */ /* Determine the output and next state for each possible starting state */
@ -374,9 +377,9 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons
output_p[state] = nsc_enc_bit(nextstate, input, state, g, KK, nn); output_p[state] = nsc_enc_bit(nextstate, input, state, g, KK, nn);
trans_p[state] = nextstate[0]; trans_p[state] = nextstate[0];
} }
return;
} }
/* Function nsc_enc_bit() /* Function nsc_enc_bit()
Description: Convolutionally encodes a single bit using a rate 1/n encoder. Description: Convolutionally encodes a single bit using a rate 1/n encoder.
@ -395,12 +398,12 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons
(i.e. the state after encoding this bit) (i.e. the state after encoding this bit)
This function is used by rsc_encode(), nsc_transit(), rsc_transit(), and nsc_transit() */ This function is used by rsc_encode(), nsc_transit(), rsc_transit(), and nsc_transit() */
int Viterbi_Decoder::nsc_enc_bit(int state_out_p[], int input, int state_in, int Viterbi_Decoder::nsc_enc_bit(int state_out_p[], int input, int state_in,
const int g[], int KK, int nn) const int g[], int KK, int nn)
{ {
/* declare variables */ /* declare variables */
int state, i; int state;
int i;
int out = 0; int out = 0;
/* create a word made up of state and new input */ /* create a word made up of state and new input */

View File

@ -109,7 +109,7 @@ if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11)
) )
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Rel) if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(tracking_gr_blocks target_compile_definitions(tracking_gr_blocks
PUBLIC -DARMA_NO_BOUND_CHECKING=1 PUBLIC -DARMA_NO_BOUND_CHECKING=1
) )

View File

@ -1230,7 +1230,11 @@ void dll_pll_veml_tracking::log_data()
// Dump results to file // Dump results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL; float tmp_VE;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VL;
float tmp_float; float tmp_float;
double tmp_double; double tmp_double;
uint64_t tmp_long_int; uint64_t tmp_long_int;

View File

@ -991,7 +991,11 @@ void dll_pll_veml_tracking_fpga::log_data()
// Dump results to file // Dump results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL; float tmp_VE;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VL;
float tmp_float; float tmp_float;
double tmp_double; double tmp_double;
uint64_t tmp_long_int; uint64_t tmp_long_int;

View File

@ -479,7 +479,9 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -250,7 +250,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -832,7 +833,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -246,7 +246,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -822,7 +823,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -207,7 +207,8 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -675,7 +676,9 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_float; float tmp_float;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;

View File

@ -247,7 +247,8 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -830,7 +831,9 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -245,7 +245,8 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -821,7 +822,9 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -207,7 +207,8 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -675,7 +676,9 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_float; float tmp_float;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;

View File

@ -304,7 +304,8 @@ void Gps_L1_Ca_Kf_Tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in); double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples; double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -853,7 +854,9 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -211,7 +211,8 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
float N_prn_diff; float N_prn_diff;
N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
float corrected_acq_phase_samples, delay_correction_samples; float corrected_acq_phase_samples;
float delay_correction_samples;
corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
@ -514,7 +515,9 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I; float prompt_I;
float prompt_Q; float prompt_Q;
float tmp_E, tmp_P, tmp_L; float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0; float tmp_VE = 0.0;
float tmp_VL = 0.0; float tmp_VL = 0.0;
float tmp_float; float tmp_float;

View File

@ -134,7 +134,7 @@ if(OS_IS_MACOSX)
endif() endif()
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Rel) if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(tracking_libs target_compile_definitions(tracking_libs
PUBLIC -DARMA_NO_BOUND_CHECKING=1 PUBLIC -DARMA_NO_BOUND_CHECKING=1
) )

View File

@ -127,7 +127,8 @@ Fpga_Multicorrelator_8sc::~Fpga_Multicorrelator_8sc()
uint64_t Fpga_Multicorrelator_8sc::read_sample_counter() uint64_t Fpga_Multicorrelator_8sc::read_sample_counter()
{ {
uint64_t sample_counter_tmp, sample_counter_msw_tmp; uint64_t sample_counter_tmp;
uint64_t sample_counter_msw_tmp;
sample_counter_tmp = d_map_base[sample_counter_reg_addr_lsw]; sample_counter_tmp = d_map_base[sample_counter_reg_addr_lsw];
sample_counter_msw_tmp = d_map_base[sample_counter_reg_addr_msw]; sample_counter_msw_tmp = d_map_base[sample_counter_reg_addr_msw];
sample_counter_msw_tmp = sample_counter_msw_tmp << 32; sample_counter_msw_tmp = sample_counter_msw_tmp << 32;

View File

@ -102,8 +102,7 @@ void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array<float, N
std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl;
std::cin >> controlc; std::cin >> controlc;
} }
return; }
}
void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> buf, Tcp_Packet_Data* tcp_data_) void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> buf, Tcp_Packet_Data* tcp_data_)
@ -137,8 +136,7 @@ void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NU
std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl;
std::cin >> controlc; std::cin >> controlc;
} }
return; }
}
void Tcp_Communication::close_tcp_connection(size_t d_port_) void Tcp_Communication::close_tcp_connection(size_t d_port_)
@ -146,5 +144,4 @@ void Tcp_Communication::close_tcp_connection(size_t d_port_)
// Close the TCP connection // Close the TCP connection
tcp_socket_.close(); tcp_socket_.close();
std::cout << "Socket closed on port " << d_port_ << std::endl; std::cout << "Socket closed on port " << d_port_ << std::endl;
return;
} }

View File

@ -64,7 +64,8 @@ double phase_unwrap(double phase_rad)
*/ */
double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, double t2) double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, double t2)
{ {
double cross, dot; double cross;
double dot;
dot = prompt_s1.real() * prompt_s2.real() + prompt_s1.imag() * prompt_s2.imag(); dot = prompt_s1.real() * prompt_s2.real() + prompt_s1.imag() * prompt_s2.imag();
cross = prompt_s1.real() * prompt_s2.imag() - prompt_s2.real() * prompt_s1.imag(); cross = prompt_s1.real() * prompt_s2.imag() - prompt_s2.real() * prompt_s1.imag();
return atan2(cross, dot) / (t2 - t1); return atan2(cross, dot) / (t2 - t1);

View File

@ -194,7 +194,8 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__((
{ {
wait_for_interrupt(); wait_for_interrupt();
uint64_t sample_counter_tmp, sample_counter_msw_tmp; uint64_t sample_counter_tmp;
uint64_t sample_counter_msw_tmp;
sample_counter_tmp = map_base[0]; sample_counter_tmp = map_base[0];
sample_counter_msw_tmp = map_base[1]; sample_counter_msw_tmp = map_base[1];
sample_counter_msw_tmp = sample_counter_msw_tmp << 32; sample_counter_msw_tmp = sample_counter_msw_tmp << 32;

View File

@ -227,7 +227,9 @@ static int
INTEGER__compar_enum2value(const void *kp, const void *am) { INTEGER__compar_enum2value(const void *kp, const void *am) {
const struct e2v_key *key = (const struct e2v_key *)kp; const struct e2v_key *key = (const struct e2v_key *)kp;
const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
const char *ptr, *end, *name; const char *ptr;
const char *end;
const char *name;
/* Remap the element (sort by different criterion) */ /* Remap the element (sort by different criterion) */
el = key->vemap + key->evmap[el - key->vemap]; el = key->vemap + key->evmap[el - key->vemap];
@ -763,7 +765,8 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
int int
asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) { asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
uint8_t *b, *end; uint8_t *b;
uint8_t *end;
size_t size; size_t size;
long l; long l;
@ -823,7 +826,8 @@ asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
int int
asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) { asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) {
uint8_t *b, *end; uint8_t *b;
uint8_t *end;
unsigned long l; unsigned long l;
size_t size; size_t size;
@ -880,7 +884,8 @@ asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
int int
asn_long2INTEGER(INTEGER_t *st, long value) { asn_long2INTEGER(INTEGER_t *st, long value) {
uint8_t *buf, *bp; uint8_t *buf;
uint8_t *bp;
uint8_t *p; uint8_t *p;
uint8_t *pstart; uint8_t *pstart;
uint8_t *pend1; uint8_t *pend1;

View File

@ -141,7 +141,8 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
asn_enc_rval_t er; asn_enc_rval_t er;
long native, value; long native;
long value;
asn_per_constraint_t *ct; asn_per_constraint_t *ct;
int inext = 0; int inext = 0;
asn_INTEGER_enum_map_t key; asn_INTEGER_enum_map_t key;

View File

@ -242,7 +242,9 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
ber_tlv_tag_t tlv_tag; ber_tlv_tag_t tlv_tag;
ber_tlv_len_t tlv_len; ber_tlv_len_t tlv_len;
ber_tlv_tag_t expected_tag; ber_tlv_tag_t expected_tag;
ssize_t tl, ll, tlvl; ssize_t tl;
ssize_t ll;
ssize_t tlvl;
/* This one works even if (sel->left == -1) */ /* This one works even if (sel->left == -1) */
ssize_t Left = ((!sel||(size_t)sel->left >= size) ssize_t Left = ((!sel||(size_t)sel->left >= size)
?(ssize_t)size:sel->left); ?(ssize_t)size:sel->left);
@ -738,7 +740,8 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) { asn_app_consume_bytes_f *cb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
asn_enc_rval_t er; asn_enc_rval_t er;
uint8_t *buf, *end; uint8_t *buf;
uint8_t *end;
uint8_t *ss; /* Sequence start */ uint8_t *ss; /* Sequence start */
ssize_t encoded_len = 0; ssize_t encoded_len = 0;

View File

@ -319,7 +319,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
sizeof(specs->tag2el[0]), _t2e_cmp); sizeof(specs->tag2el[0]), _t2e_cmp);
if(t2m) { if(t2m) {
asn_TYPE_tag2member_t *best = 0; asn_TYPE_tag2member_t *best = 0;
asn_TYPE_tag2member_t *t2m_f, *t2m_l; asn_TYPE_tag2member_t *t2m_f;
asn_TYPE_tag2member_t *t2m_l;
int edx_max = edx + elements[edx].optional; int edx_max = edx + elements[edx].optional;
/* /*
* Rewind to the first element with that tag, * Rewind to the first element with that tag,
@ -447,7 +448,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Skip everything until the end of the SEQUENCE. * Skip everything until the end of the SEQUENCE.
*/ */
while(ctx->left) { while(ctx->left) {
ssize_t tl, ll; ssize_t tl;
ssize_t ll;
tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
switch(tl) { switch(tl) {

View File

@ -68,8 +68,6 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch
memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
arg->errbuf[arg->errlen] = 0; arg->errbuf[arg->errlen] = 0;
} }
return;
} }
int int

View File

@ -321,7 +321,8 @@ static int
uper_ugot_refill(asn_per_data_t *pd) uper_ugot_refill(asn_per_data_t *pd)
{ {
uper_ugot_key *arg = pd->refill_key; uper_ugot_key *arg = pd->refill_key;
ssize_t next_chunk_bytes, next_chunk_bits; ssize_t next_chunk_bytes;
ssize_t next_chunk_bits;
ssize_t avail; ssize_t avail;
asn_per_data_t *oldpd = &arg->oldpd; asn_per_data_t *oldpd = &arg->oldpd;

View File

@ -46,7 +46,8 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
nleft = pd->nbits - pd->nboff; nleft = pd->nbits - pd->nboff;
if(nbits > nleft) { if(nbits > nleft) {
int32_t tailv, vhead; int32_t tailv;
int32_t vhead;
if(!pd->refill || nbits > 31) return -1; if(!pd->refill || nbits > 31) return -1;
/* Accumulate unused bytes before refill */ /* Accumulate unused bytes before refill */
ASN_DEBUG("Obtain the rest %d bits (want %d)", ASN_DEBUG("Obtain the rest %d bits (want %d)",

View File

@ -139,7 +139,8 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
* Determine the tag name. * Determine the tag name.
*/ */
for(end = buf + size; buf < end; buf++, need_tag++) { for(end = buf + size; buf < end; buf++, need_tag++) {
int b = *buf, n = *need_tag; int b = *buf;
int n = *need_tag;
if(b != n) { if(b != n) {
if(n == 0) { if(n == 0) {
switch(b) { switch(b) {

View File

@ -13,7 +13,8 @@ asn_enc_rval_t
xer_encode(asn_TYPE_descriptor_t *td, void *sptr, xer_encode(asn_TYPE_descriptor_t *td, void *sptr,
enum xer_encoder_flags_e xer_flags, enum xer_encoder_flags_e xer_flags,
asn_app_consume_bytes_f *cb, void *app_key) { asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er, tmper; asn_enc_rval_t er;
asn_enc_rval_t tmper;
const char *mname; const char *mname;
size_t mlen; size_t mlen;
int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;

View File

@ -210,7 +210,8 @@ GeneralizedTime_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) { asn_app_consume_bytes_f *cb, void *app_key) {
GeneralizedTime_t *st = (GeneralizedTime_t *)sptr; GeneralizedTime_t *st = (GeneralizedTime_t *)sptr;
asn_enc_rval_t erval; asn_enc_rval_t erval;
int fv, fd; /* seconds fraction value and number of digits */ int fv;
int fd; /* seconds fraction value and number of digits */
struct tm tm; struct tm tm;
time_t tloc; time_t tloc;
@ -244,7 +245,8 @@ GeneralizedTime_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
if(flags & XER_F_CANONICAL) { if(flags & XER_F_CANONICAL) {
GeneralizedTime_t *gt; GeneralizedTime_t *gt;
asn_enc_rval_t rv; asn_enc_rval_t rv;
int fv, fd; /* fractional parts */ int fv;
int fd; /* fractional parts */
struct tm tm; struct tm tm;
errno = EPERM; errno = EPERM;
@ -304,7 +306,8 @@ asn_GT2time(const GeneralizedTime_t *st, struct tm *ret_tm, int as_gmt) {
time_t time_t
asn_GT2time_prec(const GeneralizedTime_t *st, int *frac_value, int frac_digits, struct tm *ret_tm, int as_gmt) { asn_GT2time_prec(const GeneralizedTime_t *st, int *frac_value, int frac_digits, struct tm *ret_tm, int as_gmt) {
time_t tloc; time_t tloc;
int fv, fd = 0; int fv;
int fd = 0;
if(frac_value) if(frac_value)
tloc = asn_GT2time_frac(st, &fv, &fd, ret_tm, as_gmt); tloc = asn_GT2time_frac(st, &fv, &fd, ret_tm, as_gmt);

View File

@ -227,7 +227,9 @@ static int
INTEGER__compar_enum2value(const void *kp, const void *am) { INTEGER__compar_enum2value(const void *kp, const void *am) {
const struct e2v_key *key = (const struct e2v_key *)kp; const struct e2v_key *key = (const struct e2v_key *)kp;
const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
const char *ptr, *end, *name; const char *ptr;
const char *end;
const char *name;
/* Remap the element (sort by different criterion) */ /* Remap the element (sort by different criterion) */
el = key->vemap + key->evmap[el - key->vemap]; el = key->vemap + key->evmap[el - key->vemap];
@ -763,7 +765,8 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
int int
asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) { asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
uint8_t *b, *end; uint8_t *b;
uint8_t *end;
size_t size; size_t size;
long l; long l;
@ -823,7 +826,8 @@ asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
int int
asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) { asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) {
uint8_t *b, *end; uint8_t *b;
uint8_t *end;
unsigned long l; unsigned long l;
size_t size; size_t size;
@ -880,7 +884,8 @@ asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
int int
asn_long2INTEGER(INTEGER_t *st, long value) { asn_long2INTEGER(INTEGER_t *st, long value) {
uint8_t *buf, *bp; uint8_t *buf;
uint8_t *bp;
uint8_t *p; uint8_t *p;
uint8_t *pstart; uint8_t *pstart;
uint8_t *pend1; uint8_t *pend1;

View File

@ -141,7 +141,8 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
asn_enc_rval_t er; asn_enc_rval_t er;
long native, value; long native;
long value;
asn_per_constraint_t *ct; asn_per_constraint_t *ct;
int inext = 0; int inext = 0;
asn_INTEGER_enum_map_t key; asn_INTEGER_enum_map_t key;

View File

@ -242,7 +242,9 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
ber_tlv_tag_t tlv_tag; ber_tlv_tag_t tlv_tag;
ber_tlv_len_t tlv_len; ber_tlv_len_t tlv_len;
ber_tlv_tag_t expected_tag; ber_tlv_tag_t expected_tag;
ssize_t tl, ll, tlvl; ssize_t tl;
ssize_t ll;
ssize_t tlvl;
/* This one works even if (sel->left == -1) */ /* This one works even if (sel->left == -1) */
ssize_t Left = ((!sel||(size_t)sel->left >= size) ssize_t Left = ((!sel||(size_t)sel->left >= size)
?(ssize_t)size:sel->left); ?(ssize_t)size:sel->left);
@ -738,7 +740,8 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) { asn_app_consume_bytes_f *cb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
asn_enc_rval_t er; asn_enc_rval_t er;
uint8_t *buf, *end; uint8_t *buf;
uint8_t *end;
uint8_t *ss; /* Sequence start */ uint8_t *ss; /* Sequence start */
ssize_t encoded_len = 0; ssize_t encoded_len = 0;

View File

@ -319,7 +319,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
sizeof(specs->tag2el[0]), _t2e_cmp); sizeof(specs->tag2el[0]), _t2e_cmp);
if(t2m) { if(t2m) {
asn_TYPE_tag2member_t *best = 0; asn_TYPE_tag2member_t *best = 0;
asn_TYPE_tag2member_t *t2m_f, *t2m_l; asn_TYPE_tag2member_t *t2m_f;
asn_TYPE_tag2member_t *t2m_l;
int edx_max = edx + elements[edx].optional; int edx_max = edx + elements[edx].optional;
/* /*
* Rewind to the first element with that tag, * Rewind to the first element with that tag,
@ -447,7 +448,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Skip everything until the end of the SEQUENCE. * Skip everything until the end of the SEQUENCE.
*/ */
while(ctx->left) { while(ctx->left) {
ssize_t tl, ll; ssize_t tl;
ssize_t ll;
tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
switch(tl) { switch(tl) {

View File

@ -68,8 +68,6 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch
memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
arg->errbuf[arg->errlen] = 0; arg->errbuf[arg->errlen] = 0;
} }
return;
} }
int int

View File

@ -321,7 +321,8 @@ static int
uper_ugot_refill(asn_per_data_t *pd) uper_ugot_refill(asn_per_data_t *pd)
{ {
uper_ugot_key *arg = pd->refill_key; uper_ugot_key *arg = pd->refill_key;
ssize_t next_chunk_bytes, next_chunk_bits; ssize_t next_chunk_bytes;
ssize_t next_chunk_bits;
ssize_t avail; ssize_t avail;
asn_per_data_t *oldpd = &arg->oldpd; asn_per_data_t *oldpd = &arg->oldpd;

View File

@ -46,7 +46,8 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
nleft = pd->nbits - pd->nboff; nleft = pd->nbits - pd->nboff;
if(nbits > nleft) { if(nbits > nleft) {
int32_t tailv, vhead; int32_t tailv;
int32_t vhead;
if(!pd->refill || nbits > 31) return -1; if(!pd->refill || nbits > 31) return -1;
/* Accumulate unused bytes before refill */ /* Accumulate unused bytes before refill */
ASN_DEBUG("Obtain the rest %d bits (want %d)", ASN_DEBUG("Obtain the rest %d bits (want %d)",

View File

@ -139,7 +139,8 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
* Determine the tag name. * Determine the tag name.
*/ */
for(end = buf + size; buf < end; buf++, need_tag++) { for(end = buf + size; buf < end; buf++, need_tag++) {
int b = *buf, n = *need_tag; int b = *buf;
int n = *need_tag;
if(b != n) { if(b != n) {
if(n == 0) { if(n == 0) {
switch(b) { switch(b) {

View File

@ -13,7 +13,8 @@ asn_enc_rval_t
xer_encode(asn_TYPE_descriptor_t *td, void *sptr, xer_encode(asn_TYPE_descriptor_t *td, void *sptr,
enum xer_encoder_flags_e xer_flags, enum xer_encoder_flags_e xer_flags,
asn_app_consume_bytes_f *cb, void *app_key) { asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er, tmper; asn_enc_rval_t er;
asn_enc_rval_t tmper;
const char *mname; const char *mname;
size_t mlen; size_t mlen;
int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;

View File

@ -306,7 +306,8 @@ void EXPORT supl_close(supl_ctx_t *ctx)
static int server_connect(char *server) static int server_connect(char *server)
{ {
int fd = -1; int fd = -1;
struct addrinfo *ailist, *aip; struct addrinfo *ailist;
struct addrinfo *aip;
struct addrinfo hint; struct addrinfo hint;
int err; int err;
@ -677,7 +678,8 @@ int EXPORT supl_collect_rrlp(supl_assist_t *assist, PDU_t *rrlp, struct timeval
loc = &hdr->refLocation->threeDLocation; loc = &hdr->refLocation->threeDLocation;
if (loc->size == 14 && loc->buf[0] == 0x90) if (loc->size == 14 && loc->buf[0] == 0x90)
{ {
double lat, lon; double lat;
double lon;
long l; long l;
/* from 3GPP TS 23.032 V4.0.0 (2001-04) */ /* from 3GPP TS 23.032 V4.0.0 (2001-04) */

View File

@ -154,7 +154,7 @@ target_link_libraries(core_receiver
Armadillo::armadillo Armadillo::armadillo
) )
if(CMAKE_BUILD_TYPE MATCHES Rel) if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(core_receiver target_compile_definitions(core_receiver
PRIVATE -DARMA_NO_BOUND_CHECKING=1 PRIVATE -DARMA_NO_BOUND_CHECKING=1
) )

View File

@ -948,7 +948,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
double sat_pos_variance_m2; double sat_pos_variance_m2;
eph2pos(gps_gtime, &rtklib_eph, r_sat.data(), &clock_bias_s, eph2pos(gps_gtime, &rtklib_eph, r_sat.data(), &clock_bias_s,
&sat_pos_variance_m2); &sat_pos_variance_m2);
double Az, El, dist_m; double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e; arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx); topocent(&Az, &El, &dist_m, r_eb_e, dx);
@ -971,7 +973,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
double sat_pos_variance_m2; double sat_pos_variance_m2;
eph2pos(gps_gtime, &rtklib_eph, r_sat.data(), &clock_bias_s, eph2pos(gps_gtime, &rtklib_eph, r_sat.data(), &clock_bias_s,
&sat_pos_variance_m2); &sat_pos_variance_m2);
double Az, El, dist_m; double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e; arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx); topocent(&Az, &El, &dist_m, r_eb_e, dx);
@ -995,7 +999,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
aux_gtime.sec = 0.0; aux_gtime.sec = 0.0;
alm2pos(aux_gtime, &rtklib_alm, r_sat.data(), &clock_bias_s); alm2pos(aux_gtime, &rtklib_alm, r_sat.data(), &clock_bias_s);
double Az, El, dist_m; double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e; arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx); topocent(&Az, &El, &dist_m, r_eb_e, dx);
@ -1023,7 +1029,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
gal_gtime.sec = 0.0; gal_gtime.sec = 0.0;
alm2pos(gal_gtime, &rtklib_alm, r_sat.data(), &clock_bias_s); alm2pos(gal_gtime, &rtklib_alm, r_sat.data(), &clock_bias_s);
double Az, El, dist_m; double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e; arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx); topocent(&Az, &El, &dist_m, r_eb_e, dx);

View File

@ -1166,7 +1166,7 @@ void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs)
// project Doppler from primary frequency to secondary frequency // project Doppler from primary frequency to secondary frequency
double GNSSFlowgraph::project_doppler(std::string searched_signal, double primary_freq_doppler_hz) double GNSSFlowgraph::project_doppler(const std::string& searched_signal, double primary_freq_doppler_hz)
{ {
switch (mapStringValues_[searched_signal]) switch (mapStringValues_[searched_signal])
{ {

View File

@ -181,7 +181,7 @@ private:
void push_back_signal(const Gnss_Signal& gs); void push_back_signal(const Gnss_Signal& gs);
void remove_signal(const Gnss_Signal& gs); void remove_signal(const Gnss_Signal& gs);
double project_doppler(std::string searched_signal, double primary_freq_doppler_hz); double project_doppler(const std::string& searched_signal, double primary_freq_doppler_hz);
bool connected_; bool connected_;
bool running_; bool running_;
int sources_count_; int sources_count_;

View File

@ -137,7 +137,11 @@ std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine
// } // }
// str_stream << "--------------------------------------------------------\n"; // str_stream << "--------------------------------------------------------\n";
double longitude_deg, latitude_deg, height_m, ground_speed_kmh, course_over_ground_deg; double longitude_deg;
double latitude_deg;
double height_m;
double ground_speed_kmh;
double course_over_ground_deg;
time_t UTC_time; time_t UTC_time;
if (PVT_sptr_->get_latest_PVT(&longitude_deg, if (PVT_sptr_->get_latest_PVT(&longitude_deg,
&latitude_deg, &latitude_deg,

View File

@ -114,7 +114,8 @@ void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_cor
double tod = 0.0; double tod = 0.0;
double glot2utc = 3 * 3600; double glot2utc = 3 * 3600;
double days = 0.0; double days = 0.0;
double total_sec = 0.0, sec_of_day = 0.0; double total_sec = 0.0;
double sec_of_day = 0.0;
int i = 0; int i = 0;
boost::gregorian::date gps_epoch{1980, 1, 6}; boost::gregorian::date gps_epoch{1980, 1, 6};

View File

@ -283,7 +283,6 @@ void Gnss_Satellite::set_rf_link(int32_t rf_link_)
{ {
// Set satellite's rf link. Identifies the GLONASS Frequency Channel // Set satellite's rf link. Identifies the GLONASS Frequency Channel
rf_link = rf_link_; rf_link = rf_link_;
return;
} }

View File

@ -144,7 +144,8 @@ int main(int argc, char** argv)
} }
} }
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
start = std::chrono::system_clock::now(); start = std::chrono::system_clock::now();
int return_code = 0; int return_code = 0;
try try

View File

@ -293,7 +293,6 @@ void receive_msg()
} }
} }
} }
return;
} }
@ -450,7 +449,8 @@ TEST_F(TtffTest /*unused*/, ColdStart /*unused*/)
// record startup time // record startup time
std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl; std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
start = std::chrono::system_clock::now(); start = std::chrono::system_clock::now();
// start receiver // start receiver
try try
@ -533,7 +533,8 @@ TEST_F(TtffTest /*unused*/, HotStart /*unused*/)
} }
// record startup time // record startup time
std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl; std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
start = std::chrono::system_clock::now(); start = std::chrono::system_clock::now();
// start receiver // start receiver

View File

@ -260,7 +260,8 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
{ {
int fs_in = 4000000; int fs_in = 4000000;
int nsamples = 4000; int nsamples = 4000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>(); std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
@ -291,7 +292,8 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults) TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0.0); std::chrono::duration<double> elapsed_seconds(0.0);
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");

View File

@ -189,7 +189,8 @@ TEST_F(FirFilterTest, InstantiateCbyteGrComplex)
TEST_F(FirFilterTest, ConnectAndRun) TEST_F(FirFilterTest, ConnectAndRun)
{ {
int fs_in = 4000000; int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test"); top_block = gr::make_top_block("Fir filter test");
@ -220,7 +221,8 @@ TEST_F(FirFilterTest, ConnectAndRun)
TEST_F(FirFilterTest, ConnectAndRunGrcomplex) TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test"); top_block = gr::make_top_block("Fir filter test");
@ -261,7 +263,8 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
TEST_F(FirFilterTest, ConnectAndRunCshorts) TEST_F(FirFilterTest, ConnectAndRunCshorts)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test"); top_block = gr::make_top_block("Fir filter test");
@ -305,7 +308,8 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts)
TEST_F(FirFilterTest, ConnectAndRunCbytes) TEST_F(FirFilterTest, ConnectAndRunCbytes)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test"); top_block = gr::make_top_block("Fir filter test");
@ -349,7 +353,8 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes)
TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test"); top_block = gr::make_top_block("Fir filter test");

View File

@ -105,7 +105,8 @@ TEST_F(NotchFilterLiteTest, InstantiateGrComplexGrComplex)
TEST_F(NotchFilterLiteTest, ConnectAndRun) TEST_F(NotchFilterLiteTest, ConnectAndRun)
{ {
int fs_in = 4000000; int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter lite test"); top_block = gr::make_top_block("Notch filter lite test");
init(); init();
@ -135,7 +136,8 @@ TEST_F(NotchFilterLiteTest, ConnectAndRun)
TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter lite test"); top_block = gr::make_top_block("Notch filter lite test");
init(); init();

View File

@ -105,7 +105,8 @@ TEST_F(NotchFilterTest, InstantiateGrComplexGrComplex)
TEST_F(NotchFilterTest, ConnectAndRun) TEST_F(NotchFilterTest, ConnectAndRun)
{ {
int fs_in = 4000000; int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter test"); top_block = gr::make_top_block("Notch filter test");
init(); init();
@ -135,7 +136,8 @@ TEST_F(NotchFilterTest, ConnectAndRun)
TEST_F(NotchFilterTest, ConnectAndRunGrcomplex) TEST_F(NotchFilterTest, ConnectAndRunGrcomplex)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter test"); top_block = gr::make_top_block("Notch filter test");
init(); init();

View File

@ -104,7 +104,8 @@ TEST_F(PulseBlankingFilterTest, InstantiateGrComplexGrComplex)
TEST_F(PulseBlankingFilterTest, ConnectAndRun) TEST_F(PulseBlankingFilterTest, ConnectAndRun)
{ {
int fs_in = 4000000; int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Pulse Blanking filter test"); top_block = gr::make_top_block("Pulse Blanking filter test");
init(); init();
@ -134,7 +135,8 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRun)
TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex) TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Pulse Blanking filter test"); top_block = gr::make_top_block("Pulse Blanking filter test");
init(); init();

View File

@ -67,7 +67,8 @@ void run_correlator_cpu_real_codes(Cpu_Multicorrelator_Real_Codes* correlator,
TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
int max_threads = FLAGS_cpu_multicorrelator_real_codes_max_threads_test; int max_threads = FLAGS_cpu_multicorrelator_real_codes_max_threads_test;
std::vector<std::thread> thread_pool; std::vector<std::thread> thread_pool;

View File

@ -111,7 +111,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
{ {
int fs_in = 8000000; int fs_in = 8000000;
int nsamples = 40000000; int nsamples = 40000000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
init(); init();
queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>(); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
@ -154,7 +155,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
// int num_samples = 40000000; // 4 Msps // int num_samples = 40000000; // 4 Msps
// unsigned int skiphead_sps = 24000000; // 4 Msps // unsigned int skiphead_sps = 24000000; // 4 Msps

View File

@ -454,7 +454,8 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
// DO not generate signal raw signal samples and observations RINEX file by default // DO not generate signal raw signal samples and observations RINEX file by default
//generate_signal(); //generate_signal();
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
configure_receiver(); configure_receiver();

Some files were not shown because too many files have changed in this diff Show More